Iterator benchmark

Sven Langkamp sven.langkamp at gmail.com
Thu Jun 11 17:29:17 CEST 2009


On Wed, Jun 10, 2009 at 1:56 PM, Cyrille Berger <cberger at cberger.net> wrote:

> On Monday 08 June 2009, Sven Langkamp wrote:
> > Hi,
> >
> > I have commited a first version of the iterator benchmark we dicussed
> > yesterday. It basically iterates over a paint device without doing
> memcpys.
> > The results are as we expected:
> >
> > -HLine- and VLineIterator perform quite similar.
> > -the rect iterator about 10% faster than hline
> > -the random accesor is about 40% slower than hline
> >
> > I tried callgrind on it, but for some reason it doesn't work that good
> > (maybe because of the unit test) and it's really slow. Any idea if it's
> > possible to speed it up a bit?
> >
> >
> > Sven
> I runned it with callgrind, since it takes 20 minutes, you can get the file
> here [1].
>
>
> I didn't do a full analysis yet, but there is something fishy, I think the
> random accessor should have the same performance as the line iterator (a
> little bit more slow since there is more checking in the accessor than
> iterator, and the cache doesn't help since it only caches four tiles (main
> use of the cache was/is for the sub random accessor). And I noticed
> something definitively wrong, the random accessor call twice as more
> fetchTiles as the h/v iterators do. Either there is something wrong in the
> benchmark (but couldn't see it) or a bug in the accessor. I will need to
> investigate more.
>
>
> [1] http://cyrille.diwi.org/tmp/krita/callgrind.out.10663
>

 I have attached a patch to fix that. Can you review it? The problem is that
the area of the cached tile is assumed as one pixel smaller than it actually
is which lead to a tile fetch on the last pixel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20090611/5f0a61bd/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: randomaccesor.diff
Type: text/x-patch
Size: 632 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20090611/5f0a61bd/attachment.diff 


More information about the kimageshop mailing list