News for hackers. Stuff that matters.
Re:Paper.js — The Swiss Army Knife of Vector Graphics Scripting by notJim on Tuesday June 28, 2011 @02:19AM (#2704280)
That approach you describe to building an SVG tree is a common performance optimization when manipulating the DOM for HTML as well. I'd be curious to hear if you've tried a) using a DocumentFragment, b) detaching the node using removeNode, manipulating, then adding it back, and c) simply working with a node (createNode) and then adding it in after manipulations are done. The basic idea is that working with the live DOM is slow, while working with detached nodes is fast. Note that I haven't really tried this stuff out that much. Maybe I'll work up a little benchmark over the weekend or something.

I'm pretty sure Paul Irish's talk [1, 2] is where I read about this.

[1]: http://www.slideshare.net/paul.irish/perfcompression

[2]: http://vimeo.com/10295601

Re:Paper.js — The Swiss Army Knife of Vector Graphics Scripting by gruseom on Tuesday June 28, 2011 @03:18AM (#2704401)
Yes, using innerHTML to bypass the HTML DOM is the poster child for this kind of thing.

We've tried all the alternative techniques you mention (with HTML DOMs, that is - I don't think any of them work with SVG) and had disappointing results.