One more idea... taken from reduce

Instead of doing the in check we [[Get]] the value and only if the value is
undefined do we need to do an [[HasProperty]] check.

ForEach: 184870
ForEach2: 367066
ForEach3: 452772
ForEachWithHoles: 123503
ForEach2WithHoles: 114547
ForEach3WithHoles: 110123

This is 3x faster!

The downside to both of these ideas is that with proxies it is detectable that
the order no longer matches the spec.

Maybe these hacks are not worth it and we should just make [[HasProperty]]
fast... not that at will ever be as fast as ForEach3 since we always need to do
the [[Get]] no matter what.

https://codereview.chromium.org/22545007/

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

Reply via email to