-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve benchmark for ltrim #12513
Improve benchmark for ltrim #12513
Conversation
aa24474
to
8162cbc
Compare
8162cbc
to
a5625aa
Compare
@alamb @Kev1n8 The benchmark is ready, and the result in my local can see in #12395 (comment) |
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.
Thank you @Rachelint and @Kev1n8 -- looks good to me; I had one question, but I don't think there is anything that would prevent this PR from merging.
let lens = vec![remaining_len; size]; | ||
let string_iter = lens.into_iter().map(|len| { |
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 don't understand the use of vec!
here - isn't this the same as creating size
strings of lenght up to remaining_len
?
Maybe this could be somehthing like
let string_iter = (0..size).map(|len|{
?
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.
Yes, I want to create size
strings, and each one has remaining_len
lenght.
🤔 Maybe it is a bit confused, I have improved it and added some comments.
} | ||
} | ||
|
||
/// Create args for the ltrim benchmark |
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.
❤️
Co-authored-by: Andrew Lamb <[email protected]>
Thank you for the comments and benchmarks @Rachelint -- this PR now looks even better 🚀 |
Which issue does this PR close?
Part of #12387
Rationale for this change
We need a benchmark to see the improvements of the new string view trim introduced in #12395 .
What changes are included in this PR?
Improve the ltrim benchmark, so that we can use it to see the improvements of the new string view trim.
Are these changes tested?
Test manually.
Are there any user-facing changes?
No.