Halve clang-tidy CI time: disable the implicitly-on analyzer, drop duplicate and dataflow checks#110
Merged
Merged
Conversation
Three findings, all profiled with --enable-check-profile: 1. clang-tidy prepends its builtin default 'clang-diagnostic-*, clang-analyzer-*' to any Checks list, so the analyzer this config documented as omitted has been running all along. Disable it explicitly. 4 representative TUs: 64s -> 25s wall. 2. bugprone-unchecked-optional-access is a dataflow-framework check costing 38% of all matcher check time (24s of 63s) while emitting nothing here. Disabled with a note to run it locally on optional-heavy changes. 3. cert-* is mostly aliases of already-enabled bugprone/misc/ readability checks, and an enabled alias runs the check again (cert-dcl51-cpp + cert-dcl37-c tripled bugprone-reserved-identifier). Replaced the family with its 14 own-implementation checks. Also anchor the run-clang-tidy file filter to $(CURDIR): the bare 'src/|test/' pattern matches absolute paths, so a checkout under a path containing src/ (e.g. ~/src/pup) swept third_party TUs into the run, where third_party/.clang-tidy's '-*' made clang-tidy fail with 'no checks enabled' - make tidy exited 1 locally while green on CI. Full suite, local 8-core: 3m59s -> 2m01s wall (-49%), 1609s -> 861s CPU (-47%), exit 2 -> 0. Diagnostics on production TUs are unchanged (43 = 43 on the profiled set; only analyzer-family notes disappear). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz
PR metricsPerformance (gcc example, Linux)
Deterministic signals: page faults, peak RSS, and the cachegrind D1/LL miss rates (simulated cache, exact across runs). CPU time is user+sys from time(1); instructions read n/a on GitHub-hosted runners (virtualized, no PMU). Test coverage (lines)
93 files · 13697/16104 lines covered Deltas vs main@35e6b1d9e. Updated for 19aa51f |
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.
The tidy job takes ~10 min — second-longest in CI. Profiling (
--enable-check-profile) found three compounding causes:clang-analyzer-*was never actually off. clang-tidy prepends its builtin defaultclang-diagnostic-*,clang-analyzer-*to anyCheckslist — omission does not disable, so the analyzer the config documents as omitted has been running in every CI tidy job. Now disabled explicitly (verify withclang-tidy --dump-config).clang-diagnostic-*stays: it's computed during parse anyway and keeps tidy aligned with-Wall -Werror.bugprone-unchecked-optional-access: dataflow-framework machinery, 38% of all matcher check time on representative TUs while emitting zero diagnostics here. Disabled, with a documented local invocation for optional-heavy changes.cert-*is mostly aliases of already-enabled bugprone/misc/readability checks, and an enabled alias runs the check again —cert-dcl51-cpp+cert-dcl37-ctripledbugprone-reserved-identifier. The family is now cherry-picked to its 14 own-implementation checks (same pattern the config already uses for modernize/cppcoreguidelines).Bonus correctness fix: the
run-clang-tidyfilter'src/|test/'matches absolute paths, so any checkout under a path containingsrc/(like~/src/pup) swept third_party TUs into the run, wherethird_party/.clang-tidy's-*fails with no checks enabled —make tidyexited 1 locally while green on CI. The filter is now anchored to$(CURDIR)/(src|test)/.Measured (local 8-core, full suite): wall 3m59s → 2m01s (−49%), CPU 1609s → 861s (−47%), exit 2 → 0. 4-TU A/B: 95.6s → 25.0s (−74%). Diagnostics on the profiled production TUs are byte-identical (43 = 43); only analyzer-family notes disappear, which is this config's long-stated intent. CI projection: tidy ~10 min → ~5 min.
🤖 Generated with Claude Code
https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz