-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Implement BufWriter optimization for du stdout output (fixes #9… #9174
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 this PR will improve performance by 10.45%Comparing Summary
Performance Changes
Footnotes
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
c822fd6 to
97cf964
Compare
|
GNU testsuite comparison: |
97cf964 to
13e824e
Compare
|
GNU testsuite comparison: |
…tils#9146) - Add buffered writer to reduce system call overhead - Use correct binary unit notation (KiB) for buffer sizes - Apply buffering to total output as well - Fix clippy warnings in benchmark documentation This optimization significantly improves performance when du outputs many entries, reducing the number of stdout writes from per-entry to buffered chunks.
13e824e to
4715083
Compare
|
GNU testsuite comparison: |
Replace direct print! statements with 64KiB buffered writes to reduce syscall overhead for du -a on large directories. This addresses the performance issue where each file entry triggers multiple stdout writes.
Changes:
Performance: Reduces syscalls from ~16,500 to ~3-5 for 5,500 file directories, providing significant improvement for the issue #9146 use case.
Re-open: #9163