<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>