Bug 246785 - [PATCH] Statistics plugin make the UI lock for a while when going offline
Summary: [PATCH] Statistics plugin make the UI lock for a while when going offline
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: Statistics plugin (show other bugs)
Version: 1.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-05 11:52 UTC by Maciek Weksej
Modified: 2012-12-09 01:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.6.3


Attachments
Patch (12.66 KB, patch)
2010-08-05 11:52 UTC, Maciek Weksej
Details

Note You need to log in before you can comment on or make changes to this bug.
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