canvas without flash and optimization patches
Hello, 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. ciao ste
On Mon, 21 Feb 2005 16:17:48 +0100 Stefano Debenedetti wrote:
Hello,
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.
ciao ste
Wouldn't it be possible to use something like JSON [1] instead of XML? Like that you may have the best of both worlds. Structured data and a lighter format than xml. JS and Python work very nicely with it. [1] http://www.json.org cheers Steven -- All I know is that I know nothing -- Socrates
On Feb 21, 2005, at 7:17 AM, Stefano Debenedetti wrote:
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.
This is very amusing. It boggles my mind, really. The reason I used XML for the Canvas RPC mechanism rather than plain text was because in theory an XML parser written in C should exhibit better performance than a text parser written in pure actionscript. In fact, all the other work I had ever done with Flash used a plain old text format, and switching to XML was supposed to be an optimization. With a plain text format, there is the additional difficulty of supporting nested structures (which is simple in XML). Some of the encodings include dicts and lists. Anyway, this is very cool. Thank you. dp
participants (3)
-
Donovan Preston
-
Stefano Debenedetti
-
Steven Armstrong