[PATCH] Speed up iconView's setIcons 2x...

Carsten Pfeiffer carpdjih at sp.zrz.tu-berlin.de
Tue Aug 13 23:23:39 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----

On Tuesday 13 August 2002 23:51, Maks Orlovich wrote:

> This is in fact mostly spent KonqKfmIconView::slotNewItems( const
> KFileItemList& entries ) and suggests that my original patch is probably
> not the best way of addressing it.. What happens here is that the directory
> lister cache recognizes the familiar directory, and dumps all of the files
> in it immediately to the icon view; so the view spends its time processing
> all the items; and then updating the icons for them before returning to the
> event loop.. I am thus not sure of what the proper way of fixing this is --
> anyone else?

What you could do is remove m_itemDict and use KFileItem::setExtraData() (I 
wanted to do this long ago). With a large directory, the 43 buckets 
dictionary looks a bit helpless. 

Then, if you would use item->name( true ) instead of item->text().lower(), you 
would save all those QString creations and lowerings. Maybe we should have 
used text( bool lowercase ) in KFileItem instead of name( bool lowercase).

You could also remove the KFileItem *fileItem = item->item() call by assigning 
fileItem right in the for-loop.

You could assign the m_pIconView->iconSize() call to a variable instead of 
calling it again and again, but maybe the compiler optimizes that away 
already.

Ouch, and you could change the QPixmap variables in struct KFileIVI::Private 
to pointers, allocating them with new on demand (every QPixmap constructor 
calls XCreatePixmap() IIRC. Those overlays and thumbnails shouldn't create 
that much overhead when they're not used at all.

Cheers
Carsten Pfeiffer
-----BEGIN PGP SIGNATURE-----

iQEVAwUBPVmG7aWgYMJuwmZtAQHyRQf+PemhryY6Y53AbwQPRRiPQe5lVrVBSKN3
K219aAAapct/6w1UlybNwSWZB8sLMNlsta9bygXlE1vvnD8MIvjWswi5a//NrHWq
SqDMSBQ7/tWoZcvQHIHFOsrfLARriODm9U9M2aWbRD47gO7Hugot0AqhoOvc1XMq
ErFeGoaLznth3zqS2oImBANMFEIy7nie4Mi7lQUOWL3uCG0ImGqIC81ninpSsUjY
wRyL8/wBxqiCWQeYPwEBZuKaiJzzWduB4TlwuU0fkI+taFFkNr0xw9xg8kPtnjJW
CHWBj8TzNme/IZ/7kt6bW0Vqp8uXpDQNjA4T0EWABff7A8O0WI5fcw==
=S0kB
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list