Hacker News new | ask | show | jobs
by Thaxll 2374 days ago
I used both Java and Go in production and yes Go can be faster or Java it depends but Go usually use between 3 and 10x less memory.

https://www.techempower.com/benchmarks/ ( real world benchmark with networking / serialization ect ... )

Get over it yes Go can be faster than Java it's not a secret.

1 comments

> real world benchmark

Highly debatable. Even then, you see that golang ranks in the 102nd place for the plaintext benchmark, almost 6x slower than Netty, which is very established in the JVM world. Same with the JSON benchmark, golang is in the 126th place, ~3.5x slower than Netty and Vertx.

> but Go usually use between 3 and 10x less memory.

The JVM by default will use whatever memory is assigned to it. This makes sense from an efficiency and utilization point of view, as it generally aims for maintaining good throughput (whereas golang is only tuned for latency). The JVM now ships with new low latency GCs (ZGC and Shenandoah) which are currently available in experimental phase.

You didn't read the benchmark properly, plaintext benchmark it's 6th.
The first golang result in the plaintext benchmark ranks 8th (atreugo-prefork), which is incidentally immediately followed by firenio-http-lite, a Java library.

My point still stands, this is a third party library that is not commonly used, and depends on another third party library, fasthttp, which itself comes with caveats from the its author.

Doesn't matter, it's still Go code, and contrary to many languages on that benchmark ( Java included ) all Go code is built in Go, so there is no runtime / external library written in C/C++. ( one of the reason why Go is also slow on the regex benchmarks )