News for hackers. Stuff that matters.
Re:Introducing Swift by kevingadd on Monday June 02, 2014 @07:40PM (#7837239)
This is not accurate. SpiderMonkey and V8 still retain the entire outer scope if any of the variables are used.

See here for an example: https://www.meteor.com/blog/2013/08/13/an-interesting-kind-o...

This bug is still not fixed. There's an issue open for it on the V8 tracker, I believe. It seems to have not gotten fixed in either engine because it's a difficult problem that affects a small subset of JS applications.

Re:Introducing Swift by curveship on Monday June 02, 2014 @08:14PM (#7837369)
So go ahead and run his test. Things have changed :). Memory builds up 1mb/second, then after a few seconds, you'll see it drop back to zero, as the GC runs.

V8 has seen a lot of really nice optimizations to closures over the last year. My favorite is that closures are no longer considered megamorphic.

Re:Introducing Swift by kevingadd on Monday June 02, 2014 @08:37PM (#7837473)
Oh wow, when did that land? I was getting hit by that leak with JSIL in the last couple months. Can you link to the commit?
Re:Introducing Swift by curveship on Monday June 02, 2014 @08:57PM (#7837564)
Not sure the date. I first noticed the change back in April, when I was profiling some code. Ask vegorov: http://mrale.ph/blog/2012/09/23/grokking-v8-closures-for-fun... .