mirror of
https://github.com/znc/znc.git
synced 2026-07-31 14:03:00 +02:00
CUser: Save CIRCSock* instead of looking it up every time
Via profiling ZNC it was found that much CPU time was spent inside FindSockByName() which in turn was called by CUser::GetIRCSock(): w00t volunteered to write a patch to save that pointer inside CUser and here is the result. Thanks. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1053 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -100,6 +100,8 @@ bool CZNC::OnBoot() {
|
||||
|
||||
bool CZNC::ConnectUser(CUser *pUser) {
|
||||
CString sSockName = "IRC::" + pUser->GetUserName();
|
||||
// Don't use pUser->GetIRCSock(), as that only returns something if the
|
||||
// CIRCSock is already connected, not when it's still connecting!
|
||||
CIRCSock* pIRCSock = (CIRCSock*) m_Manager.FindSockByName(sSockName);
|
||||
|
||||
if (m_pISpoofLockFile != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user