-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router benchmark #206
base: development
Are you sure you want to change the base?
Router benchmark #206
Conversation
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 |
新增不同 router 需要實作的程式碼行數, 詳見 readme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
行數我覺得不是重點,多個幾行是可以接受的,效能可能才是主要考量的點 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用 httprouter@latest 版本 5 allocs/op 會變成 0
👏 解決掉的 issue / Resolved Issues
📝 相關的 issue / Related Issues
⛏ 變更內容 / Details of Changes