Skip to content

Commit

Permalink
Merge pull request prometheus#15456 from bboreham/remove-rw-intern
Browse files Browse the repository at this point in the history
[PERF] RW: Remove interning hook
  • Loading branch information
bboreham authored Nov 26, 2024
2 parents b9dd95f + fd4797d commit 634afbc
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions storage/remote/queue_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,6 @@ func (t *QueueManager) Stop() {
if t.mcfg.Send {
t.metadataWatcher.Stop()
}

// On shutdown, release the strings in the labels from the intern pool.
t.seriesMtx.Lock()
for _, labels := range t.seriesLabels {
t.releaseLabels(labels)
}
t.seriesMtx.Unlock()
t.metrics.unregister()
}

Expand All @@ -985,14 +978,6 @@ func (t *QueueManager) StoreSeries(series []record.RefSeries, index int) {
continue
}
lbls := t.builder.Labels()
t.internLabels(lbls)

// We should not ever be replacing a series labels in the map, but just
// in case we do we need to ensure we do not leak the replaced interned
// strings.
if orig, ok := t.seriesLabels[s.Ref]; ok {
t.releaseLabels(orig)
}
t.seriesLabels[s.Ref] = lbls
}
}
Expand Down Expand Up @@ -1037,7 +1022,6 @@ func (t *QueueManager) SeriesReset(index int) {
for k, v := range t.seriesSegmentIndexes {
if v < index {
delete(t.seriesSegmentIndexes, k)
t.releaseLabels(t.seriesLabels[k])
delete(t.seriesLabels, k)
delete(t.seriesMetadata, k)
delete(t.droppedSeries, k)
Expand All @@ -1059,14 +1043,6 @@ func (t *QueueManager) client() WriteClient {
return t.storeClient
}

func (t *QueueManager) internLabels(lbls labels.Labels) {
lbls.InternStrings(t.interner.intern)
}

func (t *QueueManager) releaseLabels(ls labels.Labels) {
ls.ReleaseStrings(t.interner.release)
}

// processExternalLabels merges externalLabels into b. If b contains
// a label in externalLabels, the value in b wins.
func processExternalLabels(b *labels.Builder, externalLabels []labels.Label) {
Expand Down

0 comments on commit 634afbc

Please sign in to comment.