Closed loiclec closed 1 year ago
Build succeeded:
Ho no! We should not merge new PRs on this main branch until we release v0.30.1 of Meilisearch and fix the current bugs! Should we revert this PR on main @curquiza?
No, it's ok, let is as it is. I will create a custom branch and I will cherry pick the commits on it.
Merge everything your need to merge on main
Pull Request
Related issue
Fixes (partially) https://github.com/meilisearch/meilisearch/issues/3115
What does this PR do?
Reduces the memory usage caused by the creation of a 10-word query tree by 20x. This is done by deduplicating the
MatchingWord
values, which are heavy because of their inner DFA. The deduplication works by wrapping eachMatchingWord
in a reference-counted box and using a hash map to determine whether aMatchingWord
DFA already exists for a certain signature, or whether a new one needs to be built.Avoid the worst-case scenario of creating a
MatchingWord
for extremely long words that cannot be indexed by milli.