Page MenuHomePhabricator

[lib] Use RadixTree in SearchIndex
ClosedPublic

Authored by ashoat on Oct 27 2023, 11:32 AM.
Tags
None
Referenced Files
F3349000: D9627.diff
Fri, Nov 22, 4:43 PM
Unknown Object (File)
Wed, Nov 20, 7:51 PM
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 5 2024, 8:29 AM
Unknown Object (File)
Oct 5 2024, 6:26 AM
Subscribers

Details

Summary

This diff actually uses the RadixTree introduced in the parent diff from the SearchIndex code.

Linear tasks: ENG-5137 and ENG-5480

Depends on D9626

Test Plan
  1. I tested the chat mentions experience
  2. I did some perf testing:

In combination with the previous diff, 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 (parent diff)

 LOG  useChatMentionSearchIndex took 1027ms
 LOG  useChatMentionSearchIndex took 949ms
 LOG  useChatMentionSearchIndex took 957ms

 AVERAGE 977.7ms

DEDUP + RADIX TREE

 LOG  useChatMentionSearchIndex took 643ms
 LOG  useChatMentionSearchIndex took 629ms
 LOG  useChatMentionSearchIndex took 651ms
 LOG  useChatMentionSearchIndex took 609ms

 AVERAGE 633ms

JUST RADIX TREE

 LOG  useChatMentionSearchIndex took 1394ms
 LOG  useChatMentionSearchIndex took 1468ms
 LOG  useChatMentionSearchIndex took 1511ms
 LOG  useChatMentionSearchIndex took 1492ms
 LOG  useChatMentionSearchIndex took 1397ms

 AVERAGE 1452.4ms

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek added inline comments.
lib/shared/search-index.js
66

Can this be simplified?

This revision is now accepted and ready to land.Oct 30 2023, 4:13 AM
lib/shared/search-index.js
66

I tested this approach in the Chrome debug console and found that it didn't work:

Screenshot 2023-10-30 at 2.47.26 PM.png (592×1 px, 94 KB)

This revision was automatically updated to reflect the committed changes.
lib/shared/search-index.js
66

Ah, that makes sense. In order to make it work, we would need to bind the method which will be more complicated than the current solution.