Some SVG filters (lighting and turbulence filters for example) execute
a huge number of pixel manipulations, which cannot be sped up by graphics
accelerators, since their algorithm is too complex. Fortunately, a different
source can provide us raw power: Simmetric Multi Processing (SMP).
Using SMP we can split up a task to smaller (data independent) tasks, which
can be executed independently. For most SVG filters, pixels can be
calculated independently. If the operation is simple (like displacing
or copying pixels) the gain of using multiple CPUs are limited. However,
the story is totally different for lighting and turbulence filters:
they require a lot of floating point operations for each pixel!
My current approach allocates a worker thread, and split up the task
between the main and the worker thread. To utilize the CPU caches
better, the image is horizontally cut in the middle. The upper
side is processed by the main, and the bottom side is by the
The following two videos show the effect of SMP enabled filters on two,
identical multicore embedded systems (NVidia Tegra system with an ARM core). The right screen displays an unmodified WebKit-based test brower running a small SVG demo, and the effect of SMP can be seen on the left side.
The SVG source of the demo is attached to this post. To start the animation, just click on the background.