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

List:       kde-core-devel
Subject:    Re: faster kconfig
From:       aleXXX <alexander.neundorf () rz ! tu-ilmenau ! de>
Date:       2001-02-27 18:05:32
[Download RAW message or body]

On Tuesday 27 February 2001 12:17, Harri Porten wrote:
> aleXXX wrote:
> > Hi,
> >
> > I tried the following in kconfigdata.h but it didn't work correctly,
> > suddenly no icons where loaded anymore, I don't know why. I recompiled
> > only libkdecore. The two added lines would save again some thousands
> > qstrcmps() on startup for the most simply KDE 2 app and keep a unambigous
> > order for the used QMap. Maybe it would have been enough to recompile
> > some other stuff too, I don't know.
> >
> > inline bool operator <(const KEntryKey &k1, const KEntryKey &k2)
> > {
> > +   if (k1.mGroup.size()!=k2.mGroup.size())
> > +      return (k1.mGroup.size()<k2.mGroup.size());
> >
> >    register int result=qstrcmp(k1.mGroup.data(),k2.mGroup.data());
>
> It might save you strcmp() calls but have you measured how much the
> resulting code is actually faster ? After all the QCString::size() calls
> will have to iterate through every character as well. A regular strcmp()
> implementation should abort on the first mismatched character, shouldn't
> it ?
>
> Harri.

I think I had a look at the code and size() simply returns an int, without 
iterating.

Btw. you have a new email address ? :-)

Bye
Alex

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

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