Guides

Benchmark

Environment

  1. Go 1.6
  2. wrk 4.0.0
  3. AWS EC2 t2.micro with Ubuntu 14.04

Benchmarking with go-httprouting-benchmark

Test suite: github.com/julienschmidt/go-http-routing-benchmark

Benchmarkiterationtime/iterationbytes allocatedallocations
BenchmarkAce_GithubAll10000118334 ns/op13792 B/op167 allocs/op
BenchmarkBeego_GithubAll5000244428 ns/op0 B/op0 allocs/op
BenchmarkBone_GithubAll5002890918 ns/op548736 B/op7241 allocs/op
BenchmarkDenco_GithubAll10000111923 ns/op20224 B/op167 allocs/op
BenchmarkGin_GithubAll3000044235 ns/op0 B/op0 allocs/op
BenchmarkGocraftWeb_GithubAll5000615754 ns/op131656 B/op1686 allocs/op
BenchmarkGoji_GithubAll3000652552 ns/op56112 B/op334 allocs/op
BenchmarkGojiv2_GithubAll2000888854 ns/op118864 B/op3103 allocs/op
BenchmarkGoJsonRest_GithubAll3000628870 ns/op134371 B/op2737 allocs/op
BenchmarkGolf_GithubAll2000062703 ns/op0 B/op0 allocs/op
BenchmarkGoRestful_GithubAll10017627201 ns/op837832 B/op6913 allocs/op
BenchmarkGorillaMux_GithubAll2007464885 ns/op144464 B/op1588 allocs/op
BenchmarkHttpRouter_GithubAll2000074199 ns/op13792 B/op167 allocs/op
BenchmarkHttpTreeMux_GithubAll10000250904 ns/op65856 B/op671 allocs/op
BenchmarkKocha_GithubAll10000192759 ns/op23304 B/op843 allocs/op
BenchmarkLARS_GithubAll3000044416 ns/op0 B/op0 allocs/op
BenchmarkMacaron_GithubAll2000805238 ns/op201138 B/op1803 allocs/op
BenchmarkMartini_GithubAll2006722507 ns/op228214 B/op2483 allocs/op
BenchmarkPat_GithubAll3005079035 ns/op1499569 B/op27435 allocs/op
BenchmarkPossum_GithubAll10000309150 ns/op84448 B/op609 allocs/op
BenchmarkR2router_GithubAll10000278160 ns/op77328 B/op979 allocs/op
BenchmarkRevel_GithubAll10001668912 ns/op337424 B/op5512 allocs/op
BenchmarkTango_GithubAll3000514973 ns/op87076 B/op2267 allocs/op
BenchmarkTigerTonic_GithubAll20001215298 ns/op233680 B/op5035 allocs/op
BenchmarkTraffic_GithubAll2009580916 ns/op2659331 B/op21848 allocs/op
BenchmarkVulcan_GithubAll5000329675 ns/op19894 B/op609 allocs/op

Benchmarking with WRK

Test suite: github.com/vishr/web-framework-benchmark

Golf benchmark result

benchmarking golf...
Running 10s test @ http://localhost:8080/teams/x-men/members/wolverine
  2 threads and 20 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   154.78ms  210.75ms 788.98ms   79.55%
    Req/Sec    13.82k     8.23k   24.70k    45.91%
  234427 requests in 10.01s, 32.42MB read
Requests/sec:  23420.23
Transfer/sec:      3.24MB

benchmarking beego...
Running 10s test @ http://localhost:8080/teams/x-men/members/wolverine
  2 threads and 20 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   152.66ms  206.02ms 779.10ms   79.39%
    Req/Sec    13.67k     7.94k   21.94k    70.29%
  208864 requests in 10.01s, 28.88MB read
Requests/sec:  20856.08
Transfer/sec:      2.88MB

benchmarking echo/standard...
Running 10s test @ http://localhost:8080/teams/x-men/members/wolverine
  2 threads and 20 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   162.70ms  258.59ms   1.58s    85.34%
    Req/Sec    10.67k     5.79k   21.24k    59.47%
  207126 requests in 10.01s, 28.64MB read
Requests/sec:  20688.04
Transfer/sec:      2.86MB

benchmarking gin...
Running 10s test @ http://localhost:8080/teams/x-men/members/wolverine
  2 threads and 20 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   142.73ms  194.49ms 809.02ms   79.83%
    Req/Sec    10.85k     5.18k   22.25k    59.90%
  214791 requests in 10.01s, 29.70MB read
Requests/sec:  21465.80
Transfer/sec:      2.97MB

benchmarking goji...
Running 10s test @ http://localhost:8080/teams/x-men/members/wolverine
  2 threads and 20 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   178.54ms  295.77ms   1.83s    85.39%
    Req/Sec    10.55k     6.45k   22.74k    59.24%
  201138 requests in 10.08s, 27.81MB read
Requests/sec:  19963.71
Transfer/sec:      2.76MB

benchmarking martini...
Running 10s test @ http://localhost:8080/teams/x-men/members/wolverine
  2 threads and 20 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   119.61ms  165.13ms 689.59ms   80.80%
    Req/Sec     6.76k     3.78k   13.13k    57.71%
  125345 requests in 10.02s, 17.33MB read
Requests/sec:  12514.69
Transfer/sec:      1.73MB