Bug 246785

Summary: [PATCH] Statistics plugin make the UI lock for a while when going offline
Product: [Applications] kopete Reporter: Maciek Weksej <katoda>
Component: Statistics pluginAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: pali.rohar
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.6.3
Attachments: Patch

Description Maciek Weksej 2010-08-05 11:52:12 UTC
Created attachment 49830 [details]
Patch

Version:           1.0.0 (using KDE 4.4.5) 
OS:                Linux

When having 100+ contacts and going offline, UI locks for about 3-4 seconds.

Reproducible: Always

Steps to Reproduce:
Go online, and then go offline.

Actual Results:  
UI locks for about 3-4 seconds

Expected Results:  
UI doesn't lock.

It's caused by many onlineStatusChanged() method calls, and each call invokes a DB query, that is performed by UI thread. My patch creates an additional thread for Statistics Plugin that is responsible for querying the database. UI thread leaves messages in a blocking queue, and DB thread queries the database.
Comment 1 Lamarque V. Souza 2011-04-10 07:07:30 UTC
SVN commit 1227533 by lvsouza:

Per metacontact statistics DB is created only when contact goes online
or when statistics for an offline metacontact is requested.
This improves plugin startup and shutdown times and also helps with UI
responsiveness.

Now shutdown time is proportional to the number of metacontacts that went
online since Kopete has started plus the number of offline metacontacts
that the user requested statistics from. That is better then being
proportional to the number of all metacontacts registered but is not that
good yet.

BUG: 117989, 138903
CCBUG: 246785
FIXED-IN: 4.6.3


 M  +34 -2     statisticsplugin.cpp  
 M  +2 -0      statisticsplugin.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1227533
Comment 2 Lamarque V. Souza 2011-04-10 07:10:28 UTC
SVN commit 1227534 by lvsouza:

Backporting 1227533 to 4.6 branch:

Per metacontact statistics DB is created only when contact goes online
or when statistics for an offline metacontact is requested.
This improves plugin startup and shutdown times and also helps with UI
responsiveness.

Now shutdown time is proportional to the number of metacontacts that went
online since Kopete has started plus the number of offline metacontacts
that the user requested statistics from. That is better then being
proportional to the number of all metacontacts registered but is not that
good yet.

BUG: 117989, 138903
CCBUG: 246785
FIXED-IN: 4.6.3


 M  +34 -2     statisticsplugin.cpp  
 M  +2 -0      statisticsplugin.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1227534