Skip to content

Add buffered printing and lock output stream to tsort#12733

Merged
sylvestre merged 2 commits into
uutils:mainfrom
mrkalling:martink
Jun 14, 2026
Merged

Add buffered printing and lock output stream to tsort#12733
sylvestre merged 2 commits into
uutils:mainfrom
mrkalling:martink

Conversation

@mrkalling

Copy link
Copy Markdown
Contributor

This pull request adds buffered output and locks stdout during printing to improve performance. As a side effect, tsort no longer panics when printing to stdout fails.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/misc/io-errors (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/retry (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/dd/no-allocate is now passing!
Congrats! The gnu test tests/pr/bounded-memory is now passing!

@codspeed-hq

codspeed-hq Bot commented Jun 9, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 12.07%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
✅ 319 untouched benchmarks
⏩ 46 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation tsort_tree_dag[(10, 3)] 29.1 ms 25.3 ms +15.16%
Simulation tsort_wide_dag[100000] 115.9 ms 102.4 ms +13.23%
Simulation tsort_linear_chain[1000000] 1.4 s 1.3 s +10.34%
Simulation tsort_complex_dag[50000] 73.2 ms 66.8 ms +9.65%

Tip

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


Comparing mrkalling:martink (78b6f7e) with main (8243543)

Open in CodSpeed

Footnotes

  1. 46 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.

@mrkalling mrkalling force-pushed the martink branch 3 times, most recently from 8a09e7a to b3dfbf3 Compare June 10, 2026 06:12
@sylvestre

Copy link
Copy Markdown
Contributor

please ping instead of doing rebase, it isn't helpful :(

@sylvestre sylvestre merged commit 844a21a into uutils:main Jun 14, 2026
175 checks passed
killuazoldyck680 pushed a commit to killuazoldyck680/coreutils that referenced this pull request Jun 17, 2026
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.

2 participants