Skip to content

Improve constable performance - #47

Merged
nnutter merged 6 commits into
masterfrom
constable
Nov 17, 2026
Merged

nnutter merged 6 commits into
masterfrom
constable

Conversation

@nnutter

@nnutter nnutter commented Nov 17, 2026

Copy link
Copy Markdown
Owner

No description provided.

git rebase --exec exports GIT_DIR for the repository being rebased
and an empty GIT_PREFIX. Git treats both as stronger than -C, so
fixture setup runs git init against that repository. On a linked
worktree, init sets core.bare and later Git commands refuse to run.

Drop those variables for fixture Git commands and for the clean-tree
check. The directory passed to Git is the repository those commands
mean, including while the suite runs under rebase --exec.

Change-Id: Ibde05b64cb34eb32a26fcd7d150b418044edfd3e
Measure package loading together with syntax-only analysis, fact-based
NilAway analysis, and a no-op fix pass before optimizing the driver. Go
benchmark CPU and memory profiles can separate prerequisite work from
package loading without adding profiling flags to the CLI.

Change-Id: I0e2f02dc6f58ec8dbf0ddaad1302a02f2a9830d0
Only fix passes consume the source snapshots captured by package
loading. Ordinary checks discarded them after cloning every parsed file,
including dependency files needed by fact-based analyzers.

Keep the parser settings and fix snapshots unchanged, but skip the
snapshot allocations and locking when fixes are not requested.

Change-Id: I78ee9339c1d4495a78e94984b0e3de8c83465838
NilAway checks package scope after the driver has run its prerequisites.
Its function-contract prerequisite therefore built SSA for dependencies
that NilAway would not analyze.

Apply the same scope check before building SSA. Preserve the upstream
requirement graph and shared prerequisite identities, and leave upstream
analyzers untouched. Explicit include and exclude settings still decide
which packages receive analysis.

Compare diagnostics against unmodified upstream analysis across package
scopes, including cross-package nil flows and inferred contracts.
Existing functional tests and expected fixes remain unchanged.

Change-Id: Ie6857a8045c265381f986f1de35413b3ca9b2f54
Extract the graph-copying operation from SSA scoping so the next
optimization can filter suppression-comment inputs without mutating
upstream analyzers or duplicating prerequisite result remapping.

Change-Id: Iacfc1320dc40e3d8c0cac09bb8a43b2592d61df4
Profiling after SSA scoping showed that suppression-comment parsing
still built comment maps for every dependency file.

Pass only files containing nolint text to the upstream suppression
parser. Keep its directive recognition, range construction, and fact
imports and exports unchanged. Excluded packages still run because their
suppression facts can affect downstream reports.

Compare diagnostics with upstream analysis using local suppressions,
cross-package flows, and an unsuppressed nil flow. No existing test
expectations change.

Change-Id: Ib2eaaa669acaee197dfb95e0275dc0517e39330a
@nnutter
nnutter enabled auto-merge November 17, 2026 19:13
@nnutter
nnutter merged commit 53c203b into master Nov 17, 2026
3 checks passed
@nnutter
nnutter deleted the constable branch November 17, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant