We currently use a rather naive approach for prefix search, where we simply add each substring to a HashMap.
This diff introduces a new data structure optimized for prefix search: the radix tree.
After the improvements in the parent diff, this improve the perf of useChatMentionSearchIndex by 35%. Measuring from before the parent diff, the incremental improvement is about 19%. Combined with the parent diff, in total we're improving perf by 64%.
Linear tasks: ENG-5137 and ENG-5480
Depends on D9625