Hacker News new | ask | show | jobs
by piokoch 19 days ago
I have to say I am surprised that Java is better than Go in terms of energy/time.
1 comments

How can that be possible, in my experience

Equivalant service in Java idles around 400mb of ram when Go service might use 70mb.

Because it allocates RAM up front by default. You can reduce that yourself with a single flag. You'd be surprised how far you can tune down modern Java and still run faster than Go. I did this on the benchmark games and some of those programs that used so much RAM didn't need any of it.

There's little about Go's design that is more "Ram efficient." That's not what it was made for. It's for low latency, and if you want that in Java, there are other GC's that can do that (with similar tradeoffs to Go).