Skip to content

perf(runner): build the provider map once per file, not twice#817

Merged
Chemaclass merged 1 commit into
mainfrom
perf/provider-map-single-build
Jul 16, 2026
Merged

perf(runner): build the provider map once per file, not twice#817
Chemaclass merged 1 commit into
mainfrom
perf/provider-map-single-build

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Last per-file redundancy from the fork census (#801-#815): the data-provider map was awk-scanned twice per test file — once in the header's test-counting $(...) subshell (whose cache dies with it) and again by the runner.

💡 Changes

  • Build the map in the counting loop's own shell before the per-file subshell; the header reads the total via a return slot instead of a $(...) capture, so the cache survives into the runner.
  • 3 → 2 awk forks per single-file run (all ~258 nested acceptance runs are single-file); multi-file runs unchanged except the last file. find_total_tests' stdout contract kept.
  • Fork-budget regression test tightened to the new budget.

The data-provider map was scanned by awk twice per test file: once inside the
header's test-counting subshell (whose single-entry cache died with it) and
again by the runner. The count loop now builds the map in its own shell before
entering the counting subshell, and the header reads the total through a
return slot instead of a $(...) capture — so the cache survives into the
runner, which hits it for single-file runs (the acceptance suite's ~258 nested
runs are all single-file). Multi-file runs keep today's behaviour for all but
the last file (single-entry cache).

3 -> 2 awk forks per single-file run; stdout contract of find_total_tests is
unchanged for existing callers/tests.
@Chemaclass Chemaclass added the enhancement New feature or request label Jul 16, 2026
@Chemaclass Chemaclass self-assigned this Jul 16, 2026
@Chemaclass
Chemaclass merged commit a3a670d into main Jul 16, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the perf/provider-map-single-build branch July 16, 2026 04:39
Chemaclass added a commit that referenced this pull request Jul 16, 2026
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.

1 participant