"Super" hoisting

Brian Barnes ggadwa at charter.net
Fri May 13 16:14:02 UTC 2016


> On May 13, 2016, at 11:09 AM, Herby Vojčík <herby at mailbox.sk> wrote:
> 
> 
> 
> Brian Barnes wrote:
>> It could be, but there is a difference between:
>> 
>> var x;
>> 
>> and:
>> 
>> this.x
> 
> You should probably do `var x = XPool.get();` and at the end `XPool.put(x);` and do `XPool`s for every possible X type which you want to not GC. And then happily use local variable, as it should be. If things are not very parallel / reentrant, the pools will likely only contains zero / single element.

I already do this, I was just showing possible problems with engines doing this without a hint.  Right now if I have anything that’s an object that only lives within a function, I move it to the class constructor, no need for the extra additions of a pool.

[>] Brian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160513/3b257e7e/attachment.html>


More information about the es-discuss mailing list