4 ms·
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 i
by just2n 13y ago
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/backbone.js#L1530 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:
this.Class = function(){};
Whereas `Backbone.Model` looks like this: https://github.com/documentcloud/backbone/blob/master/backbone.js#L246 https://github.com/documentcloud/backbone/blob/master/backbo...
It's not hard to predict the outcome of this "benchmark."