alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

Remove duplicate slice during Silences query

Open ultrotter opened this issue 1 month ago • 0 comments

If there are a lot of silences Silences.query, for queries without
q.ids, first copies all their pointers to a slice, causing a lot of
allocations, and then does it again to a new shorter slice filtered by
the query. We avoid this by only adding to the result slice in case of a
match. This creates savings for each queries, scaling with the number of silences.

ultrotter avatar Nov 05 '25 17:11 ultrotter