4 ms·
I didn't see it mentioned in the article, but what is the perf cost to this change? Will there be more GC due to new variables every loop iteration?
by gkfasdfasdf 4y ago
I didn't see it mentioned in the article, but what is the perf cost to this change? Will there be more GC due to new variables every loop iteration?
- jlouis 4y agoThe reason for this change is to make wrong programs into correct programs. The examples will introduce more GC pressure, because the `append(..)` will append different values as the programmer expected. Thus, correcting the bug adds to GC pressure. In the cases where the new value isn't appended, the compiler can easily optimize it away, and reuse the same memory location in a register or on the stack. My guess is that the optimizer portion of the compiler is at a place nowadays where this will happen, with no further change needed. When the compiler was new, it might have been a regression in efficiency.