[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-optimize
Subject:    Re: comments on KDE performance tips
From:       Maks Orlovich <mo002j () mail ! rochester ! edu>
Date:       2003-01-18 1:27:55
[Download RAW message or body]

>
> c. Use QString as it first compares the location of the string before
> doing the actual char by char comparison.

It _does_ use QString (actually two QString's and some ints in a structure; 
but this is all academic, since KConfig exposes so much of its internal 
storage that changing it isn't possible before KDE4; at least I don't see a 
way). And this doesn't help you for doing less-than equals comparisons, which 
is what is needed for tree insertions and lookups.

<snip stuff I really can't comment on>

> 	* found a little optimization opportunity in QString.
>
> 	bool operator!=( const char *s1, const QString &s2 )
> 	{ return !(s1==s2); }
>
> 	Should return !(s2==s1) instead since (s1==s2) will match
> 	 ==(const char *, const QString &) in its turn.


Yeah, I think so, good catch.

> 	A compiler with automatic inlining will help...


gcc-3.x inlines quite a bit by default with -O2.


_______________________________________________
Kde-optimize mailing list
Kde-optimize@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-optimize
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic