[Kde-games-devel] Some new numbers on the SVG optimizer

Luciano Montanaro mikelima at gmail.com
Sat Dec 22 23:13:43 CET 2007


Hi all,
I've added another optimization-and-a-half to my SVG optimizer.
Now it can remove element ids that are not used by other elements, and it can 
remove elements from the "defs" section (like unused gradients, which 
inkscape leaves behind in abundance) which are not referenced.

The tigullio deck gets down to 603038 bytes (uncompressed). It was already 
somewhat hand optimized, so that's not bad.

I have done some new tests with the geek city theme on my deskop computer 
(athlon XP 2200 - 1 GB ram - Radeon 9250) which is slower than my laptop and 
does not have advanced power management, so the timing are longer and more 
reliable. 

Here, the loading time for the theme looks constantly better for the optimized 
version of the theme. Here are the numbers, an example from a couple of runs:
                               orig   opt
changeTheme:                    405   331
drawTheScene/Background         392   396
drawTheScene/Hero and enemies   503   483

The drawing part is quite similar in the two cases, I actually got a few ms 
more for the optimized versus unoptimized cases most of the time. But loading 
can be substantially faster. On new machines, that may be too small to be 
noticeable, however.

I'd like to know how it goes for other people too. Ian, can you test the 
optimized theme on your "performance test" PC?

I've packaged the optimized theme and put it on my site:

http://www.cirulla.net/listing/kde_stuff/kgoldrunner/kgr-greek-opt.tar.bz2

The newer optimizer is here:
http://www.cirulla.net/listing/kde_stuff/svgoptimize-0.1.tar.bz2

To keep it from stripping id that are referenced from the outside, a file must 
be provided to prime the references lookup table.

Here it is the file needed for kgoldrunner files.

http://www.cirulla.net/listing/kde_stuff/kgoldrunner/kgoldrunner.refs

It must be passed to the filter like this:

svgoptimize --refs kgodrunner.refs

Ciao,

Luciano


More information about the kde-games-devel mailing list