Some V8 people here ? how can a JS re-implementation be faster than the native implementation of a function ?
> Some V8 people here ? how can a JS re-implementation be faster than the native implementation of a function ? They say some in their readme. Because the native versions have some extra baggage (sparse array checks, etc). But to answer in general: 1) JS functions also get compiled to native code for often used code paths. That's what the JIT does after all. 2) A JS function might use a better algorithm compared to a…
https://code.google.com/p/v8/source/browse/trunk/src/array.j...