<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Flavio CF Oliveira</title>
    <description>The latest articles on DEV Community by Flavio CF Oliveira (@flavio_cf_oliveira).</description>
    <link>https://dev.to/flavio_cf_oliveira</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3932844%2F11ec8320-69c1-4753-bd8b-809db4db3146.jpg</url>
      <title>DEV Community: Flavio CF Oliveira</title>
      <link>https://dev.to/flavio_cf_oliveira</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/flavio_cf_oliveira"/>
    <language>en</language>
    <item>
      <title>MuxMaster Arrives: A New Zero-Dependency HTTP Router Stakes Its Claim as the Fastest in Go</title>
      <dc:creator>Flavio CF Oliveira</dc:creator>
      <pubDate>Fri, 15 May 2026 09:38:11 +0000</pubDate>
      <link>https://dev.to/flavio_cf_oliveira/muxmaster-arrives-a-new-zero-dependency-http-router-stakes-its-claim-as-the-fastest-in-go-259b</link>
      <guid>https://dev.to/flavio_cf_oliveira/muxmaster-arrives-a-new-zero-dependency-http-router-stakes-its-claim-as-the-fastest-in-go-259b</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The module is hosted on GitHub at &lt;code&gt;github.com/FlavioCFOliveira/MuxMaster&lt;/code&gt;, with documentation, an API reference, and reproducible benchmarks at &lt;a href="https://muxmaster.net/" rel="noopener noreferrer"&gt;muxmaster.net&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it is
&lt;/h2&gt;

&lt;p&gt;At its core, MuxMaster is a drop-in replacement for &lt;code&gt;http.ServeMux&lt;/code&gt;. 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 &lt;code&gt;net/http&lt;/code&gt; handler interface exactly: handlers remain &lt;code&gt;http.Handler&lt;/code&gt;, middleware remains &lt;code&gt;func(http.Handler) http.Handler&lt;/code&gt;, 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.&lt;/p&gt;

&lt;p&gt;The release ships with seventeen production-grade middlewares bundled in, covering the components most services end up writing themselves: &lt;code&gt;RequestID&lt;/code&gt;, &lt;code&gt;Recoverer&lt;/code&gt;, &lt;code&gt;Logger&lt;/code&gt;, &lt;code&gt;Compress&lt;/code&gt;, &lt;code&gt;RealIP&lt;/code&gt;, &lt;code&gt;Timeout&lt;/code&gt;, &lt;code&gt;Throttle&lt;/code&gt;, &lt;code&gt;BasicAuth&lt;/code&gt;, &lt;code&gt;JWTAuth&lt;/code&gt;, &lt;code&gt;OAuth2Introspect&lt;/code&gt;, &lt;code&gt;APIKey&lt;/code&gt;, and &lt;code&gt;CORS&lt;/code&gt;, among others. All of them are implemented on the standard library; the &lt;code&gt;go.mod&lt;/code&gt; declares no &lt;code&gt;require&lt;/code&gt; directives beyond test fixtures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance is the headline
&lt;/h2&gt;

&lt;p&gt;The numbers MuxMaster publishes are aggressive. Static-route lookups complete in 25 nanoseconds with zero allocations. With the opt-in &lt;code&gt;PoolRequestBundle&lt;/code&gt; flag, a one-parameter route resolves in 45 nanoseconds with zero allocations — a result MuxMaster claims makes it the only &lt;code&gt;net/http&lt;/code&gt;-compatible router to achieve zero allocations on parameterised routes.&lt;/p&gt;

&lt;p&gt;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 &lt;code&gt;httprouter&lt;/code&gt;, 212 ns for Fiber v3 (which runs on &lt;code&gt;fasthttp&lt;/code&gt;, not &lt;code&gt;net/http&lt;/code&gt;), 354 ns for chi v5, and roughly 3.4 milliseconds for &lt;code&gt;gorilla/mux&lt;/code&gt; — 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 &lt;code&gt;benchstat&lt;/code&gt; from ten two-second runs.&lt;/p&gt;

&lt;p&gt;For developers, the practical translation is straightforward: on a typical API with parameterised paths, MuxMaster claims a 20 percent edge over &lt;code&gt;httprouter&lt;/code&gt; while keeping the standard handler signature &lt;code&gt;httprouter&lt;/code&gt; requires you to abandon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trade-offs and contracts
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;PoolRequestBundle&lt;/code&gt; mode that delivers the headline numbers is opt-in for good reason. The router recycles per-request bundles through tiered &lt;code&gt;sync.Pool&lt;/code&gt;s, which imposes a strict lifetime contract on handler authors: the &lt;code&gt;*http.Request&lt;/code&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ergonomics
&lt;/h2&gt;

&lt;p&gt;Beyond raw speed, MuxMaster ships several quality-of-life features. An optional &lt;code&gt;HandlerFuncE&lt;/code&gt; signature threads errors through middleware chains, eliminating the boilerplate of writing errors to the response writer at every leaf. The &lt;code&gt;Params&lt;/code&gt; type exposes typed accessors — &lt;code&gt;Params.Int&lt;/code&gt;, &lt;code&gt;Params.Bool&lt;/code&gt;, &lt;code&gt;Params.UUID&lt;/code&gt; — that parse and validate path parameters in a single call, returning idiomatic Go errors when the input doesn’t conform.&lt;/p&gt;

&lt;p&gt;A minimal example from the project's landing page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"log"&lt;/span&gt;
    &lt;span class="s"&gt;"net/http"&lt;/span&gt;

    &lt;span class="s"&gt;"github.com/FlavioCFOliveira/MuxMaster"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;mux&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;muxmaster&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;mux&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GET&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/users/:id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;muxmaster&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ParamsFromContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"invalid id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StatusBadRequest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;muxmaster&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StatusOK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"id"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"write response: %v"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;":8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mux&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fatal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Dogfooding as proof
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements and availability
&lt;/h2&gt;

&lt;p&gt;MuxMaster requires Go 1.26 or later, a constraint set by the &lt;code&gt;go&lt;/code&gt; 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 &lt;code&gt;github.com/FlavioCFOliveira/MuxMaster&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>performance</category>
      <category>api</category>
    </item>
  </channel>
</rss>
