Repository navigation
perf(tests): parse the source trees once per worker - #4850
Conversation
MeasurementsAll local numbers come from the devcontainer while other agent workflows ran. The load average was 25 to 80 on 16 CPUs, so wall times are not stable. The "before" checkout is Census of the parse sites (acceptance 1)An ast-grep rule finds an
I read the files where a helper does the parse ( The 4 heaviest files (acceptance 2)Command:
Round 2: the mean goes from 229.0 s to 164.6 s (-28%). One process (
Not verified: the target of 15 s or less (from 26.5 s). This host could not give a stable absolute time. If the -28% holds on a calm host, 26.5 s becomes about 19 s. These costs stay after the change, and they are not raw parses of test files:
CIBefore: Steps for a personNone. This change touches no cluster and no repository setting. |
🤖 I have created a release *beep* *boop* --- ## [0.114.1](v0.114.0...v0.114.1) (2026-11-11) ### Performance Improvements * **tests:** parse the source trees once per worker ([#4850](#4850)) ([7a163a7](7a163a7)) ### Code Refactoring * **roadmap:** the package declares the workflow labels ([#4818](#4818)) ([89926ff](89926ff)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
CI job times (Actions API)Seconds from
The issue estimates a saving of 20 to 30 s of worker time in each run. That is smaller than the spread between runs (908 to 990 s), so the job times neither prove nor refute it. The local measurements in the comment above show the change of the 4 heaviest files. All 17 checks passed. |
Review findings after the mergeThis pull request is merged, so each finding goes to a new issue. Nothing in this pull request changes.
|
The requirement "Every caller imports a roadmap module by its path" names the test `test_every_import_of_a_roadmap_module_names_a_module_that_exists`. #4850 deleted that test, and its change set `skip_specs: true`, so the spec still names a check that no longer runs (#4882). Closes #4882 Change: `openspec/changes/archive/2026-11-14-4882-layout-spec/`
Test modules that walk
src/ortests/now read the per-process parse cache oftests/support/trees.py: theparsed_source_treesfixture for a walk of all ofsrc/, andparse_python_filefor a smaller walk. Before, each test parsed its files again, and three telemetry checks parsed the 799 files ofsrc/each time. The telemetry gauge check also makes its name tables once, and the emit check stops at a module that imports noemit.The check that the
projectandtreefixtures each have one definition reads every module oftests/, so it moves to thetest-treerow ofdevops ci, which parses those files once. The roadmap import check, which parsed 2,127 files in 10.65 s in CI, is deleted: mypy refuses a broken import insrc/, and a broken import in a test fails that test.Closes #4700
Change:
openspec/changes/archive/2026-11-11-4700-parse-the-source-trees-once-per/