[clang-tidy] Start the largest files first in run-clang-tidy #243430
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.35) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 165 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.306
Real PR Conversation Timeline
1 comments
"Review active on #243430"
general
weight: 0.35
zeyi2
run-clang-tidy.pykeeps the files from the compilation database in a set, so it starts them in an arbitrary order that changes from run to run (#73357). When a few files take much longer than the rest, a run waits on whichever of them happens to start last.This starts the files with the most code to check first: a file's size times its number of compile commands, since clang-tidy checks a file once for each of its commands. Ties break by path, and files that can't be read sort last.
To test it, I measured clang-tidy's CPU time per file (
--checks='*') on 17 open-source projects, 4,086 files in all, and replayed the scheduler at 16 jobs. Against today's random order, starting the largest files first was 7.1% faster on average but made re2 29% and curl 21% slower. Their slowest files are small but compiled into many targets: re2'sutil/test.cchas 20 entries in the database, and curl'stests/libtest/first.chas 285. Weighting by the number of commands is 12.0% faster, with no project slower. An order that knew every file's true time would be 13.4% faster.#73357 suggests keeping the database order instead. CMake writes it in declaration order, and in these projects that is no faster than random on average and up to 28% slower (poco).
🤖 Generated with Claude Code