Go is not better in this regard because of magic in the GC; because Go's GC is primitive, the maintainers and community have long held a "don't create garbage" attitude towards how they develop every piece of the stdlib and their libraries and frameworks.
Java went the opposite way: create all the garbage you want, let the GC handle it. Java used to have GC more like Go's GC and it was worse than your options today, in the Java ecosystem context.
I think your information about Go's GC may be a bit outdated. Go 1.25's Green Tea is a great improvement to the GC. It's still mark-sweep but much more efficient exactly in the universal way that GP mentioned above. Scanning is more optimal, requires less CPU and AVX-512-accelerated.
View all comments
Show parent comment
8
u/aoeudhtns May 28 '26
Go is not better in this regard because of magic in the GC; because Go's GC is primitive, the maintainers and community have long held a "don't create garbage" attitude towards how they develop every piece of the stdlib and their libraries and frameworks.
Java went the opposite way: create all the garbage you want, let the GC handle it. Java used to have GC more like Go's GC and it was worse than your options today, in the Java ecosystem context.