mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-06-19 08:43:27 +03:00
a.Subtract(b) perfomance degrades as b becomes bigger than a. For example if len(b2) == 10xlen(b1) then time(a.Subtract(b2)) == 10x time(a.Subtract(b1)). A quick fix is to iterate over a elements in len(b) > len(a). Iterating over a's elements and at the same time deleting should be safe since no elements are actually deleted (i.e. memory freed, etc). Deletion here means setting a corresponding bit from 1 to 0. Fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/9602