Re:Backbone vs. Simple JavaScript Inheritance
by just2n on Saturday June 01, 2013 @06:32PM
(#5806324)
Yes. This is precisely the problem. The inheritance model used by Backbone will be significantly more performant in terms of method calls, in general, because it doesn't implement a `super` concept. The construction should also favor Backbone's model since it doesn't create the function wrappers (in the non-trivial case, anyway).
Look at what Backbone's `extend` does: https://github.com/documentcloud/backbone/blob/master/backbo...
The subclass's constructor calls the parent's constructor function, just as in Resig's, however Resig's `Class` is:
Whereas `Backbone.Model` looks like this: https://github.com/documentcloud/backbone/blob/master/backbo...It's not hard to predict the outcome of this "benchmark."