go-graphite / carbon-clickhouse

Graphite metrics receiver with ClickHouse as storage
MIT License
186 stars 47 forks source link

uploader: preallocate buffer for reverse index name #75

Closed msaf1980 closed 3 years ago

msaf1980 commented 3 years ago

Reduce allocations in index uploader (preallocated buffer for reverse name)

BenchmarkReverseBytes-6         21052972            55.5 ns/op        32 B/op          1 allocs/op
BenchmarkReverseBytesTo-6       33742006            35.4 ns/op         0 B/op          0 allocs/op
Felixoid commented 3 years ago

Hey, Michail. Can you, please, rebase the code and resolve the conflict?

Felixoid commented 3 years ago

Thanks a lot! Hopefully, you don't mind that I moved the declaration of reverseName lower, to the usage?

msaf1980 commented 3 years ago

Thanks a lot! Hopefully, you don't mind that I moved the declaration of reverseName lower, to the usage?

Yes, it's a better.