Skip to content

perf(runner): reduce subprocess overhead in hot paths#621

Merged
Chemaclass merged 3 commits intomainfrom
perf/runner-optimizations
Apr 17, 2026
Merged

perf(runner): reduce subprocess overhead in hot paths#621
Chemaclass merged 3 commits intomainfrom
perf/runner-optimizations

Conversation

@Chemaclass
Copy link
Copy Markdown
Member

@Chemaclass Chemaclass commented Apr 17, 2026

Summary

  • Replace six echo | sed + one grep in parse_result_sync with bash parameter expansion (mirrors existing fast path in parse_result at src/runner.sh:714-727).
  • Replace fixed 50ms poll in wait_for_job_slot with stepped adaptive backoff (50ms → 100ms after 4 iterations → 200ms after 20) to cut jobs -r | wc -l churn on long parallel runs.
  • Collapse the two metachar grep checks in parse_data_provider_args into one (^|[^\])[|&;*] pattern.

All changes Bash 3.0+ compatible. No public API or behavior changes.

Screenshot 2026-04-18 at 00 16 08

…lt_sync

Drop six echo|sed subprocesses and one grep per sync test result parse
at src/runner.sh:971. Use bash parameter expansion (##*, %%##*) in a
single case branch, matching the pattern already used by the async path
at lines 714-727. Bash 3.0+ compatible.
Replace fixed 50ms poll with stepped backoff (50ms -> 100ms after 4
iterations -> 200ms after 20) in src/runner.sh:15. Long-running parallel
tests no longer spawn `jobs -r | wc -l` 20 times per second per wait;
short tests keep the original responsiveness. Bash 3.0+ compatible.
…rovider_args

Merge the leading-metachar and embedded-metachar grep calls at
src/runner.sh:263 into one `(^|[^\])[|&;*]` pattern. Saves one grep
subprocess per parametrized test invocation. Bash 3.0+ compatible.
@Chemaclass Chemaclass added the enhancement New feature or request label Apr 17, 2026
@Chemaclass Chemaclass self-assigned this Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ Contributor Report

User: @Chemaclass
Status: Trusted contributor (whitelisted)

This user is on the trusted contributors list and was automatically approved.

@Chemaclass Chemaclass merged commit a3837cf into main Apr 17, 2026
30 checks passed
@Chemaclass Chemaclass deleted the perf/runner-optimizations branch April 17, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants