prometheus/storage
Jesus Vazquez 136956cca4
Attempt to append ooo sample at the end first (#11615)
This is an optimization on the existing append in OOOChunk.

What we've been doing so far is find the place inside the out-of-order
slice where the new sample should go in and then place it there and move
any samples to the right if necessary. This is OK but requires a binary
search every time the slice is bigger than 0.

The optimization is opinionated and suggests that although out-of-order
samples can be out-of-order amongst themselves they'll probably be in
order thus we can probably optimistically append at the end and if not
do the binary search.

OOOChunks are capped to 30 samples by default so this is a small
optimization but everything adds up, specially if you handle many active
timeseries with out-of-order samples.

Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
Signed-off-by: Jesus Vazquez <jesusvazquez@users.noreply.github.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-01-13 19:00:50 +05:30
..
remote Attempt to append ooo sample at the end first (#11615) 2023-01-13 19:00:50 +05:30
buffer.go federate: Fix PeekBack usage 2023-01-12 20:43:02 +05:30
buffer_test.go federate: Fix PeekBack usage 2023-01-12 20:43:02 +05:30
fanout.go Support FloatHistogram in TSDB (#11522) 2022-12-28 14:25:07 +05:30
fanout_test.go storage: allow re-use of iterators 2022-12-15 18:32:45 +00:00
generic.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
interface.go Support FloatHistogram in TSDB (#11522) 2022-12-28 14:25:07 +05:30
lazy.go
memoized_iterator.go Merge branch 'main' into sparsehistogram 2021-12-15 13:49:33 +01:00
memoized_iterator_test.go Merge 'main' into sparsehistogram 2022-10-05 22:14:49 +02:00
merge.go Update package storage for new labels.Labels type 2022-12-19 15:22:09 +00:00
merge_test.go storage: re-use iterators to save garbage 2022-12-15 18:32:45 +00:00
noop.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
secondary.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
series.go Support FloatHistogram in TSDB (#11522) 2022-12-28 14:25:07 +05:30
series_test.go Do no re-use result slice in chunkSetToSeriesSet 2022-12-18 21:18:55 +08:00