4 ms·
You're right (except for some cases like crypto and regex where other languages "cheat" by using C bindings or unstable versions), but that isn't where it has b
by thirsteh 13y ago
You're right (except for some cases like crypto and regex where other languages "cheat" by using C bindings or unstable versions), but that isn't where it has bit me. In general all my Go programs have been more than fast enough, but on several occasions I've had memory starvation problems that I would not be having in other languages (even if there is a way to do it without doing a lot of allocation and fragmentation in Go.)
I love Go, but "it's fast" isn't a good reason not to improve a subpar GC. (Which fortunately isn't a position the Go team is taking. I know everyone there would like to see a lot of interesting things happen with the GC. It just hasn't been one of the more pressing issues so far, and I've agreed. It's also a very difficult and "boring" thing to work on for most people, so it's not surprising that somebody hasn't just added an Azul C4-style concurrent GC in their spare time.)
- aaronblohowiak 13y agoYes, Golang is very young and its gc is one of the more 'immature' portions. However, in comparison to the tools that it is regularly displacing the overall speed is still a huge win. Eventually, Golang will get a better gc and in the meantime we can already enjoy faster programs. Nobody is arguing that the gc of today should be Golang's gc forever.
- wglb 13y agoHave you noticed the starvation in 64 bit programs or 32 bit programs?
- thirsteh 13y agoBoth. They weren't issues with precision/no gc at all, but that the arena contents became fragmented, as far as I could tell.
- pcwalton 13y agoAzul C4 requires a kernel module or a specialized kernel to support all the MMU tricks that it relies on to achieve maximum performance. I don't think it's really an appropriate choice for general purpose GC in a language that's designed to be easy to deploy. Java HotSpot's collector makes the most sense IMHO: stop the world compacting in the young generation, mostly concurrent in the tenured generation. It achieves better throughput than Azul C4 too, according to the C4 paper.
- agentS 13y agoI vaguely remember reading somewhere that they figured out a way to run their collector on stock Linux; I think the price they paid in exchange was (even) lower throughput (trying to track down reference so I know I wasn't daydreaming) (yes, I daydream about GCs). A while ago, I read through the kernel patch they provided, and it was basically adding batch APIs for mremap so you don't have to have a TLB flush for every call. Also because all mutator threads needed to be paused at a safepoint while the remaps happen, so the batch API has much shorter pause time.
- lucian1900 13y agoNeither of HotSpot's collectors guarantee maximum latency, though, which is Azul C4's interesting feature. I would pay throughput to achieve (soft) real-time GC.
- stcredzero 13y ago> In general all my Go programs have been more than fast enough, but on several occasions I've had memory starvation problems that I would not be having in other languages The problem with GC's languages, is that GC is "good enough" for prototyping and for undemanding stuff, but there are still these corner cases. Really, it's no different than other forms of memory management in this regard. It's just particularly beginner friendly.