Links

What are JavaScript and SVG good for? - Built-in Flash engine?

There is a very interesting open source project: a Flash runtime engine written in JavaScript, called Gordon, written by Tobias Schneider. Although the project is still under development, you can get the first impressions how strong the JavaScript and SVG technologies are nowadays.

The main advantage of Gordon is that it uses the JavaScript and SVG engines of the browser. The state-of-the-art browsers (like WebKit-based ones) do not require third party drivers to execute JavaScripts or to draw SVG graphics. In contrast to the Flash runtime engine which is a third party driver (in most cases). Nowadays the JavaScript and SVG combo is getting more and more faster (for example: see our benchmark site for the performance of WebKit's JavaScript engine). So the overhead of running JavaScript-based SVG painting, compared to, Flash is getting less and less.

Lets see an example how it looks in practice!

fps

This Flash animation is painted by Gordon. It looks nice, doesn't it? ;) The original Flash animation can be seen here and you can get more examples at Gordon project page (or its mirror).

Lets make a FPS contest!

You can see the average FPS value at bottom of the animation. Please wait for a second (or two) and write the average FPS number in the comments area with some information about your machine and browser. For example, see my result table:

After running for a couple of minutes, to even out the averages:
11 fps in NetNewWire on an iPhone 3GS running OS 3.1.3.
12 fps in Safari on an iPhone 3GS running 3.1.3 (3-25 fps)
13 fps in Safari on an iPad running OS 3.2 (3-24 fps)

Safari 4.0.5 OS X v10.5.8 on a mid-2005 PPC G4 1.3Ghz with 768Mb RAM (typically poor to mediocre at Adobe Flash) started at 18fps then slowly dropped to 13fps after extended execution (~5min or so). Activity Monitor showed %User CPU variation between 9% and 83% (where highest usage appears correlated with the many stars coalescing into the letters). That's pretty decent performance on an old machine like that.