I agree that it feels like this change is messy.
The performance improvement from reducing garbage comes long after the
function in question is complete. It is hard to measure it, and it is
only a win in bulk. So as I work on reducing garbage, I make it a goal
that the function should get faster as well. That way, the wins are
guaranteed: the function is faster (immediate payoff) AND there's less
trash (long-term payoff).
I think I need to build a bit of infrastructure to quantify the GC cost
reduction so that I can make better decisions about the justifiable
Stay tuned. :)