.Net vs Java vs Go vs Rust: Hello UUID performance

Mayank C
Tech Tonic

--

In this article, I’ll compare the performance of .Net with the famous frameworks in different languages: Spring Boot Webflux (Java), Quarkus (Java), Gin (Go), and Actix (Rust). There have been numerous requests to run some benchmarks using .Net. Unlike the earlier article where, .Net was compared with Node frameworks, this time the competition will be very tough against the heavyweights like Java, Go, and Rust. So far, .Net’s performance has been looking promising (at least for simple use cases).

I’m going to use the simple Hello World case with a small change. Instead of sending ‘Hello world’ in every response, I’m going to add randomness by sending “Hello <uuid>” instead. This’ll ensure that a unique response gets sent every time.

The choice of frameworks for Java, Go, and Rust is based on popularity only. You can take it as a comparison of frameworks rather than a comparison of languages.

Test setup

All tests are executed on MacBook M2 with 16G RAM & 8+4 cores. The versions are:

  • .Net v8
  • Go v1.22
  • Rust 1.76.0
  • Java v21

For load testing, I’ve used Bombardier (as always).

As mentioned earlier, just to add a bit of randomness in the responses, I’m generating a UUID and appending it to ‘Hello <uuid>’. This way, each response is unique.

The code for all applications is as follows:

The rust application has been built in release mode.

Results

The test of 5M requests is executed for 100 concurrent connections. The results in chart form are as follows:

Time taken to finish 5M Requests

Avg. Requests per second

Latencies

Resource usage

Verdict

.Net gave a very good competition to heavyweights like Java, Go, and Rust. In terms of performance, all the applications are the same. No noticeable difference between any of them.

However, the difference is significant in terms of resource usage. .Net’s CPU usage is the highest (500%), while Rust’s is the lowest (200%). The memory usage of Webflux is the highest (600M), while Rust’s is the lowest (9M, that’s all). .Net’s memory usage is 200M, still very high when compared to Go (29M) and Rust (9M).

Winner: Rust (what else did you expect?)

Thanks for reading this article.

If you want to find out how Node frameworks fare against .Net for the same use case, you can visit the article here.

--

--