4 ms·
> and spend a lot more time doing GC and other unproductive work than typical Go programs That’s definitely way in the other direction - Java’s GCs run circles
by kaba0 5y ago
> and spend a lot more time doing GC and other unproductive work than typical Go programs
That’s definitely way in the other direction - Java’s GCs run circles around Go’s. (Part of) the reason for Java’s bigger memory consumption is that it is very lazy when it comes to GC. Go runs it all the time for lower latency (at the price of much lower throughput) while Java allows for control it.
- geodel 5y agoJava GC has to be very good considering Java could take 10 times more memory for typical data structures compared to memory efficient layouts.
- kaba0 5y agoNot sure if sarcastic, but that has nothing to do with the quality of a GC algorithm. Sure, Java does not (yet) have value types so data structures with non-primitive elements will not have the most optimal layout, but java does objectively have the state of the art GC implementations that work under so high allocation rates that other GCs simply break down. Eg. Go notably slows down threads to let the GC catch up with the work load.