зеркало из https://github.com/github/vitess-gh.git
f7bbee3f9a
The form &(*first) was being used, which doesn't actually make a copy. Also got rid of some unnecessary allocations elsewhere in key.go. Before: ``` BenchmarkUint64KeyBytes-12 1000000 1364 ns/op 720 B/op 15 allocs/op BenchmarkUint64KeyString-12 1000000 1778 ns/op 800 B/op 20 allocs/op BenchmarkKeyRangeContains-12 20000000 105 ns/op 0 B/op 0 allocs/op BenchmarkKeyRangesIntersect-12 100000000 22.8 ns/op 0 B/op 0 allocs/op BenchmarkKeyRangesOverlap-12 30000000 44.4 ns/op 0 B/op 0 allocs/op ``` After: ``` BenchmarkUint64KeyBytes-12 50000000 25.0 ns/op 0 B/op 0 allocs/op BenchmarkUint64KeyString-12 10000000 121 ns/op 0 B/op 0 allocs/op BenchmarkKeyRangeContains-12 20000000 69.8 ns/op 0 B/op 0 allocs/op BenchmarkKeyRangesIntersect-12 100000000 14.3 ns/op 0 B/op 0 allocs/op BenchmarkKeyRangesOverlap-12 20000000 105 ns/op 48 B/op 1 allocs/op ``` |
||
---|---|---|
.. | ||
key.go | ||
key_test.go |