pr: stream simple layouts for non-file inputs#11244
Open
mattsu2020 wants to merge 4 commits intouutils:mainfrom
Open
pr: stream simple layouts for non-file inputs#11244mattsu2020 wants to merge 4 commits intouutils:mainfrom
mattsu2020 wants to merge 4 commits intouutils:mainfrom
Conversation
Contributor
|
the list of commits isn't ideal, could you please improve it? thanks |
Add a streaming code path for simple layouts so pipes and devices can be processed without buffering the full input in memory. Keep the import-only cleanup in the same commit to avoid review noise.
Tighten streaming mode selection for direct non-file inputs and align page trailer formatting with the existing buffered implementation. Update the regression test to exercise the supported char-device path.
Reject invalid UTF-8 incrementally in the streaming path, including truncated multibyte tails at EOF, and cover the failure mode with a FIFO-based regression test. Fold the spell-checker update into the same commit because it is introduced by the new test.
Avoid the streaming path for non-file inputs when the requested layout leaves zero printable content lines, and add FIFO-vs-file regressions for those edge cases. Keep the unix-only test import cleanup with the helper it belongs to.
|
GNU testsuite comparison: |
Merging this PR will improve performance by 3.64%
Performance Changes
Comparing Footnotes
|
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.
Summary
This PR adds a streaming path for simple
prlayouts when reading from non-file inputs such as FIFOs and character devices.The main goal is to avoid buffering the entire input in memory for cases where
prcan process the input line by line. This also makes inputs like/dev/zerostart producing output immediately instead of waiting for a full read.What changed
add a streaming implementation for simple
prlayoutsuse the streaming path for supported non-file inputs
align streaming output with the existing buffered behavior, including page trailer formatting
validate UTF-8 incrementally while streaming and report invalid input cleanly
fall back to the buffered path when the selected page layout leaves no printable content lines
add regression tests for:
related
pr /dev/zero [SIGPIPE|SIGKILL] #11139