Skip to content

docs(openspec): plan #2371 plan worker startup and import preload - #2986

Merged
dan-petty merged 1 commit into
mainfrom
perf/2371-measure-and-cut-what-each-of
Nov 1, 2026
Merged

dan-petty merged 1 commit into
mainfrom
perf/2371-measure-and-cut-what-each-of

Conversation

@devops-cli-service

Copy link
Copy Markdown
Contributor

Plans #2371

This change adds a session-scoped fixture in tests/conftest.py that imports the heavy modules (pydantic_ai, anthropic, kubernetes, textual) once per xdist worker. It removes the first-import cost from individual test durations. The full suite on 16 workers takes 287 s, but the tests account for only 151 s. The other 136 s is worker startup, repeated collection, and first-import costs. This fixture targets the import cost, which the issue identifies as the largest share that a single code change can remove. The measurement numbers are reported in the PR description from three runs on an idle host.

Change: openspec/changes/2371-measure-and-cut-what-each-of/

@devops-cli-service
devops-cli-service Bot marked this pull request as ready for review November 1, 2026 06:57
@dan-petty
dan-petty merged commit 022d784 into main Nov 1, 2026
18 checks passed
@dan-petty
dan-petty deleted the perf/2371-measure-and-cut-what-each-of branch November 1, 2026 10:20
dan-petty added a commit that referenced this pull request Nov 1, 2026
This pull request corrects the plan for #2371 in place. The Service
staged the plan in #2986. An evaluation of that pull request found
defects.

The old plan built a session fixture that imports the heavy modules once
per worker. Collection already imports `pydantic_ai`, `anthropic`,
`kubernetes` and `textual` in every worker. So the fixture did nothing.
A fixture also cannot lower the total CPU time, because it only moves an
import.

The corrected plan measures first. It splits the CPU time of each worker
over three runs and ranks the first imports. Then it applies the one
candidate with the largest share. It stops when no candidate reaches 5%.
It fixes the verify commands and adds stop rules for a runner pod and
for a large change.

The change touches only the change folder of #2371. It changes no code
and no test.

Plans #2371
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