Skip to content

Commit 35a4f54

Browse files
emmaling27Convex, Inc.
authored and
Convex, Inc.
committed
Add text segment cache for opened files (#27002)
This PR adds a `TextSegmentCache` for caching opened text segments. This should reduce the amount of time we spend opening the text indexes, which happens many times over the course of all the RPCs. I changed some of the `*_impl` methods to take in an `Arc<TextSegment>` instead of the segment reader and trackers it needs, so some of the fns have more than they need, but that should be fine since we should be loading everything in the second RPC and getting cache hits in subsequent RPCs for the same search query. We won't open the `TextSegment` on the first RPC (number of segments) because we don't pass the storage keys for all the trackers in, and it's probably not worth optimizing because `number_of_segments` is only needed when we are using single segment format. GitOrigin-RevId: 8f4166206a546a1e9a3130551dfff9e4559c28d9
1 parent 9e6084f commit 35a4f54

File tree

3 files changed

+471
-343
lines changed

3 files changed

+471
-343
lines changed

0 commit comments

Comments
 (0)