Skip to content

leomirandadev/rest-libs-golang-bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BENCHMARK HTTP LIBS GO

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.

Libs selected:

Go Version:

  • go version go1.18 darwin/amd64

Setup

  • CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  • OS: Macos Monterey 12.3.1
  • RAM: 16 GB 2667 MHz DDR4

Execute Tests with Makefile

If you want run the tests, basically you have to run:

 $ make up

and 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 benchmark

RESULTS

Ps.: 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

About

Benchmark HTTP libraries in Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published