Skip to content

Optimize allocations on hot path

Mikhail Mazurskiy requested to merge ash2k/optimize-allocs into master
Expiring hash:
before
BenchmarkPrefixedInt64Key-10    	36368568	        32.25 ns/op	      24 B/op	       2 allocs/op

after
BenchmarkPrefixedInt64Key-10    	101835555	        11.48 ns/op	      16 B/op	       1 allocs/op

token limiter:
before:
BenchmarkBuildTokenLimiterKey-10    	14142152	        77.68 ns/op	      24 B/op	       2 allocs/op

after:
BenchmarkBuildTokenLimiterKey-10    	20539518	        54.61 ns/op	      16 B/op	       1 allocs/op

Merge request reports