Tech Tonic

Articles on popular things like Node.js, Deno, Bun, etc.

Go: The fastest web framework in 2025

Mayank C
Tech Tonic
Published in
4 min readJan 28, 2025

--

After receiving the ground-breaking response for a similar article published in 2024, and catering to the requests for a follow-up, I’m writing a similar article in 2025. This is the exact same comparison, but executed on latest of everything (Go and frameworks).

In this article, we’ll run a hello world comparison using several popular go frameworks such as Gin, Fiber, Echo, HTTP router, chi, beego, and Iris. Yes, this one is a dummy case of hello world. If you’re looking for a more solid and real-world comparison, this article is not for you.

Let’s jump directly into to the article.

Test setup

All tests are executed on MacBook Pro M2 with 16G RAM. There are 8+4 CPU cores. The load tester is Bombardier (also written in Go). The Go version is v1.23.5 (latest at the time of writing).

The code for each application is as follows:

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

Iris

package main

import "github.com/kataras/iris/v12"

func main() {
app := iris.New()

app.Get("/", func(ctx iris.Context) {
ctx.Text("Hello World!")
})

app.Listen(":3000")
}

Chi

package main

import (
"net/http"
"github.com/go-chi/chi/v5"
)

func main() {
r := chi.NewRouter()
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello World!"))
})
http.ListenAndServe(":3000", r)
}

Http Router

package main

import (
"fmt"
"net/http"
"log"
"github.com/julienschmidt/httprouter"
)

func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
fmt.Fprintf(w, "Hello World!")
}

func main() {
router := httprouter.New()
router.GET("/", Hello)

log.Fatal(http.ListenAndServe(":3000", router))
}

Beego

package main

import web "github.com/beego/beego/v2/server/web"

type MainController struct {
web.Controller
}

func (c *MainController) Get() {
c.Ctx.WriteString("Hello world!")
}

func main() {
web.Router("/", &MainController{})
web.Run()
}

Results

A total of 10M requests are executed for 100 concurrent connections. Along with latency, I’ve also collected CPU and memory usage (as always the case). This gives a complete picture. Just having high RPS is not enough. We also need to know the cost of the RPS. A framework giving a high performance by hogging the CPU may not be useful for production applications.

The results in chart form are as follows:

Time taken

(Lesser is better)

Requests per second

(More is better)

Latencies

(Lesser are better)

Resources

(Lesser are better)

Conclusion

Numbers show that Echo is the best performer.

I also understand & heard (many times) that TechEmpower benchmarks show fiber demonstrating the highest performance. These are my results, and they show Fiber to be lacking in performance. I won’t be changing my results because TechEmpower demonstrated different results in 2023.

Thanks for reading!

If you see any missing framework, please let me know.

--

--

Tech Tonic
Tech Tonic

Published in Tech Tonic

Articles on popular things like Node.js, Deno, Bun, etc.

Mayank C
Mayank C

No responses yet