Re:JVM Anatomy Quarks
by closeparen on Friday January 31, 2020 @01:05PM
(#22203855)
Benchmarking and profiling are both built into the language, which is pretty nice. But you’re right, Go is designed for safety over control. High performance Go comes down to avoiding allocations; there’s not too much else you can do at the language level.
[ Parent
| on HN ]
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?
Re:JVM Anatomy Quarks
by closeparen on Friday January 31, 2020 @05:19PM
(#22206507)
The 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.
Re:JVM Anatomy Quarks
by andreygrehov on Friday January 31, 2020 @06:05PM
(#22206889)
Or you can turn off GC altogether by setting an environment variable, GOGC=off.