pr: treat a page length of exactly 10 as omitting the header - #14045
Merged
Conversation
|
GNU testsuite comparison: |
Merging this PR will degrade performance by 4.01%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | du_summarize_balanced_tree[(5, 4, 10)] |
16.1 ms | 16.8 ms | -4.01% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing luantaraschi:fix/pr-page-length-10 (86618a2) with main (a5a7249)
Footnotes
-
50 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. ↩
pr --help states the rule twice, under -l and under -t: a page length of 10 or less implies -t. The comparison used a strict less-than, so a page length of exactly 10 kept the header and trailer and then subtracted them from the page, leaving no lines for content. With -h that printed empty pages, and with -t it printed nothing at all while still exiting 0. The variable already carried the intended rule in its name.
cakebaker
force-pushed
the
fix/pr-page-length-10
branch
from
August 21, 2026 12:29
01c736e to
86618a2
Compare
Contributor
|
Thanks for your PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pr --helpstates the rule twice, under-land under-t: a page length of10 or less implies
-t.prapplies it at< 10instead, so a page length ofexactly 10 keeps the header and the trailer and then subtracts them from the
page, leaving zero lines for content.
With three lines of input, against GNU coreutils 9.7:
pr -l 10 -h hdrpr -l 10 -tpr -l 10 -Tpr -l 9orpr -l 11The
-tcase drops the input on the floor and still exits 0.The variable already carries the intended rule in its name,
page_length_le_ht,so this is the comparison catching up with it.
Two differences at
-l 10are not part of this and are still there afterwards:-Femits a trailing form feed that GNU does not, and-2lays the columns outdifferently. Both reproduce without any
-lat all.Checked against GNU for page lengths 1, 2, 5, 9, 10, 11, 12, 20 and 66, with
-h,-t,-T,-n,-dand-m, on a 3 line and a 40 line input.