4 ms·
> Gmail engineers had to worry so much about Internet Explorer's poor garbage collection algorithm that they'd need to manually hoist string literals out of for
by cribbles 8y ago
> Gmail engineers had to worry so much about Internet Explorer's poor garbage collection algorithm that they'd need to manually hoist string literals out of for loops to avoid GC pauses.
What does this mean in practice? I know about variable hoisting and function scoping, but not about old JS GC algos.
- MBCook 8y agoMy read was that Internet Explorer couldn’t realize that a string variable could be reused over and over so each iteration of the loop it was allocating a new one, using it, and then garbage collecting it. Basically tons of unnecessary overhead. Having the programmer define a variable before the loop and then reuse it each iteration meant that all that allocation and garbage collection wasn’t necessary during the passes of the loop.
- evmar 8y agoThat is exactly right.