3 ms·
Go is a nice language, I've used it for 3 projects so far. But the garbage collector needs some big improvements until I will use it for anything that gets som
by eis 15y ago
Go is a nice language, I've used it for 3 projects so far.
But the garbage collector needs some big improvements until I will use it for anything that gets some kind of heavy work load.
I used it as a simple HTTP daemon that just collects data submitted by flash clients via POST requests and keeps some internal stats about them. It is literally just something like 200 lines of code.
When I had over 30 req/s, nearly 100mb overall RAM usage and a Go heap of usually about 60-70mb, a GC run would take over 115ms. During that run, it stops all other threads (stop-the-world GC). For this particular project that was OK-ish since the clients don't see the latency.
But for anything where the user is exposed to the latency (e.g. serving pages), this would be a problem. Especially since the GC latency increases faster than linearly.
I'd expect a GC run to take more than 1 second with about 100 req/s and something like 500mb RAM usage.
I could probably get much better performance by reducing the heap size by avoiding using the stdlib packages like "http". They create LOTS of garbage. Strings being imutable does not help with that either.
Unfortunately even though they said the GC is being rewritten right during the first and nearly every other presentation, this is not happening. They still are using a conservative non-generational stop-the-world GC. Even though they are tuning it a fair bit, this type of GC is not really good to begin with. It's a shame :(