prometheus/web
Arve Knudsen c65189cc44 tsdb/seriesmetadata: sorted-slice inverted index with copy-on-write
Replace map[uint64]struct{} inner maps in the resource attribute
inverted index with sorted []uint64 slices using copy-on-write
semantics. This reduces memory ~4x (8 bytes/entry vs ~50 bytes/entry
for hash map overhead) and eliminates snapshot copies on read.

sortedInsert/sortedRemove create new slices on mutation, so readers
holding old slices are safe from concurrent changes. LookupResourceAttr
returns the live slice directly (zero-copy).

The layered reader uses two-pointer sorted merge for union operations.
The web API uses two-pointer sorted intersection for filter intersection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2026-03-20 17:56:16 +01:00
..
api tsdb/seriesmetadata: sorted-slice inverted index with copy-on-write 2026-03-20 17:56:16 +01:00
ui feat: add OTel resource/scope attributes persistence per time series 2026-03-20 17:56:16 +01:00
federate.go Refactor parse.go into an instance-based Parser interface 2026-02-11 11:21:49 +01:00
federate_test.go chore: fix httpNoBody issues from gocritic 2026-03-02 20:06:30 +01:00
web.go feat: add OTel resource/scope attributes persistence per time series 2026-03-20 17:56:16 +01:00
web_test.go chore: fix httpNoBody issues from gocritic 2026-03-02 20:06:30 +01:00