I found an interesting thing in V8 engine when I was testing underscore.js 
library.

For arrays, the 

> for (var i = 0; i < len; i++)

implementation can ran 24700 ops(operations per second), while the native 
function 

> Array.prototype.forEach

 only got 14200 ops.

Then I tried IE10, in which the `nativeForEach` can reach a number of 43500.

I checked the source code of V8 engine, but could not find out why this 
native forEach function is so slow.
Can anybody explain this? Thank you.

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to