[patch] KConfig: Efficient iterators

David Jarvie djarvie at kde.org
Tue Apr 22 14:22:26 BST 2008


On Monday 21 April 2008 18:44, Jarosław Staniek wrote:
>
> For review
> I have encountered that every call took more than 1 second and ~100% of
> CPU on my box, in debugging session for KMail (win32/msvc). Strange.
>
> Use KEntryMap::ConstIterator instead of foreach with entryMap.keys().
>
> Infinite loops may take just one second on your box too, _but_ better to
> optimize them :)

If foreach has such a bad impact on performance, I suggest adding comments
about this into the code, just in case anybody in future is tempted to
change the code back to foreach.

-- 
David Jarvie.
KAlarm author & maintainer.
http://www.astrojar.org.uk/kalarm





More information about the kde-core-devel mailing list