Skip to content

perf(core): schedule static mutants last to avoid transition reloads#6137

Open
lo1tuma wants to merge 1 commit into
stryker-mutator:masterfrom
lo1tuma:schedule-static-mutants-last
Open

perf(core): schedule static mutants last to avoid transition reloads#6137
lo1tuma wants to merge 1 commit into
stryker-mutator:masterfrom
lo1tuma:schedule-static-mutants-last

Conversation

@lo1tuma

@lo1tuma lo1tuma commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Static mutants force a test-runner environment reload (a full worker restart on mocha, jasmine, karma and tap). Today the run plans are sorted only within each buffered micro-batch, so static and non-static plans interleave across batches. Each interleaving forces an extra reload on the non-static mutant that happens to follow a static one, on top of the reload the static mutant itself needs.

This orders the whole run non-reload-first and reload (static) last instead of per batch, so static plans no longer interleave with the rest and nothing pays a transition reload. Non-static mutants still stream and overlap with the checker as before; only the static tail is deferred.

I found this with the experimental performance report from #6136, and the two PRs are independent (apply both to reproduce). Measured as a controlled back-to-back A/B on an idle machine on a large mocha + TypeScript project (same config, 2558 mutants run):

metric before after
environment reloads 818 508 (-38%)
total wall time 456.4s 429.6s (-5.9%)
mutation phase 414.1s 382.3s (-7.7%)

The reload-count reduction is deterministic (the transition reloads are eliminated, so the count now matches the static-mutant count). The wall-time figures are single-run and this suite is noisy, so treat them as directional; the win grows with the share of static mutants and is specific to full-restart runners (mocha, jasmine, karma, tap).

Static mutants force a test-runner environment reload. Plans were sorted only
within each buffered batch, so static and non-static plans interleaved and every
interleaving forced an extra reload on the non-static mutant that followed a
static one. Ordering the whole run non-reload-first and reload (static) last
removes those transition reloads, while non-static mutants still stream and
overlap with checking as before.

The effect is measurable with the experimental performance report (stryker-mutator#6136):
totals.reload drops toward the static-mutant count, which on static-heavy suites
using full-restart runners (mocha, jasmine, karma, tap) cuts wall time.
@lo1tuma
lo1tuma force-pushed the schedule-static-mutants-last branch from fec7026 to 40faa83 Compare July 17, 2026 13:37
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