Skip to content
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

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

Julian-Chu
Copy link
Contributor

@Julian-Chu Julian-Chu commented May 10, 2021

👏 解決掉的 issue / Resolved Issues

📝 相關的 issue / Related Issues

⛏ 變更內容 / Details of Changes

@Julian-Chu
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Copy link
Contributor

@SivWatt SivWatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@nickyanggg nickyanggg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y2468101216
Copy link
Collaborator

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

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants