Skip to content

perf(engine): reuse config and extraction for a commit whose read files are unchanged - #186

Merged
sweepies merged 2 commits into
mainfrom
perf/content-addressed-extraction
Nov 4, 2026
Merged

sweepies merged 2 commits into
mainfrom
perf/content-addressed-extraction

Conversation

@sweepies

@sweepies sweepies commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Finding #1 from the speed survey: a saved scan was reused only when the commit was unchanged, so every push, even one touching only code, re-evaluated Pkl and re-scanned every manifest.

Both steps are pure functions of their inputs, so each now also has a content-addressed cache:

  • Config: load_files over patchula.pkl and its imports, keyed by repository and the hash of the gathered modules.
  • Extraction: scanner.extract(&files), keyed by repository, config hash and the hash of the files map: the selected blobs, the unreadable-settings markers and whatever more() pulled in. It uses the same extract-v25 namespace as the commit key, so a semantics bump invalidates both.

The commit-keyed fast path is unchanged. On a new commit the engine reads the tree and rebuilds the files map; with #183 and #184 unchanged blobs come from the local cache, so the network cost is one tree request. The path inventory and unsupported-file list always come from the current tree.

Soundness: the reused value is the output of a deterministic function of exactly the hashed input, so no path list or read set has to be tracked.

Test: a dry run, then the head moves to a new commit with the same tree. The second run reports the new commit, one extraction hit, the same dependencies and updates, and no blob reads over REST or GraphQL.

View guided diff Turn on auto-fix

…es are unchanged

The extraction and config caches were keyed by commit, so any push, even
one touching only code, re-evaluated Pkl and re-scanned every manifest.
Both are functions of the files they read, so each now also has a cache
keyed by the content of those files, under the same namespace as the commit
key. A new commit still reads the tree and the selected files, now from the
blob cache, and the path inventory and unsupported list still come from the
current tree.
Unlike a commit, the same files recur across releases, so a release that
changes decoding or extraction without a namespace bump would keep reading
stale entries.
@sweepies
sweepies force-pushed the perf/content-addressed-extraction branch from 74d3624 to b91d9de Compare November 4, 2026 15:24
@sweepies
sweepies merged commit 4ea38bd into main Nov 4, 2026
13 checks passed
@sweepies
sweepies deleted the perf/content-addressed-extraction branch November 4, 2026 15:31
@sweepies sweepies mentioned this pull request Nov 6, 2026
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