LogoPly

Comparison

How Ply compares with Gin, Echo, Fiber and net/http

Framework Comparison

Ply is a thin layer over fasthttp. That single sentence explains most of its performance profile: it inherits fasthttp's throughput and keeps the layer on top as small as possible, while adding zero-allocation routing and a set of built-in engines.

It does not claim to be the fastest framework in every benchmark. The honest summary is:

  • throughput at fasthttp parity: within 3% of fasthttp and within 2% of Fiber v2/v3 in the thread-matched run, and in the same band at oversubscribed concurrency.
  • the thinnest framework layer we measured: in-process, Ply is within 4% of a bare path-plus-switch handler and about 37% cheaper than Fiber.
  • features that other frameworks expect you to assemble from plugins.

Architecture

PlyGinEchoFiber v2/v3net/http
HTTP enginefasthttpnet/httpnet/httpfasthttpnet/http
Route dispatchcompiled switch + radix fallbackradix treeradix treeradix treeServeMux
Path params per matched route0 allocations (inline slots)not measured herenot measured herenot measured heren/a
Response/request contextpooled, zero-copypooledpooledpooledper-request
Built-in queue, pub/sub, cacheyesnononono
Test without opening a portapp.Testhttptesthttptestapp.Testhttptest
Middleware, groups, templates, validationyesyesyesyespartial

Measured throughput

GET /user/42, 6C/12T laptop, wrk on the same host, round-robin reps, median of 3 (full method and spread on the benchmarks page):

Frameworkc=200, t=6c=512, t=12
fasthttp453,821462,022
Ply442,483450,054
Fiber v2446,904453,277
Fiber v3439,446441,530
net/http285,608296,132
Chi263,415275,713
Gin264,289275,065
Echo256,752270,836

Two things are structural and repeat across runs:

  1. Everything built on fasthttp is roughly 1.6x faster than net/http, Gin, Chi and Echo under load.
  2. Ply and Fiber sit within a few percent of each other. At oversubscribed concurrency the spread reaches ±15%, which is larger than the difference between them, so we do not claim a win there.

Measured overhead

In-process (no sockets, no syscalls), invoking each framework as a fasthttp.RequestHandler with a reused context, median of 3 runs:

Casens/request
bare fasthttp, path + switch173
Ply, param route180
Fiber v2287
Fiber v3305

Ply's router, context pool, middleware chain and recovery together cost about 7 ns more than the hand-written baseline, i.e. nothing measurable at network scale. That is the property we optimize for: the framework should be invisible.

When to choose what

  • Ply: you want fasthttp-level performance without dropping to raw fasthttp, plus built-in queue, pub/sub and cache engines, zero-allocation params and an in-process test helper.
  • Fiber: you want the largest ecosystem and community around a fasthttp-based framework.
  • Gin / Echo / Chi: you want the standard net/http ecosystem (http.Handler interop, httptest, third-party middleware) more than raw throughput.
  • Raw fasthttp: you want the maximum possible throughput and are happy to write routing and context plumbing yourself.

If you need net/http middleware compatibility, none of the fasthttp-based frameworks will fit perfectly; that is an engine-level trade-off, not a routing one.