Re: is an iterator allowed to reuse the same state object?

2015-05-01 Thread Jason Orendorff
On Wed, Apr 29, 2015 at 5:41 PM, Andreas Rossberg rossb...@google.com wrote: I'm inferring your comment about generator optimization hardship has to do with a function that yields -- whose CFG has multiple entry points and whose activation record must live in the heap. Yes, the biggest

Re: is an iterator allowed to reuse the same state object?

2015-04-29 Thread Andreas Rossberg
On 29 April 2015 at 02:21, John Lenz concavel...@gmail.com wrote: I missed it, thanks.I know things will improve in time but I'm just coming from a discussion with folks complaining about the performance of generators and GC overhead in real code with Chrome and Firefox relative to simple

Re: is an iterator allowed to reuse the same state object?

2015-04-29 Thread Brendan Eich
Andreas Rossberg wrote: On 29 April 2015 at 02:21, John Lenz concavel...@gmail.com mailto:concavel...@gmail.com wrote: I missed it, thanks.I know things will improve in time but I'm just coming from a discussion with folks complaining about the performance of generators and GC

Re: is an iterator allowed to reuse the same state object?

2015-04-29 Thread Andreas Rossberg
On 29 April 2015 at 18:37, Brendan Eich bren...@mozilla.org wrote: Andreas Rossberg wrote: On 29 April 2015 at 02:21, John Lenz concavel...@gmail.com mailto: concavel...@gmail.com wrote: I missed it, thanks.I know things will improve in time but I'm just coming from a

Re: is an iterator allowed to reuse the same state object?

2015-04-28 Thread Allen Wirfs-Brock
On Apr 28, 2015, at 4:21 PM, John Lenz wrote: You would hope that the engines might be able to create these objects on the stack but I don't think anyone does that yet and the result is a flood of eden objects. I would like to know I'm wrong about this. did you see

Re: is an iterator allowed to reuse the same state object?

2015-04-28 Thread John Lenz
I missed it, thanks.I know things will improve in time but I'm just coming from a discussion with folks complaining about the performance of generators and GC overhead in real code with Chrome and Firefox relative to simple hand written loops. On Tue, Apr 28, 2015 at 4:28 PM, Allen

Re: is an iterator allowed to reuse the same state object?

2015-04-28 Thread John Lenz
You would hope that the engines might be able to create these objects on the stack but I don't think anyone does that yet and the result is a flood of eden objects. I would like to know I'm wrong about this. On Apr 27, 2015 4:59 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Apr 27,

is an iterator allowed to reuse the same state object?

2015-04-27 Thread John Lenz
By which I mean the object that returns the current value and done state? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: is an iterator allowed to reuse the same state object?

2015-04-27 Thread Bergi
No, it must return a new object every time. See https://esdiscuss.org/topic/performance-of-iterator-next-as-specified for the last discussion on this. Bergi ___ es-discuss mailing list es-discuss@mozilla.org

Re: is an iterator allowed to reuse the same state object?

2015-04-27 Thread Allen Wirfs-Brock
On Apr 27, 2015, at 3:29 PM, Tab Atkins Jr. wrote: On Mon, Apr 27, 2015 at 3:11 PM, John Lenz concavel...@gmail.com wrote: By which I mean the object that returns the current value and done state? IIRC, it's not supposed to. The built-in iterators will return fresh objects each time, so

Re: is an iterator allowed to reuse the same state object?

2015-04-27 Thread Tab Atkins Jr.
On Mon, Apr 27, 2015 at 3:11 PM, John Lenz concavel...@gmail.com wrote: By which I mean the object that returns the current value and done state? IIRC, it's not supposed to. The built-in iterators will return fresh objects each time, so there's no mutation hazard. Userland iterators can of