KFileItem optimization

Jakub Stachowski qbast at go2.pl
Sun Jan 4 13:30:28 CET 2009


Dnia Saturday 03 January 2009, Jakub Stachowski napisał:
> Hello,
[ ... ]

>  Another possible optimization: for each item, KFileItemDelegate checks
> actual size of file icon. Is this really necessary? Or maybe it would be
> enough to check size for first icon in the view and then reuse it.

Some more checking shows that for given decoration size (stored in 
option.decorationSize), actual icon size is always the same - one of  the 
common sizes like 64x64, 256x256 etc.
Caching the size makes laying out items about 20% faster (on top of previous 
patch).
KFileItemDelegate objects are not created in great numbers (one per view), so 
adding two QSize fields will not have any effect on memory usage.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-optimize/attachments/20090104/80bac756/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iconopt.patch
Type: text/x-patch
Size: 949 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20090104/80bac756/attachment.patch 


More information about the Kde-optimize mailing list