Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
filters/tracing: improve stateBagToTag
* reduce allocations when tag value is string * check statebag value first to bail out early if it is absent * restrict max number of arguments to two ``` goos: linux goarch: amd64 pkg: github.com/zalando/skipper/filters/tracing cpu: Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz │ HEAD~1 │ HEAD │ │ sec/op │ sec/op vs base │ StateBagToTag_StringValue-8 313.1n ± 2% 124.3n ± 1% -60.29% (p=0.000 n=10) │ HEAD~1 │ HEAD │ │ B/op │ B/op vs base │ StateBagToTag_StringValue-8 19.00 ± 0% 0.00 ± 0% -100.00% (p=0.000 n=10) │ HEAD~1 │ HEAD │ │ allocs/op │ allocs/op vs base │ StateBagToTag_StringValue-8 2.000 ± 0% 0.000 ± 0% -100.00% (p=0.000 n=10) ``` Signed-off-by: Alexander Yastrebov <[email protected]>
- Loading branch information