Quarkus (Java) vs Fiber(Go): Hello world performance
In the following article, we’ll explore the evaluation of the performance of two commonly employed frameworks: Fiber running on Go and Quarkus running on Java. Fiber is known for its speed 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:
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!";
}
}
Fiber (Go)
package main
import (
"github.com/gofiber/fiber"
)
func main() {
app := fiber.New()
port := ":3000"
app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello World!")
})
app.Listen(port)
}
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
Quarkus, operating within the Java Virtual Machine (JVM), appears to outperform the Fiber framework, which runs as machine code, across almost all metrics. The sole area where Fiber demonstrates superiority is in its remarkably low memory consumption.
Thanks for reading this article!