Optimizing spray&memory swapping

Boudewijn Rempt boud at valdyas.org
Thu Apr 22 20:01:21 CEST 2010


On Thursday 22 April 2010, LukasT.dev at gmail.com wrote:
> Hello,
> 
> I did some profiling of the spray and I run into some strange issues.
> Basically it is about fillPainterPath method in KisPainter.
> 
> In spray it is used heavily when painting circles, ellipses, rectangles.
> It might be a nice idea to try to use mask generators instead because now
> they support also rotation and when I wrote spray, rotation was not there
> so I used my own code to write polygons and fill them with
> fillPainterPath.
> 
> >From the profiling data [1] I noticed that there is KisPaintDevice
> 
> created&destroyed per sprayed particle and that is slow. I produced patch
> [2] that reuse KisPaintDevice with clear() but then I run the
> benchmarkRandomLines and all my ram memory was filled with data, the
> computer stopped to respond for two minutes because of swapping.

For this purpose, KisFixedPaintDevice might be better, I think. But I also 
think that using the mask generators instead of fillpainterpath will be much 
more efficient.


-- 
Boudewijn Rempt | http://www.valdyas.org


More information about the kimageshop mailing list