Quarkus vs Go frameworks: Hello World Performance

Mayank C
Tech Tonic

--

This is a requested article. Readers have asked for an up-to-date comparison of Quarkus (one of the fastest choice in the Java world) and popular Go frameworks like Gin, Fiber, and Echo.

In this article, we will focus on the simplest “Hello World” use case. We acknowledge that a “Hello World” example is far from real-world scenarios and not the ideal use case for benchmarking. We will follow up with another article that will perform database reads (I/O-bound operations).

A similar comparison with Spring Boot (powered by virtual threads) can be seen here:

Test setup

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

  • Quarkus 3.10.0 (Java 21.0.3)
  • Go 1.22.3

The tests are conducted using Bombardier load tester.

The application code is as follows:

Quarkus

// application.properties

quarkus.http.port=3000

// HelloWorldApplication.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!";
}
}

Gin

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")
}

Fiber

package main

import (
"github.com/gofiber/fiber/v2"
)

func main() {
app := fiber.New()
port := ":3000"

app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello World!")
})

app.Listen(port)
}

Echo

package main

import (
"net/http"

"github.com/labstack/echo/v4"
)

func main() {
e := echo.New()
e.GET("/", func(c echo.Context) error {
return c.String(http.StatusOK, "Hello World!")
})
e.Start(":3000")
}

Results

The test is carried out for 100 concurrent connections, running for a total of 10M requests.

The results in chart form as follows:

Analysis

Firstly, the competition is much tougher this time around. When we previously used Spring Boot, Go frameworks (although significantly less feature-rich) outperformed Spring Boot in all measurements. However, with Quarkus, the results are quite different.

Quarkus offers more requests per second (RPS) compared to any other Go framework. Additionally, Quarkus’s latency numbers are also comparable. Furthermore, Quarkus uses less CPU compared to Go. The only area where Quarkus falls short is in memory usage (250M vs 30M).

Winner: Tough to pick.

--

--