Pruner's rebuildWhileLocked() calls memState.Iterate() while its MatchesForEvent() calls memState.Contains(). rebuildWhileLocked defends against itself with a mutex, but not against Contains.
Also, a recent PR switched memState from a map to a slice to retain the order, in order to preserve MatcherBuildMode semantics, but Containts now traverses the whole slice; since Contains is called from MatchesForEvent, its performance is now O(N) where N is the number of patterns added.
Pruner's
rebuildWhileLocked()callsmemState.Iterate()while itsMatchesForEvent()callsmemState.Contains().rebuildWhileLockeddefends against itself with a mutex, but not againstContains.Also, a recent PR switched
memStatefrom a map to a slice to retain the order, in order to preserveMatcherBuildModesemantics, butContaintsnow traverses the whole slice; sinceContainsis called fromMatchesForEvent, its performance is nowO(N)where N is the number of patterns added.