Skip to content

Commit aa6f67a

Browse files
committed
Add TODO about bucket search optimization
Signed-off-by: beorn7 <[email protected]>
1 parent 43f31c2 commit aa6f67a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

prometheus/histogram.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ import (
3131
// sparseBounds for the frac of observed values. Only relevant for schema > 0.
3232
// Position in the slice is the schema. (0 is never used, just here for
3333
// convenience of using the schema directly as the index.)
34+
//
35+
// TODO(beorn7): Currently, we do a binary search into these slices. There are
36+
// ways to turn it into a small number of simple array lookups. It probably only
37+
// matters for schema 5 and beyond, but should be investigated. See this comment
38+
// as a starting point:
39+
// https://github.com/open-telemetry/opentelemetry-specification/issues/1776#issuecomment-870164310
3440
var sparseBounds = [][]float64{
3541
// Schema "0":
3642
[]float64{0.5},

0 commit comments

Comments
 (0)