3 ms·
Not sure if you can even control GCs that well some times. In Java I've worked on projects that never GC once they reach a steady state. I'm not sure I could do
by jnordwick 7y ago
Not sure if you can even control GCs that well some times. In Java I've worked on projects that never GC once they reach a steady state. I'm not sure I could do the same in Go, or maybe the techniques are just more involved or different?
- closeparen 7y agoThe technique is basically to preallocate your structs and reuse them via *sync.Pool, never allocate on a hot path. I don't know about "never" GC but it at least minimizes GC, and the pauses are very short.
- andreygrehov 7y agoOr you can turn off GC altogether by setting an environment variable, GOGC=off.