Skip to content

Add buffered printing and lock output stream to tsort#12733

Open
mrkalling wants to merge 1 commit into
uutils:mainfrom
mrkalling:martink
Open

Add buffered printing and lock output stream to tsort#12733
mrkalling wants to merge 1 commit into
uutils:mainfrom
mrkalling:martink

Conversation

@mrkalling

Copy link
Copy Markdown

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/pipe-f (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/expand/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 10.15%

⚡ 6 improved benchmarks
✅ 303 untouched benchmarks
⏩ 60 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation tsort_tree_dag[(10, 3)] 29.1 ms 25.3 ms +15.23%
Simulation tsort_wide_dag[100000] 116 ms 102.4 ms +13.28%
Simulation tsort_linear_chain[1000000] 1.4 s 1.3 s +10.38%
Simulation tsort_complex_dag[50000] 73.3 ms 66.8 ms +9.69%
Memory cp_recursive_deep_tree[(120, 4)] 615.6 KB 562.5 KB +9.44%
Simulation single_date_now 85.6 µs 82.9 µs +3.24%

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 (b3dfbf3) with main (82ff021)

Open in CodSpeed

Footnotes

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

1 participant