Ptt-official-app / Ptt-backend

PTT APP 的後端
BSD 3-Clause "New" or "Revised" License
208 stars 68 forks source link

Router benchmark #206

Open Julian-Chu opened 3 years ago

Julian-Chu commented 3 years ago

👏 解決掉的 issue / Resolved Issues

📝 相關的 issue / Related Issues

⛏ 變更內容 / Details of Changes

Julian-Chu commented 3 years ago
goos: linux
goarch: amd64
pkg: github.com/Ptt-official-app/Ptt-backend/misc/router-benchmark
cpu: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Benchmark_ServeMux-7             3167156               374.2 ns/op            80 B/op          1 allocs/op
Benchmark_gorillamux-7            760047              1560 ns/op            1312 B/op         10 allocs/op
Benchmark_httprouter-7           3195236               371.7 ns/op           504 B/op          5 allocs/op
Julian-Chu commented 3 years ago

新增不同 router 需要實作的程式碼行數, 詳見 readme

y2468101216 commented 3 years ago

行數我覺得不是重點,多個幾行是可以接受的,效能可能才是主要考量的點