-
Notifications
You must be signed in to change notification settings - Fork 853
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
use exponential search to speed up lexico partition #585
Conversation
Codecov Report
@@ Coverage Diff @@
## master #585 +/- ##
=======================================
Coverage 82.46% 82.46%
=======================================
Files 167 167
Lines 46205 46213 +8
=======================================
+ Hits 38101 38108 +7
- Misses 8104 8105 +1
Continue to review full report at Codecov.
|
cafcac6
to
91187ed
Compare
91187ed
to
d60557c
Compare
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.
Look like a good idea to me. I read the article and read the code carefully and I think it looks good.
Thanks @jimexist
// note here we have right = min(indices.len(), bound + 1) because indices[bound] might | ||
// actually be considered and must be included. | ||
(bound / 2) | ||
+ indices[(bound / 2)..indices.len().min(bound + 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.
I wonder if some of the performance improvement also comes from potentially making a smaller sequence -- aka (bound/2) .. len
rather than partition_point .. len
.
) Co-authored-by: Jiayu Liu <[email protected]>
Which issue does this PR close?
Closes #586
Rationale for this change
benchmark:
What changes are included in this PR?
adopting an exponential search
Are there any user-facing changes?