[PATCH/RFC] On the iconview and the speed of directory listing.

Maks Orlovich mo002j at mail.rochester.edu
Sun May 25 21:04:10 CEST 2003


> Oh, then what about calcRect first (but on the KIconViewItem), then
> insertItem? Or does your updateItemContainer speedup mean that this isn't
> necessary anymore?

Yes, that works, and no, it still makes a difference, although not as dramatic 
- it makes slotNewItems go from 6.7 or so seconds to 3.5 or so seconds, as 
far as I can see (measurements are kind of noisy). The difficulty is in doing 
this cleanly, as we need to pass a view pointer to the calculations code 
currently in calcRect(), and in that  KIconViewItem ctors are all inline, so 
it can't do it itself.  (Unless some brave soul can come up with a way to 
safely work with the old inline versions -- hmm, perhaps checking the 
iconView() for being non-null will detect the old inline ctors being used? -- 
worth trying, I guess). 
The best I could come up with to try this out is to split out the business 
part of calcRect into a function that takes a view pointer, and making use of 
that in KFileIVI, but that's kind of dirty, since it isn't/can't be virtual 
so a further change in calcRect() in an inheritance hierarchy will make this 
method do silly things/not make sense.

I think I'll get the iconView() check a shot though, although that is kind of 
hacky, too.

-Maks



More information about the Kde-optimize mailing list