Quarkus (Java) vs Gin (Go): Hello world performance

Mayank Choubey
Tech Tonic
3 min readNov 11, 2023

--

In the following article, we’ll explore the evaluation of the performance of two commonly employed frameworks: Gin running on Go and Quarkus running on Java. Gin boasts significant popularity within the Go community, while Quarkus was created to enable Java developers to create applications for a modern, cloud-native world. It’s crucial to emphasize that this comparative analysis zeros in on the frameworks themselves, disregarding the underlying programming languages in consideration.

Setup

All tests are executed on MacBook Pro M2 with 16G RAM. For load testing, we’ve used Bombardier test tool. The software versions are:

  • Go v1.21.3
  • Quarkus 3.5.1 (Java v21)

The application code is as simple as:

Gin (Go)

package main

import (
"net/http"
"github.com/gin-gonic/gin"
)

func main() {
r := gin.New()

r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Hello world!")
})

r.Run(":3000")
}

Quarkus (Java)

package org.acme;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import io.smallrye.common.annotation.NonBlocking;

@Path("/")
public class HelloWorldApplication {

@GET
@NonBlocking
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "Hello World!";
}
}

Results

All tests are executed for 10 million requests using 50, 100, and 300 concurrent connections. The results in chart and tabular form are as follows:

Conclusion

When it comes to speed, Quarkus (Java) outpaces Gin (Go), which may be surprising given that the Java Virtual Machine (JVM) demonstrates faster performance compared to machine code. In terms of resource utilization, Gin uses high CPU usage. Nevertheless, it’s noteworthy that the memory consumption of Quarkus is significantly higher than that of Gin.

Thanks for reading this article!

--

--