Skip to content

Fix: wait_or_timeout process wait wont have 100 ms latency#11650

Closed
cerdelen wants to merge 1 commit into
uutils:mainfrom
cerdelen:wait_or_timeout_early_return
Closed

Fix: wait_or_timeout process wait wont have 100 ms latency#11650
cerdelen wants to merge 1 commit into
uutils:mainfrom
cerdelen:wait_or_timeout_early_return

Conversation

@cerdelen
Copy link
Copy Markdown
Contributor

@cerdelen cerdelen commented Apr 5, 2026

Removes sleep mentioned in #11615 for a timeouted recv on the pipe. Also removes the latency mentioned in #9099 for when the child process finishes (still needs to loop to check the Atomic bool signaled)

following is a hyprfine showing the new version vs the old version

hyperfine --runs 100 './old_timeout  0.01 echo .' './new_timeout  0.01 echo .'
Benchmark 1: ./old_timeout  0.01 echo .
  Time (mean ± σ):     119.3 ms ±   2.6 ms    [User: 5.9 ms, System: 7.1 ms]
  Range (min … max):   110.7 ms … 122.5 ms    100 runs

Benchmark 2: ./new_timeout  0.01 echo .
  Time (mean ± σ):       3.1 ms ±   1.3 ms    [User: 1.3 ms, System: 1.4 ms]
  Range (min … max):     2.7 ms …  15.4 ms    100 runs

  Warning: Command took less than 5 ms to complete. Note that the results might be inaccurate because hyperfine can not calibrate the shell startup time much more precise than this limit. You can try to use the `-N`/`--shell=none` option to disable the shell completely.
  Warning: The first benchmarking run for this command was significantly slower than the rest (15.4 ms). This could be caused by (filesystem) caches that were not filled until after the first run. You should consider using the '--warmup' option to fill those caches before the actual benchmark. Alternatively, use the '--prepare' option to clear the caches before each timing run.

Summary
  ./new_timeout  0.01 echo . ran
   38.11 ± 15.82 times faster than ./old_timeout  0.01 echo .

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

GNU testsuite comparison:

GNU test failed: tests/misc/yes. tests/misc/yes is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 5, 2026

Merging this PR will degrade performance by 22.08%

❌ 2 regressed benchmarks
✅ 307 untouched benchmarks
⏩ 46 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation timeout_enforced 91.1 µs 116.9 µs -22.08%
Simulation timeout_quick_exit 197.6 µs 226 µs -12.55%

Comparing cerdelen:wait_or_timeout_early_return (fe8d625) with main (12cdba2)

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.

@sylvestre
Copy link
Copy Markdown
Contributor

a bunch of jobs are failing, sorry

@cerdelen cerdelen closed this Apr 6, 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