Stewart Platt's Blog - JSPerf: Favour prototyped object over module pattern?

JSPerf: Favour prototyped object over module pattern?

Learning more about optimisations in v8...

Using the = (function() { return {}; })(); notation:

[stew@filth nora]$ node Wink.js
2308
[stew@filth nora]$ node Wink.js
2238
[stew@filth nora]$ node Wink.js
2365

And using a standard constructor function and assigning methods to the prototype:

[stew@filth nora]$ node Wink.js
2183
[stew@filth nora]$ node Wink.js
2188
[stew@filth nora]$ node Wink.js
2179

http://jsperf.com/futuretech-module-vs-proto

Comments