[Twisted-web] canvas without flash and optimization patches

Stefano Debenedetti ste at demaledetti.net
Mon Feb 21 08:17:48 MST 2005


I did some further tests on Canvas, the compilation errors I got with KineticFusion were definitely trivial (only two missing semicolons) so I prepared a little patch that corrects those and adds the RVML file, which includes a comment with instructions for downloading KineticFusion and building the Canvas SWF with it.

I also turned compression on for a further size improvement, now the generated SWF is less than 2KB.

Perhaps more importantly, I found out why the Canvas demo is crashing Mozilla/Firefox on linux: it is too fast (i.e. the linux Flash player is too crappy)! Indeed it is not crashing, if you stop the server the browser resurrects, so I guess it is more appropriate to call it a choke.

The demo uses twisted.internet.task to send commands to the client approximatively every 0.25 seconds, raising that value to 0.3 is enough to avoid the choke, at least on my system.

So I tried optimizing the canvas.as file and I found out that by changing the Canvas protocol in order to use plain old crappy TSV instead of XML gives it a performance boost that allows me to push the above mentioned refresh rate of the demo to 0.21, i.e. even better than the 0.25 that was unreachable before.

Of course this has other drawbacks, for example you have take care of potential conflicts between the separator token you choose and the string data you want to send to the client, you lose ease of extensibility of the hierarchical structure and so on but it's worth giving it a try when the goal is absolute performance.

The first patch I attach is just the semicolons fixes + the RVML file, the second one is the same plus the optimizations, sorry about the data duplication but I couldn't figure out a quick way to do incremental patches with SVN without committing first.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: nevow-canvas-rvml.diff
Type: text/x-patch
Size: 2148 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050221/f152701c/nevow-canvas-rvml.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nevow-canvas-rvml-plus-optimization.diff
Type: text/x-patch
Size: 3781 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20050221/f152701c/nevow-canvas-rvml-plus-optimization.bin

More information about the Twisted-web mailing list