Repository navigation
docs(openspec): plan #2371 plan worker startup and import preload - #2986
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/