(This and the following messages describe new stuff in CVS and thus in 0.44, not 0.43)
Recently I committed a few rendering speedup patches that I've been testing for a few weeks. It's still far from Xara speed, but the difference is noticeable.
1. As you probably noticed, screen redraw is done in chunks (typically horizontal strips). The maximum size of the chunk was 64K, which is pretty small. (Lauris had a strange idea that Sodipodi must run fine on a system with 32Mb RAM.) On the other hand, rendering each chunk causes a complete stroking and uncrossing of the paths touched by the chunk, which is especially expensive for paths with strokes, and even more so for dash patterns. This means the monstrous livarot functions were called a lot more often than necessary.
I increased the chunk size to 256K, and that helped a lot. In some critical situations (complex stroked/dashed paths at high zooms) it's now up to 3 times faster; typically at least 10% faster. Node editing is also noticeably snappier because it involves a lot of path rendering. I then tried 1M chunks, but even though this made stroke/path rendering still faster, for some reason it slowed down rendering of files with lots of semitransparent gradients. So in the end, I settled on 256K. The gradient slowness with large chunks needs further investigation.
2. When rendering transparent overlays, Inkscape spends a lot of time calculating NR_PREMUL(c,a) defined as (((c) * (a) + 127)/255). I changed the division to
FAST_DIVIDE_BY_255(v) ((((v)<< 8) + (v) + 257) >> 16)
borrowed from Mozilla and got about 10% speedup on complex documents with transparency.
3. An error in sp-canvas.cpp caused a complete extra screen redraw after each zoom operation. That is, after you press "+" in a complex drawing, Inkscape redraws, but for some time after that it remains still unresponsive because it does that second redraw (invisibly for you, i.e. nothing changes on the screen). I fixed that, and now zooming is much more pleasant in complex docs.
4. It turned out pretty easy to code an Outline ("wireframe") display mode. In it:
- all paths and shapes are shown as inverse (black on light background and vice versa) outlines of constant width (i.e. 1 screen pixel regardless of zoom), without fill;
- text is painted by inverse fill color without stroke;
- bitmaps are shown as is;
- any opacity and gradients are ignored.
Since Inkscape's display of path strokes is the slowest part of its renderer, the outline mode is usually not drastically faster than regular mode (usually 10% to 50% faster), and in some cases it may even be slower. However, the value of the outline mode is not only in its speed; it is a good way to get an idea of the structure and objects of your document, and it is convenient for precision node editing and for finding "stray objects". The switch from normal to outline view and back (View > Display mode) works on the fly. (As for a non-AA mode, I have no idea how to do it, and anyway I doubt that it will give a noticeable speedup at all.)
I'm also really looking forward to Xara opening its code. I do plan to attempt to borrow their renderer, or parts thereof, into Inkscape, now that I know that ins and outs (but not the guts) of our own renderer fairly well, but I cannot promise anything - this may turn out prohibitively difficult. We'll see.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org