Page MenuHomePhabricator

[lib] Avoid constructing multiple duplicate tokenizers in SearchIndex
ClosedPublic

Authored by ashoat on Oct 27 2023, 11:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 10:04 PM
Unknown Object (File)
Fri, Nov 8, 10:04 PM
Unknown Object (File)
Fri, Nov 8, 10:01 PM
Unknown Object (File)
Tue, Nov 5, 2:13 AM
Unknown Object (File)
Oct 8 2024, 3:40 PM
Unknown Object (File)
Oct 5 2024, 6:23 AM
Unknown Object (File)
Oct 5 2024, 6:20 AM
Unknown Object (File)
Oct 5 2024, 4:47 AM
Subscribers

Details

Summary

This simple change improves the perf of useChatMentionSearchIndex by 45% in my local environment. Before this it takes an average of 1777.5ms, but after it takes an average of 978ms.

Linear task: ENG-5480

Test Plan

I used this patch to test performance before and after this change. I made sure I had at least three samples of each scenario. Will also link my messy Gist of results, but it's not really interpretable by anyone other than me.

Here's the relevant portion:

BEFORE

 LOG  useChatMentionSearchIndex took 1801ms
 LOG  useChatMentionSearchIndex took 1748ms
 LOG  useChatMentionSearchIndex took 1730ms
 LOG  useChatMentionSearchIndex took 1831ms

 AVERAGE 1777.5ms

JUST DEDUP
 
 LOG  useChatMentionSearchIndex took 1027ms
 LOG  useChatMentionSearchIndex took 949ms
 LOG  useChatMentionSearchIndex took 957ms
 
 AVERAGE 977.7ms

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable