Brainstorming/Performance

What areas of MyPaint performance has room for improvement? And how can we improve it?

Drawing performance
Critical:
 * Putting the dab on the surface
 * Picking color from the surface for smudging
 * This is done once for each dab at the moment, if the brush uses smudging. Probably this could be done less without notable quality loss.

Not critical:
 * Rendering the dab to the screen and compositing layers
 * This is done as often as time allows, making MyPaint use 100% CPU unless it manages to do a rendering for every single dab, which would result in an insane framerate for most brushes.


 * Canvas zoom / rotation
 * While painting it is only done once per rendering step.


 * Brush dynamics
 * Brush dynamics are roughly calculated once per dab. For brushes with many very small dabs this could become time-critical in theory, however in practice it is fast enough for brushes with small dabs anyway.


 * Strokemap compression
 * This shows up in a profile, however it is done chunk by chunk during natural painting breaks so the user doesn't notice.

Speed and Interaction Improvements
In the features section it was mentioned that for interactive rotation the algorithm you use can't keep up, any reason not to use a proxy image for the rotation which is roated in realtime, and then rotate the real image after application? For speed improvement on large images - have two versions of the image, a temp/low resolution, and the high resolution - update the low resolution immediately during the drawing giving visual feedback, and the in the background update tiles of the high res image, and copy the high res image update to canvas as they finish getting calculated. (Tom Musgrove)

Also have you looked at openimageio and/or GEGL - both support tiling of images. (Tom Musgrove)

Startup time
We currently (Jan 2010) rely on almost every part of the application to be initialized before the user is a allowed to start using it. If we can initialize non-primary windows (settings, layers, brush*) on demand instead of on startup, that would probably help a bit. Similarly if we only instantiate one brush object (current/default brush) instead of one for each and every brush.

OpenRaster save performance
Often the user will done have minor incremental changes between two saves. So only saving what has changed would probably be a huge improvement for typical use-cases. This could be implemented on several "levels", but one simple action would be to only save the layers that have been modified.

Memory usage
Memory usage is seemingly quite high. Is there anything we can do to make it be lower?

On IRC using compression for the tiles came up. While this is a possibility it will introduce higher CPU usage and is quite complex. So we should pick lower hanging fruit (if any) before considering that.