Skip to content

Trim fixed per-scenario overhead #388

Open

Description

@schlessera

A few fixed costs are paid by every scenario, or by every scenario of a kind, without contributing to what is tested:

  1. Removing the scenario's RUN_DIR (about 3,800 files for a WordPress install) blocks the next scenario for about 50 ms. It can happen in the background once the directory is moved out of the way.
  2. Starting a background process (I launch in the background, the PHP built-in web server) always waits a full second before checking that the process is alive, even when it is ready much sooner.

Across all bundled commands, this adds up to roughly 2 to 3 minutes for each CI configuration.

Measuring: take the baseline from #384, then open a draft PR, run the same CI jobs against it and record both results here before we decide.

Activity

  1. schlessera commented on Oct 30, 2026

    @schlessera
    MemberAuthor

    Measurement

    Measured on GitHub Actions with the full test matrix of core-command and cache-command, run on measure/* branches of wp-cli/core-command#350 and wp-cli/cache-command#137. All runs use wp-cli-tests at the same base commit (9298472) and differ only in the changes of #403.

    The metric is the Behat wall time of each job, from the start of the Behat step to its last summary, for the 49 Linux jobs present in all runs. "Total" is the sum over these jobs, "per job" the median of each job's change against the mean of the two baseline runs. Both baselines run the identical code, so their spread is the noise level: about ±1% for cache-command and about ±5% for core-command. All runs executed the same scenarios (about 4,518 for core-command and 1,162 for cache-command across the Linux jobs).

    core-command total core-command per job cache-command total cache-command per job
    Baseline A 13,585 s -5.4% 4,943 s -0.3%
    Baseline B 14,644 s +5.4% 5,062 s +0.3%
    #403 12,654 s -10.6% 4,807 s -3.4%

    Both packages got faster, by about 10% for core-command and about 3 to 4% for cache-command, beyond the noise of both. The one failed job in the core-command run is the Windows job, where Chocolatey timed out installing Ghostscript before any scenario ran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions