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

List:       kde-commits
Subject:    Re: KDE/kdelibs/kdeui/icons
From:       Thiago Macieira <thiago () kde ! org>
Date:       2007-09-18 19:54:33
Message-ID: 200709182154.34302.thiago () kde ! org
[Download RAW message or body]


André Wöbbeking wrote:
>> Constructing a KIcon must surely be one of the more often-used parts
>> in program startup. The funnier that this is prematurely pessimized
>> by passing around and assinging a QStringList that's unused in 99.99%
>> of cases. Shy away from default arguments. Esp. if you go ahead and
>> switch on them in the function body! This is BC+SC
>
>Do you've some numbers how expensive the creation or passing of a
>QStringList is?

One atomic increment, or about 200-300 CPU cycles.

While I agree that the extra QStringList argument could be optimised away, 
the 0-pointer makes no difference in sensible performance... Adding the 
overload means there are two more functions in the binary (each 
constructor is two functions).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

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

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