Re:Long live the callbacks
by simonster on Thursday August 22, 2013 @08:10PM
(#6260917)
I'm actually surprised at how low the cost of function declarations is. V8 can handle millions of function declarations per second (as you know http://jsperf.com/closure-vs-callback/8). The cost is so low that ArraySort in http://code.google.com/p/v8/source/browse/trunk/src/array.js, which implements Array.prototype.sort() in V8, declares 6 functions inside a function. Sure, you shouldn't define functions in tight loops, but otherwise this seems like unnecessary optimization.
[ Parent
| on HN ]
There are no comments on this comment yet.