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

List:       kde-kimageshop
Subject:    Re: [patch] on the performance of KisCircleMaskGenerator::valueAt
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2010-12-24 13:40:18
Message-ID: AANLkTimL=MkvYc3yxXwcZU52otngemXrh2a2FMAwBsgw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Fri, Dec 24, 2010 at 7:00 AM, Geoffry Song <goffrie@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

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">On Fri, Dec 24, 2010 at 7:00 AM, Geoffry Song <span \
dir="ltr">&lt;<a href="mailto:goffrie@gmail.com">goffrie@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I noticed that \
KisCircleMaskGenerator::valueAt(), which can easily be<br> called millions of times \
in a single stroke, has some rather<br> inefficient code (in particular, an \
unnecessary sqrt()), so I took the<br> liberty of optimizing the code a bit. This \
patch should somewhat<br> improve the performance of large brushes, especially the \
sketch brush<br> with a large diameter. No, it is not a large difference.<br>
<br>
On my machine, the old code took about 26 nanoseconds per call, and<br>
the new code takes 15 nanoseconds per call.<br>
<br>
(Raw data: old code, time per call: 2.6188e-08, 2.6148e-08, 2.612e-08,<br>
2.6688e-08, 2.668e-08, 2.6868e-08. New code: 1.4952e-08, 1.5532e-08,<br>
1.4972e-08, 1.4964e-08, 1.4892e-08, 1.4868e-08, 1.4876e-08,<br>
1.5144e-08, 1.4872e-08, 1.4872e-08, 1.4876e-08. Each sample is an<br>
average over 2.5 billion calls)<br>
</blockquote></div><br>Hi!<br>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).<br> \
<br>Your numbers from callgrind (i guess) look cool! It would be interesting to see \
the results of that benchmark ;)<br><br>-- <br>Dmitry Kazakov<br>



_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


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

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