Bug 170156 - Akregator unresponsive due to expensive Feed::totalCount() calculation
Summary: Akregator unresponsive due to expensive Feed::totalCount() calculation
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: SVN
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 170250 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-01 00:56 UTC by Eduardo Habkost
Modified: 2008-09-04 04:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Experimental patch to improve this (2.16 KB, patch)
2008-09-01 00:57 UTC, Eduardo Habkost
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo Habkost 2008-09-01 00:56:33 UTC
Version:            (using KDE 4.1.0)
OS:                Linux
Installed from:    Fedora RPMs

I've been testing KDE 4.1 and noticed Akregator is a little unresponsive sometimes. Some investigation revealed it was using too much CPU simply calculate the totalCount field on the list of feeds.

I have feed articles history of five years on my Akregator archive, that makes the Feed::totalCount method too expensive because it walks on every article on every feed.

The oprofile output of when I was experiencing irregular freezes (around a quarter of a second freezes, every few seconds) revealed:

CPU: Core Solo / Duo, speed 1833 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Unhalted clock cycles) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples  %        linenr info                 app name                 symbol name
4673     41.7680  article.cpp:247             akregatorpart.so         Akregator::Article::isDeleted() const
985       8.8041  feed.cpp:764                akregatorpart.so         Akregator::Feed::totalCount() const
584       5.2199  folder.cpp:133              akregatorpart.so         Akregator::Folder::feeds() const
230       2.0558  univ.cpp:72                 akregator_mk4storage_plugin.so c4_BaseArray::SetLength(int)
227       2.0290  mk4plugin.cpp:0             akregator_mk4storage_plugin.so __i686.get_pc_thunk.bx
211       1.8859  remap.cpp:168               akregator_mk4storage_plugin.so c4_HashViewer::CalcHash(c4_Cursor) const
168       1.5016  column.cpp:1448             akregator_mk4storage_plugin.so c4_ColIter::Next()
159       1.4212  handler.cpp:51              akregator_mk4storage_plugin.so c4_Handler::GetBytes(int, c4_Bytes&, bool)
136       1.2156  feed.cpp:725                akregatorpart.so         Akregator::Feed::unread() const
131       1.1709  (no location information)   akregatorpart.so         .plt
131       1.1709  treenode.cpp:192            akregatorpart.so         Akregator::TreeNode::id() const
[...]


I've made an experimental patch to make class Feed precalculate the totalCount() results to avoid recalculating it too frequently. It seems to make it more responsible, but I still need to get some numbers to back that up.
Comment 1 Eduardo Habkost 2008-09-01 00:57:56 UTC
Created attachment 27154 [details]
Experimental patch to improve this
Comment 2 Eduardo Habkost 2008-09-04 04:37:15 UTC
Fixed by osterfeld on svn trunk, revision 855904.
Comment 3 Eduardo Habkost 2008-09-04 04:44:44 UTC
*** Bug 170250 has been marked as a duplicate of this bug. ***