Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a tsm1 function for encoding a batch of timestamps into a provided buffer. The following benchmarks compare the performance of the existing iterator based encoders, and the new batch oriented encoders. They look at a sequential input slice, a randomly generated input slice and a duplicate slice. All slices are sorted. name old time/op new time/op delta EncodeTimestamps/10_seq 153ns ± 2% 104ns ± 2% -31.62% (p=0.000 n=9+10) EncodeTimestamps/10_ran 191ns ± 2% 142ns ± 0% -25.73% (p=0.000 n=10+9) EncodeTimestamps/10_dup 114ns ± 1% 68ns ± 4% -39.77% (p=0.000 n=8+10) EncodeTimestamps/100_seq 704ns ± 2% 321ns ± 2% -54.44% (p=0.000 n=9+9) EncodeTimestamps/100_ran 7.27µs ± 4% 7.01µs ± 2% -3.59% (p=0.000 n=10+10) EncodeTimestamps/100_dup 756ns ± 3% 396ns ± 2% -47.57% (p=0.000 n=10+10) EncodeTimestamps/1000_seq 6.32µs ± 1% 2.46µs ± 2% -61.01% (p=0.000 n=8+10) EncodeTimestamps/1000_ran 108µs ± 0% 68µs ± 3% -37.57% (p=0.000 n=8+10) EncodeTimestamps/1000_dup 7.26µs ± 1% 3.64µs ± 1% -49.80% (p=0.000 n=10+8) name old alloc/op new alloc/op delta EncodeTimestamps/10_seq 0.00B 0.00B ~ (all equal) EncodeTimestamps/10_ran 0.00B 0.00B ~ (all equal) EncodeTimestamps/10_dup 0.00B 0.00B ~ (all equal) EncodeTimestamps/100_seq 0.00B 0.00B ~ (all equal) EncodeTimestamps/100_ran 0.00B 0.00B ~ (all equal) EncodeTimestamps/100_dup 0.00B 0.00B ~ (all equal) EncodeTimestamps/1000_seq 0.00B 0.00B ~ (all equal) EncodeTimestamps/1000_ran 0.00B 0.00B ~ (all equal) EncodeTimestamps/1000_dup 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta EncodeTimestamps/10_seq 0.00 0.00 ~ (all equal) EncodeTimestamps/10_ran 0.00 0.00 ~ (all equal) EncodeTimestamps/10_dup 0.00 0.00 ~ (all equal) EncodeTimestamps/100_seq 0.00 0.00 ~ (all equal) EncodeTimestamps/100_ran 0.00 0.00 ~ (all equal) EncodeTimestamps/100_dup 0.00 0.00 ~ (all equal) EncodeTimestamps/1000_seq 0.00 0.00 ~ (all equal) EncodeTimestamps/1000_ran 0.00 0.00 ~ (all equal) EncodeTimestamps/1000_dup 0.00 0.00 ~ (all equal)
- Loading branch information