HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
julienschmidt
go-http-routing-benchmark
Go2014–2023
julienschmidt / go-http-routing-benchmark

go-http-routing-benchmark

Go HTTP request router and web framework benchmark

6Distinct people
6Mentions
0Explicit recommenders
1.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Go HTTP request router and web framework benchmark

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year6 dated mentions

Observed mentions: 2014-06-10 12:51:08 UTC to 2023-10-16 15:24:46 UTC.

01232014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC312
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101

What Hacker News says

6 sources
I wonder if the new version takes the opportunity to make the muxer faster. I needed a path matcher / muxer and I settled on forking julienschmidt/httprouter [1] into my own project, pathmatcher [2]. What I like about the original it is that it uses a trie for mapping paths to handlers, which can look up routes very quickly [3], and is optimized for low/zero allocations. My changes generalizes it (the 'handler' value can be any generic type) and exposes the underlying data structure so you can do non-http.Handler things with it if you want. [1]: https://github.com/julienschmidt/httprouter [2]: https://github.com/infogulch/pathmatcher [3]: https://github.com/julienschmidt/go-http-routing-benchmark
In Better HTTP server routing in Go 1.22
Gin uses HttpRouter (https://github.com/julienschmidt/httprouter) which is heavily optimized for performance, as can seen here: https://github.com/julienschmidt/go-http-routing-benchmark. As the author has noted on the page that "a comparison with other frameworks is coming soon" personally I would play safe and stick with HttpRouter for now and if it makes sense rewrite routing and switch to Lion once the performance characteristics are available. (Or maybe the author, also the OP, could join and tell how Lion compares to HttpRouter)
In Show HN: Lion, a fast HTTP router for building modern scalable modular REST APIs
Basically there aren’t much reasons besides security considerations to use net/http multiplexer at all. The baseline was profiled under STATICALL as the default net/http multiplexer does not support dynamic paths http://golang.org/pkg/net/http/#ServeMux. The benchmark is named BenchmarkHttpServeMux_StaticAll you can read the code at https://github.com/julienschmidt/go-http-routing-benchmark/b.... Frankly, net/http it not a very good http router. The results show that julienschmidt/httprouter trie based implementing outperforms net/http by 60x.
In Golang web frameworks benchmark
I ran it against: https://github.com/julienschmidt/go-http-routing-benchmark which is a pretty thorough benchmark for Go multiplexers. The author's own framework is always fastest and takes the least amount of memory (there's nothing suspicious about it, it really is the fastest). The test does a good job of showing just how horribly slow some of these, like Gorilla or Martini, really are. Anyways, Bone seems better than the horrible ones, but it's far from the fastest. A snapshot: HttpRouter_GithubStatic 20000000 61.7 ns/op 0 B/op 0 allocs/op Bone_GithubStatic 100000 12441 ns/op 2880 B/op 60 allocs/op HttpRouter_GithubParam 5000000 341 ns/op 96 B/op 1 allocs/op Bone_GithubParam 500000 2684 ns/op 853 B/op 12 allocs/op It also cra
Read the rest
shed on one of the test (first time I've seen that, so maybe I set it up wrong). The actual way to match routes is important, but something else that a lot of people miss is how to load the Params. If you want to keep the *http.Request interface, there's little choice but to append values to the req.URL.RawQuery so that they can be pulled out via req.URL.Query("...") (which, by the way, everytime time you call Query(), RawQuery gets re-parsed). This is the approach Bone appears to take. It's unfortunate because it results in extra string concatenation. If you want speed, you need to break Go's interface, expose your own req object, and use a pool or something for the params.
In Bone – Lightning Fast HTTP Multiplexer in Go

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.