News for hackers. Stuff that matters.
Re:Backward Compatibility, Go 1.21, and Go 2 by oefrha on Monday August 14, 2023 @01:11PM (#37123604)
There are at least two cases where GOGC=off could make sense for increasing performance:

1. You know you’re definitely not allocating on the heap;

2. Your workload is bursty and you can simply keep everything until the process dies and memory is released.

Re:Backward Compatibility, Go 1.21, and Go 2 by throwaway894345 on Monday August 14, 2023 @01:29PM (#37123852)
If you're definitely not allocating on the heap, setting GOGC=off should make no difference, right?
Re:Backward Compatibility, Go 1.21, and Go 2 by _ph_ on Monday August 14, 2023 @03:34PM (#37125735)
You might be allocating on the heap, but if you know in advance that the allocated memory never goes out of scope, then switching off the gc is quite reasonable.