Fix jsonl read bottleneck - #164
Merged
Merged
Conversation
JojiiOfficial
force-pushed
the
fix-client-bottleneck-from-file
branch
2 times, most recently
from
August 13, 2026 15:43
3004399 to
82f56fe
Compare
generall
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Load dataset's queries at startup into memory, so they don't bottleneck during search.
I ran into this during my experiments despite using a fast nvme.
The Issue
Jsonl reader costs a full
File::openplus a fullserde_jsonparse for each query. On H&M dataset for example, queries are quite large ~45kb.Benches
bfb with
-p 12 -t 12Difference in real world benchmark (two runs, same server and search setup).
* qps x latency
Costs
Loading it at startup is expensive and can take a few seconds depending on disk.
For reference, H&M query set takes 850ms on my machine, but my storage is on the faster side.
I still think it's better to unconditionally (= not based on any configurations) fix this bottleneck so we can rely on measurements being correct.