3 ms·
I agree. I may be wrong, but I don't think there's anything intrinsically better about Go vs Java from a GC perspective. Go has a developer-accessible stack, so
by pkulak 11y ago
I agree. I may be wrong, but I don't think there's anything intrinsically better about Go vs Java from a GC perspective. Go has a developer-accessible stack, so there may be more opportunity for tuning there, but they both do escape analysis and Java will put things on the stack for you if it determines that it can. They both have loads of really smart people working on GC, so I'd be really surprised if one was far better in that regard than the other.
- jerf 11y ago"I may be wrong, but I don't think there's anything intrinsically better about Go vs Java from a GC perspective." Go has a lot more things that can be value types than Java at the moment, which can help for some use cases, and doesn't do squat for others. I'd say it's easier to use Go in a way that lets you avoid the GC entirely, but only easier, not "easy", and when you are forced on to the GC Java will of course have the advantage, at least if you have enough RAM. It's more nuanced than "Java is always better"... which is to some extent precisely why Java is last I knew looking at adding value types, which would tip this discussion firmly back in Java's camp from a technical point of view, probably. (At least once it matured.) I'm not sure what the current status of that discussion is; all the discussions I can dig up in Google are still saying it may go in to Java 9. Anyone with a more up-to-date link, please let me know.