A new contender has entered the crowded field of Go HTTP routers. MuxMaster, released as v1.1.0 under the MIT license, is a radix-tree router built on the Go standard library alone — no external dependencies, no custom handler types, and, according to its published benchmarks, faster than every alternative currently available to Go developers.
The module is hosted on GitHub at github.com/FlavioCFOliveira/MuxMaster, with documentation, an API reference, and reproducible benchmarks at muxmaster.net.
What it is
At its core, MuxMaster is a drop-in replacement for http.ServeMux. Routes are matched through a radix tree with O(k) lookup complexity, where k is the length of the request path rather than the number of registered routes. The router preserves the net/http handler interface exactly: handlers remain http.Handler, middleware remains func(http.Handler) http.Handler, and existing code compiles without modification. There is no proprietary context type to learn, no framework lock-in, and no migration tax for teams that want to adopt it incrementally — one route, one sub-tree, or an entire service at a time.
The release ships with seventeen production-grade middlewares bundled in, covering the components most services end up writing themselves: RequestID, Recoverer, Logger, Compress, RealIP, Timeout, Throttle, BasicAuth, JWTAuth, OAuth2Introspect, APIKey, and CORS, among others. All of them are implemented on the standard library; the go.mod declares no require directives beyond test fixtures.
Performance is the headline
The numbers MuxMaster publishes are aggressive. Static-route lookups complete in 25 nanoseconds with zero allocations. With the opt-in PoolRequestBundle flag, a one-parameter route resolves in 45 nanoseconds with zero allocations — a result MuxMaster claims makes it the only net/http-compatible router to achieve zero allocations on parameterised routes.
Against the rest of the Go routing ecosystem, measured on the same harness, the published one-parameter numbers are striking: 45 ns for MuxMaster Pooled, 56 ns for the long-standing benchmark leader httprouter, 212 ns for Fiber v3 (which runs on fasthttp, not net/http), 354 ns for chi v5, and roughly 3.4 milliseconds for gorilla/mux — a gap of nearly five orders of magnitude that the project attributes to gorilla’s well-known allocation behaviour under load. All benchmarks were run on an AMD Ryzen 9 5900HX with Go 1.26.2 and consolidated through benchstat from ten two-second runs.
For developers, the practical translation is straightforward: on a typical API with parameterised paths, MuxMaster claims a 20 percent edge over httprouter while keeping the standard handler signature httprouter requires you to abandon.
Trade-offs and contracts
The PoolRequestBundle mode that delivers the headline numbers is opt-in for good reason. The router recycles per-request bundles through tiered sync.Pools, which imposes a strict lifetime contract on handler authors: the *http.Request must not be retained beyond the handler’s return. Capturing the request in a long-lived goroutine, for example, is unsafe. MuxMaster’s documentation calls this out explicitly and provides the only sanctioned pattern — drain the request fully before spawning any goroutine that outlives the handler.
For teams unwilling or unable to enforce that discipline, the default path remains available at 105 ns and one allocation per request, still competitive with established routers.
Ergonomics
Beyond raw speed, MuxMaster ships several quality-of-life features. An optional HandlerFuncE signature threads errors through middleware chains, eliminating the boilerplate of writing errors to the response writer at every leaf. The Params type exposes typed accessors — Params.Int, Params.Bool, Params.UUID — that parse and validate path parameters in a single call, returning idiomatic Go errors when the input doesn’t conform.
A minimal example from the project's landing page:
package main
import (
"log"
"net/http"
"github.com/FlavioCFOliveira/MuxMaster"
)
func main() {
mux := muxmaster.New()
mux.GET("/users/:id", func(w http.ResponseWriter, r *http.Request) {
id, err := muxmaster.ParamsFromContext(r.Context()).Int("id")
if err != nil {
http.Error(w, "invalid id", http.StatusBadRequest)
return
}
if err := muxmaster.JSON(w, http.StatusOK, map[string]int{"id": id}); err != nil {
log.Printf("write response: %v", err)
}
})
if err := http.ListenAndServe(":8080", mux); err != nil {
log.Fatal(err)
}
}
Dogfooding as proof
In a detail that should reassure cautious adopters, the project's own website is served by a Go binary using MuxMaster as its router, with the bundled middleware handling logging, compression, request IDs, and security headers. The maintainers' framing is direct: the router is the documentation, and the site is the proof.
Requirements and availability
MuxMaster requires Go 1.26 or later, a constraint set by the go directive in the upstream module. It is released under the MIT license, which permits commercial use, modification, and distribution, with the standard requirement of preserving the copyright notice. The source, including benchmark reproduction instructions and the full per-sprint performance audit, is available at github.com/FlavioCFOliveira/MuxMaster.
For Go developers who have been waiting for a router that combines the ergonomics of the standard library with performance that beats the specialised alternatives, MuxMaster is now worth a look.
Top comments (1)
My telegram @usa_eu_service
My Microsoft teams username EU PRO
Market items⭐️
Payment account's💵
Payoneer $100💎PayPal $120💎Parallax $100💎$120 Deel
Wise $120💎Grey.co $100💎AirTM $100💎SwiftFi $100
Revolut $300💎$100 Payeer💎$100 Curve💎$250 Monese
$500 N26💎$150 Paysera💎$150 Neteller💎$150 Skrill
————————————————————————————
Premium USA Banks💎
Mercury Business LLC $1200💎Mercury personal $600
Airwallex Business $1000💎
Relay Business $1200💎
————————————————————————————
Crypto platform account's💎
Coinbase $100💎Binance $100💎ByBit $100
Kucoin $100💎Kraken $100💎Crypto.com $140
$200 Gemini💎$120 Bitstamp💎$100 Huobi
$100 OKX💎$120 KuCoin💎$120 Bitfinex
$150 Bittrex💎$100 Gate.io
————————————————————————————
Freelancer platform
$150 Contra💎$200 Peopleperhour💎$150 Linkedln
————————————————————————————
Gmail with custom name $10💎
Gmai Old account $10💎
Some comments have been hidden by the post's author - find out more