Repository navigation
Conversation
Merging this PR will degrade performance by 7.31%3 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
|
Can we avoid large performance drop? |
|
GNU testsuite comparison: |
|
@oech3 The perf drop is fixed in 0a02252, it only flushes when stdin is a pipe/tty now. CodSpeed shows expand_many_lines +9% and expand_custom_tabstops +6.5% faster. The factor regression looks unrelated since this PR doesn't touch factor. Also enabled rustix for all unix targets so it builds on macOS/BSD. |
c3320a9 to
f834a30
Compare
5793fb6 to
7f48ca8
Compare
|
sorry but it needs to be rebased, and a bunch of jobs are failing |
7f48ca8 to
84c4f58
Compare
|
Rebased onto current main. I'll keep an eye on CI and fix anything related. |
84c4f58 to
3c27381
Compare
b54db61 to
efc5f67
Compare
|
Binary size comparison: |
efc5f67 to
635bb72
Compare
635bb72 to
9e964ef
Compare
|
Rebased onto current main again to resolve the conflict with 293a724 ("expand: accept a zero +N or /N after a tab list") in |
When reading line-at-a-time from stdin, BufWriter only flushed on exit, so an interactive session showed no converted output until the user quit. Match cut by skipping BufWriter when stdout is a terminal, and on the buffered path flush once per input chunk that completed a line, so piped line-at-a-time producers also see prompt output without a write per line on large inputs. Fixes uutils#11091
Keep the plain BufWriter<Stdout> path and flush before the next read only when the input is stdin and stdin is not a regular file. File arguments and redirected regular files are fully buffered again, avoiding the slowdown.
Qualify Stdio in the tty flush tests so the import block matches main and the PR can merge without conflicting on use-lines.
9e964ef to
759ad17
Compare
When stdin is read line-at-a-time (interactive terminal, or any producer that pauses between lines),
expand/unexpandheld converted output in aBufWriterand only flushed on exit. An interactive session therefore showed no converted line until the user quit, while GNU shows each line immediately.Like
cut, skipBufWriterwhen stdout is a terminal. On the buffered path, flush once per input chunk that completed a line (before the next read), so line-at-a-time pipes also see output promptly without a write per line on large inputs.Added
test_stdin_tty_flushes_each_linetotest_expand.rsandtest_unexpand.rs.Closes #11091