We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using named params (https://violetear.org/post/context-named/) the router uses 6 allocations, when not it uses 0.
$ make bench go test -run=^$ -bench=. 2017/10/05 21:57:31 Adding path: /hello [GET,HEAD] goos: darwin goarch: amd64 pkg: github.com/nbari/violetear BenchmarkRouterStatic-4 2017/10/05 21:57:31 Adding path: /hello [GET,HEAD] 2017/10/05 21:57:31 Adding path: /hello [GET,HEAD] 2017/10/05 21:57:31 Adding path: /hello [GET,HEAD] 2017/10/05 21:57:32 Adding path: /hello [GET,HEAD] 10000000 122 ns/op 0 B/op 0 allocs/op 2017/10/05 21:57:33 Adding path: /test/:word [GET,HEAD] BenchmarkRouterDynamic-4 2017/10/05 21:57:33 Adding path: /test/:word [GET,HEAD] 2017/10/05 21:57:33 Adding path: /test/:word [GET,HEAD] 2017/10/05 21:57:33 Adding path: /test/:word [GET,HEAD] 2017/10/05 21:57:34 Adding path: /test/:word [GET,HEAD] 2000000 913 ns/op 784 B/op 6 allocs/op PASS ok github.com/nbari/violetear 4.144s
Try to optimize the router to do allocs as little as possible.
The text was updated successfully, but these errors were encountered:
Currently using 0 allocs when using no context, using Name() automatically adds the route name to the context.
Name()
A slice could be used to reduce allocations instead of a map but the handlers will depend on GetParam and GetParams
GetParam
GetParams
tested but still the same like with the map, closing this for now
Sorry, something went wrong.
No branches or pull requests
When using named params (https://violetear.org/post/context-named/) the router uses 6 allocations, when not it uses 0.
Try to optimize the router to do allocs as little as possible.
The text was updated successfully, but these errors were encountered: