Unverified Commit 5917f4d4 authored by Ruben Bridgewater's avatar Ruben Bridgewater Committed by Beth Griggs
Browse files

module: add extra caching layer

This adds an extra modules caching layer that operates on the parent's
`path` property and the current require argument. That together can
be used as unique identifier to speed up loading the same module more
than once. It is a cache on top of the current modules cache.

It has the nice feature that this cache does not only work in the same
file but it works for the whole current directory. So if the same file
is loaded in any other file from the same directory, it will also hit
this cache instead of having to resolve the file again.

To keep it backwards compatible with the old modules cache, it detects
invalidation of that cache.

PR-URL: https://github.com/nodejs/node/pull/26970
Refs: https://github.com/nodejs/node/pull/25362


Reviewed-By: default avatarGuy Bedford <guybedford@gmail.com>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Signed-off-by: default avatarBeth Griggs <Bethany.Griggs@uk.ibm.com>
parent 8f6921e9
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment