Review Request 123924: Optimize KIconEngine::availableSizes()

Aleix Pol Gonzalez aleixpol at kde.org
Thu May 28 14:41:22 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123924/
-----------------------------------------------------------

Review request for KDE Frameworks and Christoph Feck.


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/20150528/f98b92ef/attachment.html>


More information about the Kde-frameworks-devel mailing list