comments on KDE performance tips

Maksim Orlovich kde-optimize@mail.kde.org
Fri, 17 Jan 2003 12:00:54 -0500 (EST)


> Do you still remember pre KDE 2.0 times ?
> At this time there was a *slow* data structure used (was it a simple list ?), 
> and changing it to a tree improved the performance dramatically.
> 
> But of course string comparisons aren't the fastest thing in the world. But 
> I'm afraid there is no way around it.

Sure there is, more than one.

a. Use a hashtable - they do a single comparison, or a constant number of
comparisons, not a logarithmic one, and no re-balancing (which takes
time). 

b. Use hashes of key strings within the red-black tree context for
first-try comparisons, only resorting to string comparisons in case of  a
tie (doesn't kjs use a technique like that?)