Skip to content

pr: size the header from the page width with -J and -w too - #16658

Open
binhvq wants to merge 2 commits into
uutils:mainfrom
binhvq:pr-join-lines-header-width
Open

binhvq wants to merge 2 commits into
uutils:mainfrom
binhvq:pr-join-lines-header-width

Conversation

@binhvq

@binhvq binhvq commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Closes #16657

The header was centred in 72 columns whenever -J was given, and when the width came from -w without columns. It now uses the page width in those cases as well, as pr -W N already did.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 155.48 MB (+100 KB, +0.06%)

Significant per-binary changes:
  env     1.20 MB ->    1.28 MB  (+80 KB, +6.51%)

Comment thread src/uu/pr/src/pr.rs Outdated
};

// The header is laid out on the page width, which -J leaves alone.
let header_width = matches

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-W is already parsed and validated above for page_width, could we reuse that instead of parsing it again here?
for example, parse it once before the -J check and use it for both

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, it is parsed once before the -J check and used for both. This also makes pr -J -W x fail like without -J, as GNU does; added a case for it.

@codspeed

codspeed Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 8.09%

3 warnings, 1 note

⚠️ 119 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚠️ 3 benchmarks with a significant change ran in a different software environment

Their base and head results were measured with a different OS or toolchain, such as compiler, runtime or library versions, so the changes might come from this difference rather than from the code. Open an affected benchmark to see what changed.

See affected benchmarks

ℹ️ 1 benchmark has no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

⚡ 3 improved benchmarks
✅ 410 untouched benchmarks
⏩ 70 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ CPU Simulation false_consecutive_calls 350.2 ns 294.7 ns +18.85%
⚡ CPU Simulation dd_copy_with_skip 4.9 ms 4.8 ms +3.1%
⚡ CPU Simulation dd_copy_with_seek 5 ms 4.9 ms +3.05%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing binhvq:pr-join-lines-header-width (3f0bbbf) with main (e1b90fa)2

Open in CodSpeed

Footnotes

  1. 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (ff000c2) during the generation of this report, so e1b90fa was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@sylvestre
sylvestre force-pushed the pr-join-lines-header-width branch from 3f0bbbf to 5ef271c Compare November 21, 2026 15:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pr: the header ignores the page width with -J, and with -w

2 participants