Hi!<br><br>I've just finished the porting of two composite ops (OVER and ALPHA_DARKEN) to the Vc library. So I need your help with evaluating, reviewing and testing it ;)<br><br>Well, there were many problems with implementing it, but now it seems like most of them are gone.<br>
<br>In the attachment you can find a table showing the speed gain achieved with vector instructions on a set of test cases operating with 1024 tiles generated according to a predefined set of rules (different alignment, content of alpha channel). You can run this set of benchmarks on your own machine by executing "krita/benchmarks/KisCompositionBenchmark" benchmark. The results in attachment are produced by Core i7-2600 CPU with AVX instructions available.<br>
<u><br>A very brief summary:</u><br><br>1) In the most general case (random alpha, selection mask is present) the ALPHA_DARKEN and OVER composite ops show 1.46 and 2.45 better times correspondingly.<br>2) The unaligned source and destination can degrade this boost down to 1.27 and 1.66 times.<br>
3) In other quite common cases (one of the alpha channels is 255 or 0) the boost varies from 1.25 to 4.50 times.<br><br>4) *Some* of the tests of KisStrokeBenchmark became 10-15% faster, others didn't change.<br><br>5) Two benchmarks of KisPainterBenchmark (benchmarkFixedBitBlt and benchmarkFixedBitBltSelection) became about 15% faster. One benchmark (benchmarkDrawThickLine) became 30% slower. This happened because very small chunks of data (less than 16 pixels on machine) are now processed with FPU, without use of neither vector nor integer arithmetic. Btw, integer arithmetic cannot be used alongside with the vector calculations, because it generates artifacts due to various rounding effects.<br>
<br><br>So, it would be really cool if someone could test these changes and tell his opinion about them. <br><br><u>What should be tested:<br></u><br>1) Whether there are no regressions when painting in both "Build-Up" and "Incremental" modes using "Normal" composition.<br>
2) Whether you feel any speed gain while painting on single-layer image ;) According to my previous research, making the composition twice faster should have done the painting about 10-15% faster.<br>3) The painting on the image with multiple layers should become much more faster, because composition eats bigger portion of time there.<br>
4) Check whether painting with really small brushes (<10px) became slower or not.<br>5) It would be cool if you'd send me the output of "krita/benchmarks/KisCompositionBenchmark" benchmark and the model of your cpu. You can get the model the cpu by checking output of 'cat /proc/cpuinfo'.<br clear="all">
<br><u>How to test:</u><br><br>1) Update your repository:<br><span style="font-family:courier new,monospace">git fetch<br><br></span>2) Checkout the branch:<br><span style="font-family:courier new,monospace">git checkout origin/vector_compositioning_kazakov</span><br>
<br>3) Build Krita and have fun!<br><br><u>How to run a benchmark:</u><br><br>Go to Krita benchmarks folder and run it:<br><br><span style="font-family:courier new,monospace">cd ./krita/benchmarks/<br>./KisCompositionBenchmark</span><br>
<br>-- <br>Dmitry Kazakov<br>