[performance] cache v2 filter keyword regular expressions (#2903)

* add caching of filterkeyword regular expressions

* formatting

* fix WholeWord nil check
This commit is contained in:
kim
2024-05-21 13:20:19 +00:00
committed by GitHub
parent 6c0d93c6cb
commit b092da6d28
5 changed files with 85 additions and 36 deletions

View File

@@ -531,6 +531,11 @@ func (c *Caches) initFilterKeyword() {
// See internal/db/bundb/filter.go.
filterKeyword2.Filter = nil
// We specifically DO NOT unset
// the regexp field here, as any
// regexp.Regexp instance is safe
// for concurrent access.
return filterKeyword2
}