-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
seq: Buffer writes to stdout #7485
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
GNU testsuite comparison:
|
please add this bench in https://github.com/uutils/coreutils/blob/main/src/uu/seq/BENCHMARKING.md |
Sure, done. I also stole some of the content I had written for #7458 (will rebase that MR on top of this one, I assume this one will be merged first). |
src/uu/seq/BENCHMARKING.md
Outdated
by about 2 times for a floating point increment test case, leading to similar | ||
performance compared with GNU `seq`: | ||
```shell | ||
taskset -c 0 hyperfine -L seq seq,./seq-main,target/release/seq "{seq} 0 0.1 100000" |
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 think we need to document the results
just the commands
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.
Dropped.
I saw some results in some other BENCHMARKING.md
so I just put them there... Might be nice to codify what's expected in those documentation files (maybe in CONTRIBUTING.md
?). Not a big deal.
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.
sure, don't hesitate to make a proposition :)
GNU testsuite comparison:
|
Use a BufWriter to wrap stdout: reduces the numbers of system calls, improves performance drastically (2x in some cases). Also document use cases in src/uu/seq/BENCHMARKING.md, and the optimization we have just done here.
GNU testsuite comparison:
|
Use a BufWriter to wrap stdout: reduces the numbers of system calls, improves performance drastically (2x in some cases).
Fixes part of #7482, see this comment: #7482 (comment)
Thanks @mjguzik!
For floating point prints, we are now faster than GNU: