3 ms·
They discuss this here: https://github.com/golang/go/wiki/LoopvarExperiment#will-the-change-make-programs-slower-by-causing-more-allocations https://github.com/
by quacker 3y ago
They discuss this here: https://github.com/golang/go/wiki/LoopvarExperiment#will-the-change-make-programs-slower-by-causing-more-allocations https://github.com/golang/go/wiki/LoopvarExperiment#will-the...
In fact, you can enable warnings/logs that indicate whether code that is affected by the loopvar experiment results in a stack-allocated or heap-allocated loop variable: https://github.com/golang/go/wiki/LoopvarExperiment#can-i-see-a-list-of-places-in-my-code-affected-by-the-change https://github.com/golang/go/wiki/LoopvarExperiment#can-i-se...
I imagine that the current workarounds for this issue also end up with heap-allocated variables in many cases.