KisIterator, quantum and pixels

Roger Larsson roger.larsson at norran.net
Mon Jul 5 15:35:42 CEST 2004


On Monday 05 July 2004 14.51, Boudewijn Rempt wrote:
> On Monday 05 July 2004 14:38, Boudewijn Rempt wrote:
> > On Monday 05 July 2004 14:13, Casper Boemann wrote:
> > > image requires efficient access,with small loops that remains in cache.
> > > Calling a function for every pixel is simply to much overhead. Sad but
> > > true. This is why we need iterators.
> >
> > Mwah. I'm not convinced... (Don't take that too serious -- it's just that
> > I really, really hate premature optimization, especially if it means
> > complicating an interface. But I guess I'll just have to get rid of my
> > Java prejudices.)
>
> Oh, what I don't understand is this -- isn't every iteration of an iterator
> a function call, too?
>

Yes, in both cases you can make sure that all functions needed are inline.
Then the compiler can do all sorts of optimizations - like moving constant
stuff out of the loop.

/RogerL

-- 
Roger Larsson
Skellefteå
Sweden


More information about the kimageshop mailing list