Benchmark test with most popular libs in Go. Test implements a GET method wrapper to delivery a common interface.
Ps.: You can enjoy to use the HTTP dependency inversion for your clean Architecture project.
- go version go1.18 darwin/amd64
- CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
- OS: Macos Monterey 12.3.1
- RAM: 16 GB 2667 MHz DDR4
If you want run the tests, basically you have to run:
$ make upand run the tests individually using:
$ make run-fiber #used to run fiber benchmark
$ make run-fasthttp # used to run fasthttp benchmark
$ make run-gin # used to run gin benchmark
$ make run-echo # used to run echo benchmark
$ make run-mux # used to run mux benchmark
$ make run-chi # used to run chi benchmarkPs.: All the benchmarks it was executed apart
| Lib | Qty Operations | Average time per operation | Average memory per operation |
|---|---|---|---|
| Fiber | 2347 | 477,48 ms/op | 16,42 KB/op |
| FastHTTP routing | 2218 | 530,2 ms/op | 16,45 KB/op |
| Gin | 2751 | 409,44 ms/op | 15,73 KB/op |
| Echo | 2660 | 431,43 ms/op | 15,73 KB/op |
| Mux | 2884 | 417,61 ms/op | 15,73 KB/op |
| Chi | 2560 | 406,07 ms/op | 15,73 KB/op |