Skip to content

perf(ci): give one job to each analyzer when every processor has one - #291

Merged
SizzleUnrlsd merged 7 commits into
mainfrom
fix/self-analysis-one-job-per-analyzer
Dec 2, 2026
Merged

SizzleUnrlsd merged 7 commits into
mainfrom
fix/self-analysis-one-job-per-analyzer

Conversation

@SizzleUnrlsd

@SizzleUnrlsd SizzleUnrlsd commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

scripts/ci/run_code_analysis.py runs up to one analyzer per processor at once. Each of them took its number of threads from the processor count, as if it ran alone. The script now gives --jobs=1 to each analyzer when every processor already has one.

Closes #290

Change

  • analyzer_jobs_args (in the script) adds --jobs=1 to the analyzer arguments when the run has several analyzers and at least as many as the machine has processors.
  • A caller that passes --jobs or --config through --analyzer-arg keeps its choice: a configuration file may set jobs, and a command-line --jobs would override it.
  • Fewer analyzers than processors and a single analyzer keep choosing for themselves, as before: nothing was measured there. The script runs fewer analyzers than processors with a lower ANALYZER_JOBS, and when the inputs split into fewer groups: 55 inputs give 11 analyzers on 12 processors.

Measurements

See #290 for the tables (run 46435079896: 4 processors, 55 files, 4 repetitions, both analyzers with coretrace-compiler v0.13.0). The measured command line is the one the script now builds.

  • On main: 2.00 s more of 142.69 (1.4 %) without the cross-TU summary cache, 0.70 s less of 98.09 with it; the memory peak is 111 MiB (6.5 %) and 54 MiB (3.7 %) lower.
  • With perf(input): compile sources in parallel, each in its directory #272, which loads two inputs at once in each analyzer: 5.03 s and 5.09 s less than without --jobs=1, and a peak 506 MiB (27 %) and 560 MiB (29 %) lower. Next to main as it is, the time is the same within 1.2 % and the peak 328 MiB and 90 MiB lower.
  • The 32 runs report the same 72 diagnostics.

Tests

check_ci_script_analyzer_jobs (run_test.py): the rule on nine cases (analyzers against processors, --jobs and --config in both forms), then a run of the script with a stand-in analyzer on every processor, which must get --jobs=1, or the caller's --jobs=3.

CI at 944de46

  • ubuntu-24.04 (4 processors), macos-15 and macos-latest (3 each): 2917 of 2917 functional tests, main's 2916 and the new check; both unit-test programs end with their All ... passed. line.
  • The Self-analysis step, on Linux, runs 4 analyzers on 4 processors, so each gets --jobs=1: 55 files, errors=0, warnings=10, infos=62, as in the measured runs. The script does not print its command lines: the arguments are those the new check reads from a stand-in analyzer.
  • Not exercised: the Docker job pulls the published latest image and runs the script inside it, not this branch's. The action and consumer jobs run this script on one file, hence one analyzer and no --jobs=1.

Limits

One runner, one corpus, the fast profile. Not measured: fewer analyzers than processors, Docker, more than 4 processors.

run_code_analysis.py runs one analyzer per processor at once. Each of
them took its number of threads from the processor count, as if it ran
alone. A caller's --jobs or --config is kept, and fewer analyzers than
processors still choose for themselves.

Refs #290
The rule on nine cases, then a run of the script with a stand-in
analyzer on every processor.

Refs #290
@SizzleUnrlsd SizzleUnrlsd added the enhancement New feature or request label Dec 1, 2026
@SizzleUnrlsd SizzleUnrlsd self-assigned this Dec 1, 2026
The inputs can split into fewer groups than there are processors: 55
inputs give 11 analyzers on 12 processors. Those analyzers keep
choosing their own number of threads.

Refs #290
…essor

The entry said that the script runs one analyzer per processor by
default. It runs at most one, and fewer when the inputs split into
fewer groups.

Refs #290
@SizzleUnrlsd
SizzleUnrlsd marked this pull request as ready for review December 2, 2026 00:26
@SizzleUnrlsd
SizzleUnrlsd merged commit 0372f35 into main Dec 2, 2026
15 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the fix/self-analysis-one-job-per-analyzer branch December 2, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The CI script runs up to one analyzer per processor, each with threads for all of them

1 participant