| 1) Smalltalk 80 style design Right -- you mentioned testing, but I'd like to hear more about benefits in your actual app. Putting something in a separate object just to make it more "testable", but without any actual benefit to, or effect on your app's behavior, strikes me as the essence of unnecessary abstraction. You can certainly test views that "know something" about the DOM without actually using the DOM as well... 4) View/Template Performance Ok then, IE8. It has largely the same DOM performance characteristics (ie, slow) as IE7 -- and it'll be around forever, or as long as Windows XP lasts -- whichever comes first ;) For the purposes of a web application, Rails/PHP/Python being slow matters far less than your template library being slow. They're in the backend, you can run many instances across many servers, you can cache their output, etc. If your JS templating / View library is too slow, it means you can't use it to build the most interactive and interesting parts of your UI -- precisely the parts for which using client-side views would be most helpful. I'm talking about even relatively simple things, like this: http://blog.documentcloud.org/blog/2011/10/entity-charts/ Better to benchmark now and find out, either way. |
4) I did a very dirty quick benmark. See http://pastie.org/3296683. This just inserts 1000 words into a <ul> in three different ways. With jQuery, by appending each item separately, with jQuery through string concatenation, and with Serenade. I tested this repeatedly with different numbers of words, in different orders and on different browsers.
jQuery with append is around 5x SLOWER than Serenade jQuery with an entire template is around an order of magnitude FASTER than Serenade
In other words, the difference in how jQuery is used is way bigger than the difference to using Serenade.
I then did another dirty benchmark: http://pastie.org/3296747. I've only added a primitive event binding so that clicking the <li>s pops open an alert. A really interesting thing happens. In IE (7,8,9), the difference shrinks to around a factor 5. So jQuery is 5x faster. In all other browsers I tested however, Serenade outperforms even the full string concatenation jQuery example by a slight margin.
I don't think this proves that Serenade is fast, but it's at least not deficiently slow.