Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was also bothered by the fact that the two were instantiating very different objects, so I forked the tests and added a new case that uses Backbone's portable extend method to create vanilla objects: http://jsperf.com/backbone-vs-john-resig-class/5

TL;DR: the Backbone approach has similar performance characteristics compared to Resig's when instantiating similar objects. In some browsers (Firefox Nightly, Safari), Backbone's approach is significantly faster. It's also compatible with strict mode — although Backbone itself doesn't use strict mode — whereas Resig's uses arguments.callee which will throw errors.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: