Comparison between Java, Go, and Rust

Dexter Darwich
Apr 26 · 9 min read
Image for post
Image for post

Image for post
Image for post
The endpoints served by the web service, in Java, Go, and Rust.

Artifact Size

Image for post
Image for post
Compiled size of each program in megabytes.

Memory Usage

Idle, doing nothing

Image for post
Image for post
Memory usage of each application while running idle in memory.

Serving REST Requests

wrk -t2 -c400 -d30s http://127.0.0.1:8080/hello 
wrk -t2 -c400 -d30s http://127.0.0.1:8080/greeting/Jane
wrk -t2 -c400 -d30s http://127.0.0.1:8080/fibonacci/35
Image for post
Image for post
CPU usage while hitting the /hello endpoint
Image for post
Image for post
Memory usage while hitting the /hello endpoint
Image for post
Image for post
Requests per second while hitting the /hello endpoint

Image for post
Image for post
CPU usage while hitting the /greeting endpoint
Image for post
Image for post
Memory usage while hitting the /greeting endpoint
Image for post
Image for post
Requests per second while hitting the /greeting endpoint

Image for post
Image for post
CPU usage while hitting the /fibonacci endpoint
Image for post
Image for post
Memory usage while hitting the /fibonacci endpoint
Image for post
Image for post
Requests per second while hitting the /fibonacci endpoint
Image for post
Image for post
Timeouts
Image for post
Image for post
Latency for the /fibonacci endpoint

Runtime size

Image for post
Image for post
Final Docker images size

Conclusion

Image for post
Image for post
How the three languages compare

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store