TopGit tracks gin-gonic/go-http-routing-benchmark on GitHub. The project has 61 stars. Go HTTP request router and web framework benchmark
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
This benchmark suite aims to compare the performance of HTTP request routers for Go by implementing the routing structure of some real world APIs.
Some of the APIs are slightly adapted, since they can not be implemented 1:1 in some of the routers.
Of course the tested routers can be used for any kind of HTTP request → handler function routing, not only (REST) APIs.
Tested routers & frameworks
Beego
BunRouter
Chi
Echo
Fiber (fasthttp-based, benchmarked separately)
Gin
Goji v2
Go-Restful
Gorilla Mux
http.ServeMux (static routes only)
HttpRouter
HttpTreeMux
Macaron
Note: Fiber is based on fasthttp and does not implement the net/httpHandler interface. Its benchmarks use a separate infrastructure and should be compared independently from the net/http-based routers.
Motivation
Go is a great language for web applications. Since the default request multiplexer of Go's net/http package is very simple and limited, an accordingly high number of HTTP request routers exist.
Unfortunately, most of the (early) routers use pretty bad routing algorithms. Moreover, many of them are very wasteful with memory allocations, which can become a problem in a language with Garbage Collection like Go, since every (heap) allocation results in more work for the Garbage Collector.
Lately more and more bloated frameworks pop up, outdoing one another in the number of features. This benchmark tries to measure their overhead.
Be aware that we are comparing apples and oranges here. We compare feature-rich frameworks to packages with simple routing functionality only. But since we are only interested in decent request routing, I think this is not entirely unfair. The frameworks are configured to do as little additional work as possible.
If you care about performance, this benchmark can maybe help you find the right router, which scales with your application.
Personally, I prefer slim and optimized software, which is why I implemented HttpRouter, which is also tested here. In fact, this benchmark suite started as part of the packages tests, but was then extended to a generic benchmark suite.
So keep in mind, that I am not completely unbiased :relieved:
Usage
go test -bench=. -benchmem -timeout=20m
Results
Benchmark system:
Apple M4 Pro
go version go1.25.8 darwin/arm64
macOS (Darwin 25.3.0)
Summary
The table below ranks all routers by GitHub API throughput (203 routes, all methods), which best represents real-world routing workloads. Lower ns/op is better.
Rank
Router
ns/op
B/op
allocs/op
Zero-alloc
1
Gin
9,944
0
0
:white_check_mark:
2
BunRouter
10,281
0
0
:white_check_mark:
3
Echo
11,072
0
0
:white_check_mark:
4
HttpRouter
15,059
13,792
167
5
HttpTreeMux
49,302
65,856
671
6
Chi
94,376
130,817
740
7
Beego
101,941
71,456
609
8
Fiber
109,148
0
0
:white_check_mark:
9
Macaron
121,785
147,784
1,624
10
Goji v2
242,849
313,744
3,712
11
GoRestful
885,678
1,006,744
3,009
12
GorillaMux
1,316,844
225,667
1,588
Key takeaways:
Gin, BunRouter, and Echo form the top tier — all achieve zero heap allocations and route the full GitHub API in ~10 us.
HttpRouter remains extremely fast but incurs 1 alloc per parameterized route (167 allocs for 203 routes).
Fiber also achieves zero allocations, but its fasthttp-based benchmark infrastructure adds per-iteration reset overhead — do not compare its absolute ns/op directly with net/http routers.
GorillaMux and GoRestful are feature-rich but orders of magnitude slower, making them less suitable for latency-sensitive applications.
Fiber caveat: Fiber benchmarks use fasthttp.RequestCtx with per-iteration Reset, which adds constant overhead not present in net/http benchmarks. Fiber-vs-Fiber comparisons are valid; cross-framework comparisons should be interpreted with care.
Memory Consumption
The following table shows the heap memory required for loading the routing structure of the respective API.
How active is development on gin-gonic/go-http-routing-benchmark?
The most recent commit recorded on gin-gonic/go-http-routing-benchmark was 7 months ago, based on the GitHub push timestamp. The repository has 16 forks — one of the better signals of community interest.
How many stars does gin-gonic/go-http-routing-benchmark have?
gin-gonic/go-http-routing-benchmark has 61 GitHub stars — refresh the page for the live number, or check github.com/gin-gonic/go-http-routing-benchmark. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is gin-gonic/go-http-routing-benchmark open source?
Yes — gin-gonic/go-http-routing-benchmark ships under the BSD-3-Clause license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/gin-gonic/go-http-routing-benchmark.
What is gin-gonic/go-http-routing-benchmark?
gin-gonic/go-http-routing-benchmark (gin-gonic/go-http-routing-benchmark) is a Go project on GitHub. From the project's own README: Go HTTP request router and web framework benchmark
Where do I read more about gin-gonic/go-http-routing-benchmark?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/gin-gonic/go-http-routing-benchmark is the definitive source.
Read full README in the tab above.
Is go-http-routing-benchmark worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of go-http-routing-benchmark.