-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
nl: output number separator as bytes #9601
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
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #9601 will improve performances by 66.23%Comparing Summary
Benchmarks breakdown
Footnotes
|
|
GNU testsuite comparison: |
d8bdce0 to
aea0985
Compare
|
GNU testsuite comparison: |
not as lossy string
aea0985 to
db52eac
Compare
|
GNU testsuite comparison: |
|
I was hoping we could create a macro that is similar to the new_ucmd that allows us to validate using the args and and then make sure that the stderr, stdout and error code match with the GNU implementation, I believe that would have highlighted this issue earlier right? |
| writeln!( | ||
| writer, | ||
| "{}{}{}", | ||
| let mut buf = Vec::with_capacity( |
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.
Amazing performance improvement, we should look for more changes like this in the codebase. For anyone looking in the future for more perf improvements its now at the point that a big percentage of the time is spent freeing the vec, and if you do .clear it actually just sets the len to 0 so that you can just use the same buffer in the loop and add more capacity if needed by checking buf.capacity().
Currently, we output the number separator as a lossy string:
Whereas GNU
nldoesn't:This PR fixes the issue.
Update: The PR also fixes the same issue for the content. Our current output:
The output of GNU
nl: