Vc branch ready for testing

Sven Langkamp sven.langkamp at gmail.com
Mon Sep 10 02:22:32 UTC 2012


On Thu, Sep 6, 2012 at 5:16 AM, Sven Langkamp <sven.langkamp at gmail.com>wrote:

> Hi,
>
>
> I have pushed the krita-vc-langkamp branch. It does implement the brush
> mask computation with vc.
> To build the branch you need a cpu with SSE2 and Vc 0.61 or git:
> http://code.compeng.uni-frankfurt.de/projects/vc
> AVX should work too, but requires a change in the Krita cmake file.
>
> With the branch there is around 15x speedup in the mask benchmark and
> about 2-3x speedup in the stroke benchmark (for brushes without random and
> density).
> No idea how much performance improvement that gives during real painting,
> so that needs testing.
>

Small status update:

Branch has been tested on half a dozen systems now. Results were from twice
as fast to very slight improvement/no change noticeable. Not sure why there
is such a difference between systems. Dual-core systems seem to have a
bigger improvement. Might be that it was mask processing was already quite
fast on quad-core cpus before.

Branch is almost feature complete, just some improvements for detecting
cmake files needed. Also will need some ifdefs if vc should stay an
optional dependency.

I did some further profiling with callgrind on some 1000px 0.04 spacing.
Callgrind file can be found here: http://depot.tu-dortmund.de/get/ybukq

It shows that the composite op is now the most expensive operation in the
KisStrokeBenchmark. Which is probably also the reason that we don't see
bigger improvements from the mask processing. Pentalis wants to look at the
composite ops and see what can be done there. I'm considering to
parallelize the fixedBlt with QtConcurrent like we already have for the
brush mask.

Beside that callgrind shows some other smaller bottlenecks. One is
QVector::fill which is used by the initialize of the fixed paintdevice.
Might be possible to save that by using uninitialized values and just
resize.

Another smaller bottleneck appears to be the memcpy, we do to set the color
of the dab. When we use a plain color that never changes, it might be
possible to avoid that as we only change the alpha values.

Unfortunately the benchmarks don't show the other operation done while
painting in Krita. So I can't say how much effect e.g. update of the
projection/canvas has.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20120910/baac03b6/attachment.html>


More information about the kimageshop mailing list