-
Notifications
You must be signed in to change notification settings - Fork 530
perf: use cpu pool to process all posting lists #5780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…g/optimize-write-postings
…g/optimize-write-postings
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
|
ACTION NEEDED The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
Code ReviewSummary: This PR optimizes inverted index building by processing posting lists on a CPU pool with a channel-based producer-consumer pattern instead of buffered async streams. P0/P1 IssuesP1: Missing error propagation from producer task In The current code does handle this correctly (error batches are still received and propagated via P1: Potential issue with In Minor Observations (not blocking)
Overall the approach looks sound for reducing contention. The channel-based pattern should indeed help by keeping CPU-bound work off the async runtime. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
| let docs_for_batches = docs.clone(); | ||
| let schema_for_batches = schema.clone(); | ||
|
|
||
| // let channel_capacity = get_num_compute_intensive_cpus().max(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
| where | ||
| F: FnMut(u32, u32) -> f32, | ||
| { | ||
| debug_assert!(length > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to provide more information about this assert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
…g/optimize-write-postings
less contention to improve indexing perf (+3%)