Skip to content

dxvgef/tsing-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tsing-benchmark

包含以下框架的路由基准测试

  • github.com/dimfeld/httptreemux/v5
  • github.com/dxvgef/tsing
  • github.com/dxvgef/tsing/v2
  • github.com/gin-gonic/gin
  • github.com/julienschmidt/httprouter
  • github.com/labstack/echo/v4

同时测试了启用和禁用recover的两种情况

测试方法:

go test -bench=. -benchmem

测试结果

Benchmark_TsingV2-8                        54105             22044 ns/op               0 B/op          0 allocs/op
Benchmark_TsingV2_Recover-8                52628             22598 ns/op               0 B/op          0 allocs/op
Benchmark_TsingV1-8                        49255             24296 ns/op               0 B/op          0 allocs/op
Benchmark_TsingV1_Recover-8                46572             25695 ns/op               0 B/op          0 allocs/op
Benchmark_Httprouter-8                     49857             24132 ns/op           13792 B/op        167 allocs/op
Benchmark_Httprouter_Recover-8             47798             25204 ns/op           13792 B/op        167 allocs/op
Benchmark_Gin-8                            47607             25081 ns/op               0 B/op          0 allocs/op
Benchmark_Gin_Recover-8                    44802             26734 ns/op               0 B/op          0 allocs/op
Benchmark_Echo-8                           40962             29229 ns/op               0 B/op          0 allocs/op
Benchmark_Echo_Recover-8                   28910             41223 ns/op           12998 B/op        203 allocs/op
Benchmark_HTTPTreemux-8                    15152             78979 ns/op           65857 B/op        671 allocs/op

About

tsing,echo,gin,chi等框架的基准测试代码

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages