Also, as they say they just got this working. It seems reasonable to assume that with enough programming mojo, the slowdown could be something closer to 10X or even 5X.
Now there is a way to allow users to actually supply you with html markup and not have to do anything special filtering-wise on your backend.
Would love to be enlightened though. It does sound interesting.
If they just do it for the hack value, that's totally fine for me.
However if you really want speed I wonder if you could bridge access to certain useful functions by delegating access to, for example, sandboxedAnimate = function (sel, attr, duration, easing) {} in a closure. If you want to allow plugins on your site for example, 200X for basic stuff and full speed for jquery animations, etc would be more than enough 99.9% of the time.
Also if you use CSS animations where there would be zero slowdown. So make that plenty fast 99.99% of the time.
1. The js.js API is currently very low-level, which makes it verbose and difficult to use. There's a lot of room for improvement.
2. The twitter script was actually chosen because it's complex. It has a ton of boilerplate code that you'd probably be surprised is in there.
3. A lot of the code written could be generalized into a generic virtual DOM interface library that is not specific to this twitter script. Things like screen.width and screen.height are common properties that would be accessed by many different scripts and so could be generalized.
var env = {local1: function (){}, local2: "blah"};
js = new JSJS(env);
js.eval("console.log('I am evil!'); local1();");