Iterators, generators, finally, and scarce resources (Was: April 10 2014 Meeting Notes)
Jason Orendorff
jason.orendorff at gmail.com
Tue Apr 29 16:07:41 PDT 2014
On Tue, Apr 29, 2014 at 2:40 AM, Andy Wingo <wingo at igalia.com> wrote:
> == Calling return() on early exit from for-of is expensive
>
> Wrapping a try/finally around each for-of is going to be really
> expensive in all engines right now. I'm skeptical about our ability to
> optimize this one away. Avoiding try/catch around for-of was one reason
> to move away from StopIteration, and it would be a pity to re-impose
> this cost on every for-of because of what is, in the end, an uncommon
> use case.
Andy, please see
<http://esdiscuss.org/topic/april-8-2014-meeting-notes#content-16>. I
don't see a big performance cost here.
-j
More information about the es-discuss
mailing list