Inkscape, the free vector graphics editor for Linux, Windows and Mac, has always been know as somewhat slow when it comes to complex drawings with lots of objects and/or SVG filters.

Luckily quite dramatic changes are finally coming to address this particular issue.

Cairo, OpenMP and SVG filters

A Google Summer of Code 2010 project by Krzysztof Kosiński is part of the main development branch now, with two major changes: porting of rendering to Cairo and threaded rendering of SVG filters using OpenMP.

Cairo is an increasingly popular library for rendering 2D vector graphics. Porting Inkscape's rendering to Cairo results in up to 2x rendering speed boost for shapes with flat and gradient fills. Additionally some rendering bugs and limitations have been fixed. For instance, there is now no limit for rendering gradients at large zoom level, even though gradient related fixes demand Cairo 1.11.2 and newer.

For threaded rendering of SVG Filters Krzysztof used a rather popular OpenMP technology. If you have a computer with a multicore CPU, you will definitely notice a rendering boost. Rendering of all supported SVG filter primitives is threaded.

Again, this part of changes is already available in main development branch, and Ubuntu 11.04 and 11.10 alpha users can use PPA with nightly builds, with Windows and Mac builds expected shortly. However the good news don't end here.

Caching

This year Krzysztof works on another GSoC project that is also related to Inkscape's performance. The code is already available in a new gsoc-caching branch. What's special about it?

The big change is that now actual SVG documents are rendered separately from things like selection cue, mouse pointer etc. That means working on complex illustration is really faster, path highlighting is much faster, drawing selection cue above embedded bitmap is faster as well, and so on and so forth. And if you disable automatic update of paths rendering for the Node tool, editing pahs with SVG filters applied will be considerably faster as well.

While working on that Krzysztof had to work around some weird things in Cairo regarding rendering of clipping path. This coincidentally led to improvements in nested clips rendering. Oh, and you can also use text objects as clipping paths now.

If you are brave enough to compile source code, you can fetch the new branch using this very command:

$ bzr branch lp:~tweenk/inkscape/gsoc-caching

No builds for testing are ready yet, but fear not: merging the second project to main development branch is likely to happen around August/September. Both GSoC projects are destined to be part of 0.49 release. While not scheduled yet, it's expected around winter 2011/2012.

Update: the day after publishing this article Krzysztof merged his changes from gsoc-caching branch into trunk (main development branch). Expect the awesomeness in the next PPA build or compile trunk from source code.