3 ms·
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 wor
by oefrha 3y ago
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.
- throwaway894345 3y agoIf you're definitely not allocating on the heap, setting GOGC=off should make no difference, right?
- _ph_ 3y agoYou 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.