-
Notifications
You must be signed in to change notification settings - Fork 265
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
perf: parallelize remapping to improve FTS compaction #2834
Conversation
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2834 +/- ##
==========================================
+ Coverage 77.99% 78.04% +0.05%
==========================================
Files 229 229
Lines 70192 70314 +122
Branches 70192 70314 +122
==========================================
+ Hits 54744 54878 +134
+ Misses 12376 12338 -38
- Partials 3072 3098 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
This seems like a good improvement. Did you setup any kind of benchmark that led you to the conclusion this needed to be sped up? It might be nice to have that benchmark checked in.
self.inverted_list.par_iter_mut().for_each_init( | ||
|| (Vec::new(), Vec::new(), Vec::new()), |
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.
I'm not sure there is any particular benefit to using for_each_init
(versus for_each
and declaring the new variables at the beginning of the closure) here since you are consuming the Vec
s at the end of the closure but there is no harm in it either.
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.
Yeah it doesn't benefit from this, did this because I was thinking I would clear the vectors then I can reuse them but finally took it...
Tested it on MS MARCO and before this the remap can't be finished in 35m (I didn't wait for finishing because that's too long), and now it's 3.15min