Review Request 123924: Optimize KIconEngine::availableSizes()
Aleix Pol Gonzalez
aleixpol at kde.org
Tue Jun 2 16:04:02 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123924/
-----------------------------------------------------------
(Updated June 2, 2015, 4:04 p.m.)
Status
------
This change has been marked as submitted.
Review request for KDE Frameworks and Christoph Feck.
Changes
-------
Submitted with commit 5fdfb9dd2abc1caf6cb63a6f73800b19f5d6357a by Aleix Pol to branch master.
Repository: kiconthemes
Description
-------
It's called a ton of times (over 30k times when opening kdevelop and changing area at some point) and it's quite slow nowadays. The reason is that we're retrieving the icon path every time to see if it's available (because it goes through aaaaaaall of the themes' directories to find the best available icon).
This patch adds a dictionary in the KIconLoader so that we can cache for the icons we already found, clears it when the theme changes.
Also we're construct the same sizes list every time, now we're always returning the same list.
Diffs
-----
src/kiconengine.h 461efff
src/kiconengine.cpp 208c055
src/kiconloader.h 7944726
src/kiconloader.cpp c47eecb
Diff: https://git.reviewboard.kde.org/r/123924/diff/
Testing
-------
Tests still pass.
It doesn't show a big problem in the same use-case in kdevelop anymore (99.5% of hits).
Thanks,
Aleix Pol Gonzalez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150602/f5837d8f/attachment.html>
More information about the Kde-frameworks-devel
mailing list