Cache repeated npm module loader filesystem work - #155
Merged
Merged
Conversation
# Conflicts: # tests/npm_metadata/results/README.md
noise64
marked this pull request as ready for review
September 21, 2026 14:11
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.
package.jsonreads within one outer CommonJS resolution graph, clearing the negative set when the graph ends and after guest filesystem mutationsnode:fsrealpath uncachedResults
The final candidate was measured with three serial, fresh-state, cold local-registry samples of
npm --version,npm view, andnpm cion both P2 and P3. The physical call counts were identical on both targets.package.jsonreadsnpm --versionnpm viewnpm ciFinal cold local-registry timing medians:
npm --versionnpm viewnpm cinpm --versionnpm viewnpm ciTimings are observational and can vary between runs. The reconciled physical filesystem call counts are the comparison invariant. All 60 final samples succeeded, every
ciinstalled both pinned packages, local HTTP request counts matched expectations, and no trace overflow occurred.Full methodology, aggregate prototype tables, and final raw-report links are in
2026-09-21-cache-experiments.md.Correctness boundaries
node:fsrealpath APIs remain uncached and observe filesystem changes--preserve-symlinksbypasses both loader caches;--preserve-symlinks-mainbypasses CommonJS main canonicalizationprocess.cwd()before native cache lookupValidation