KFileItem optimization
Jakub Stachowski
qbast at go2.pl
Sat Jan 3 15:32:58 CET 2009
Hello,
After entering large directory but before displaying its contents, Dolphin
spends some time laying out item in a view
(QListViewPrivate::doItemsLayout()). Of that time about 42% is spent getting
icon name for each KFileItem. It is slow operation, because of mime-
>is("application/x-desktop") check, which constructs KMimeType object for
application/x-desktop type again and again. Attached patch adds fast path to
KMimeType::is by allowing to ignore resolving aliases. It is not a problem in
case of KFileItem, because application/x-desktop is not an alias.
This makes KFileItem::iconName() about 4x times faster on first use.
It messes with kdecore so I would like to get second opinion on this patch.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-optimize/attachments/20090103/b5d0c47b/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kfileitem2.patch
Type: text/x-patch
Size: 4832 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20090103/b5d0c47b/attachment.patch
More information about the Kde-optimize
mailing list