3 ms·
Go's GC isn't compacting, and might never be, because it made the short-sighted decision that Go pointers can be handed directly to asm or C code. It's also st
by fl0ki 3y ago
Go's GC isn't compacting, and might never be, because it made the short-sighted decision that Go pointers can be handed directly to asm or C code.
It's also stuck on an old fork of tcmalloc which isn't anywhere near the state of the art today and will only fall further behind if they don't at least start on a plan to make allocators interchangeable. Bear in mind that Rust has had interchangeable allocators for years, and Java has had interchangeable GCs for decades, while Go still has neither.
Go's GC is pretty good for what it is, especially now that it has become more of a control system that converges on a target collection time ratio. But it is neither a state of the art GC -- not even by the standards of 10 years ago given how far along the JVM was already -- nor is [de]allocation done with a state of the art allocator.
People praise that Go promises a 10ms max duration for GC Assist -- the mechanism that makes your actual critical-path work pause and help out the struggling GC -- and while 10ms is fine for a logs pipeline or something, it's extraordinarily bad for many kinds of API endpoints which should have a 99th percentile latency under 1ms (bearing in mind that even local networking is going to add to that considerably so the floor should start low).
That's despite Go's GC being hailed for targeting predictable low latency rather than overall throughput... this is the predictable low latency they're talking about. 10ms is a failure in a world of sub-ms targets, and Go as a language gives you very limited options to avoid it, even after abandonding community idioms and popular libraries.
- kaba0 3y agoYes, you are absolutely correct (and while I was familiar with Java’s GCs and that Go’s are way behind, I wasn’t well read on what exactly Go’s do, so thanks for writing that!), I wasn’t defending Go’s GC, only making a nitpick.