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

List:       koffice-devel
Subject:    Re: Page variable support for kopageapp
From:       Cyrille Berger <cberger () cberger ! net>
Date:       2009-09-18 7:56:04
Message-ID: 200909180956.04296.cberger () cberger ! net
[Download RAW message or body]

On Thursday 17 September 2009, C. Boemann wrote:
> On Thursday 17 September 2009 11:50:11 Thomas Zander wrote:
> > ever going to be written to pay a penalty just because you don't want to
> > add some cheap loops to kpresenter? Honestly...
> 
> Normally I would offhand have agreed with you, but in krita we noticed that
> it doesn't matter all that much. Initially I coded our iterators (for each
> pixel) with non-virtual methods, because I had the exact same concerns
> you voice here. But Cyrille (or was it Boudewijn) tested it with virtual
> methods instead, and, - surprise - it didn't show a significant difference.
>  So if it is ok for every pixel in an image i don't think a simple call to
>  update will be a problem.

This need a clarification, if you are calling twice (or 100000 times) the same 
virtual function for the same object, then you pay the price of the lookup 
only once, then for the second (or 99999th) call, you only pay a jump to a 
function, in other hand you pay the price once. But if you are calling the 
same virtual function on two (or 100000) different objects, then you pay the 
price each time.

Our iterators are a mix of virtual and inline, so we pay the lookup only once.

(since I didn't follow much of what was discussed elsewhere on the thread, I 
have no idea in which situation we are right now)
-- 
Cyrille Berger
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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