Filip Pizlo (2015-02-16T18:57:38.000Z)
d at domenic.me (2015-02-21T00:40:28.376Z)
On Feb 16, 2015, at 3:30 AM, Yusuke SUZUKI <utatane.tea at gmail.com> wrote: > It's very timely to me. > > I'm now upgrading JavaScriptCore's iterator interface to allign to the latest ES6 spec[1]. > However, since it allocates JS objects, it would cause performance degradation. JavaScriptCore has a pretty good object escape analysis and will not allocate short-lived objects in hot code (see here for the phase that eliminates allocations: http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp <http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp>). If you find that your changes cause object allocation even after the optimizing JIT kicks in, then please file a bug to that effect. > > Currently, I'm planning to add a loophole to improve perofrmance of iterating builtin JS objects. > But if possible, I think it is preferable to change the spec to improve performance of iteration for user provided iterators. I'm skeptical that spec changes will be necessary.