[patch] on the performance of KisCircleMaskGenerator::valueAt

Dmitry Kazakov dimula73 at gmail.com
Fri Dec 24 14:40:18 CET 2010


On Fri, Dec 24, 2010 at 7:00 AM, Geoffry Song <goffrie at gmail.com> wrote:

> I noticed that KisCircleMaskGenerator::valueAt(), which can easily be
> called millions of times in a single stroke, has some rather
> inefficient code (in particular, an unnecessary sqrt()), so I took the
> liberty of optimizing the code a bit. This patch should somewhat
> improve the performance of large brushes, especially the sketch brush
> with a large diameter. No, it is not a large difference.
>
> On my machine, the old code took about 26 nanoseconds per call, and
> the new code takes 15 nanoseconds per call.
>
> (Raw data: old code, time per call: 2.6188e-08, 2.6148e-08, 2.612e-08,
> 2.6688e-08, 2.668e-08, 2.6868e-08. New code: 1.4952e-08, 1.5532e-08,
> 1.4972e-08, 1.4964e-08, 1.4892e-08, 1.4868e-08, 1.4876e-08,
> 1.5144e-08, 1.4872e-08, 1.4872e-08, 1.4876e-08. Each sample is an
> average over 2.5 billion calls)
>

Hi!
Cool patch! We have special benchmarks for strokes in Krita. They are placed
in ./krita/benchmarks/ folder. The one that tests strokes is called
KisStrokeBenchmark (you need to have BUILD_TESTS set to on in cmake).

Your numbers from callgrind (i guess) look cool! It would be interesting to
see the results of that benchmark ;)

-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20101224/c31f1fed/attachment.htm 


More information about the kimageshop mailing list