finds.dev

julienschmidt/go-http-routing-benchmark

Go HTTP request router and web framework benchmark

View on GitHub

★ 1,658GoBSD-3-Clauseupdated Sep 2023

// the take

A benchmark suite comparing Go HTTP router performance across real-world API shapes (GitHub's 203 routes, Parse's 26, Google+'s 13). Written by the httprouter author, so take the framing with some skepticism — but the raw numbers are reproducible and the methodology is sound enough to be useful when choosing a router.

HttpRouter's radix-tree approach genuinely dominates: 139ns vs 2665ns for Gorilla Mux on a single param route, with 1 allocation vs 7. The benchmark uses real API route shapes instead of synthetic toy routes, which makes the results more actionable. Memory consumption table is a nice addition — shows Gorilla's 1.5MB for GitHub routes vs HttpRouter's 44KB, which matters if you're running many services. The `go test -bench` approach means results are reproducible on any machine.

Benchmarks were run on Go 1.3 (2014) on a Sandy Bridge CPU — that's 12+ years stale. The Go runtime's escape analysis, GC, and compiler have changed substantially; allocation counts and ns/op numbers would look different today. Most of the tested routers are abandoned or have been superseded (go-json-rest, Traffic, Kocha, Possum), so this is a historical artifact more than a current decision tool. Chi, Gin, Echo, and Fiber — the routers people actually use in 2024 — aren't here at all. The repo's last push was 2023 but no new benchmarks were added, just dependency maintenance.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,658
Forks
241
Language
Go
License
BSD-3-Clause
Last commit
12 Sep 2023

// nearby

If go-http-routing-benchmark isn't quite it.

All repos →