3 ms·
How's the garbage collector these days for Go? Is it close to the performance of the Java GC?
by pkulak 14y ago
How's the garbage collector these days for Go? Is it close to the performance of the Java GC?
- batista 14y agoNo, still the same old one. Improvements are supposedly coming though (though, they were coming 2 years ago also).
- luriel 14y agoThere have been many improvements to the GC over the last two years, and many more are coming in Go 1.1. GC is an area where always there is room for improvement, no matter how much you work at it.
- Evbn 14y agoIt's not as sophisticated, but Go structs are smaller than similar Java objects, so that helps beat the tradeoff
- danieldk 14y agoI like Go, but this is total nonsense. It does help that you can embed values in a struct, rather than using pointers. But marking everything that looks like a pointer is not efficient. Not having generations does not help. Go is still very young, a better GC will come, just give it time. In the meanwhile, let's not pretend that the current sub-par generator is as performant as that of modern JVMs.
- luriel 14y agoGo code does produce considerably less garbage than Java code. And with Go if you really care, you can be even more careful and produce close to no garbage. Control over memory layout is really useful.
- chc 14y agoAFAIK, Go does not "mark everything that looks like a pointer." My understanding is that in some specific situations, the Go GC is not precise enough to distinguish between a pointer and an integer that happens to have the same value as that pointer, but I don't think it's right to say it does that all the time. Do you have evidence that it does?