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

List:       kde-devel
Subject:    Re: Flickering problem in kicker (trunk)
From:       Michael Pyne <michael.pyne () kdemail ! net>
Date:       2006-10-16 0:18:27
Message-ID: 200610152018.37886.michael.pyne () kdemail ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Sunday 15 October 2006 07:40, Rafael Fernández López wrote:
> > ( * )  KIconLoader * ldr = KGlobal::iconLoader();
> >
> > >        QPixmap icon = ldr->loadIcon(info.icon(), K3Icon::Panel,
> > > K3Icon::SizeLarge);
> > >
> > >        can be done in one step:
> > >
> > >        QPixmap icon = KGlobal::iconLoader()->loadIcon( info.icon(),
> > > K3Icon::Panel, K3Icon::SizeLarge);
> >
> > this should make no practical difference in running time. putting code on
> > one
> > line does not magically make it faster ;)
>
> Well, not in time to the user, but if we can avoid innecesary assignments
> we should, that's clock time to the computer, and the machine needs that
> time for assignments (I know, is a pointer, but it is an assignment...)

Although it sounds like the issue has been resolved I just wanted to point out 
that the reason this isn't an optimization is that in this case if you don't 
write out the intermediate temporary variable, the compiler will still make 
it for you.  So there is no benefit to be had from this change, not even 
theoretically.

And if you were to use ldr more than once then it would be a net win, because 
then you wouldn't have to call KGlobal::iconLoader() unnecessarily.

Regards,
 - Michael Pyne

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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