In the long run we should find a way to optimize away objects that are
directly
used with destructuring.
We've also done experiments with self hosted Map and Set which looked like
it
would have had large payoff, especially for forEach but our results have
been
pretty disappointing.
https://codereview.chromium.org/329253004/diff/90001/src/collection.js
File src/collection.js (right):
https://codereview.chromium.org/329253004/diff/90001/src/collection.js#newcode87
src/collection.js:87: %SetIteratorMoveNext(iterator);
On 2014/06/23 19:51:52, Michael Starzinger wrote:
I am _very_ surprised that this is faster. How are three runtime calls
faster
than one? Don't get me wrong, I trust your measurements, but is this a
good
optimization in the long run?
The cost of 1 call vs 3 calls is not so large. Since we have 1 this code
does not get optimized so we are already paying the overhead of runtime
calls, this just makes that overhead 3x larger (same order of
magnitude).
The main reason why this is faster is that creating the iterator result
object and then extracting the data is a lot of overhead. For
Map.prototype.forEach we also had to create temporary array and extract
that data from that too.
https://codereview.chromium.org/329253004/
--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.