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)
Thu, Jul 4, 11:39 AM
Unknown Object (File)
Thu, Jul 4, 8:11 AM
Unknown Object (File)
Wed, Jul 3, 3:17 PM
Unknown Object (File)
Sun, Jun 30, 1:06 AM
Unknown Object (File)
Mon, Jun 24, 2:54 AM
Unknown Object (File)
Mon, Jun 24, 2:54 AM
Unknown Object (File)
Mon, Jun 24, 2:53 AM
Unknown Object (File)
Mon, Jun 24, 2:33 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