Open dylang opened 10 years ago
All modules are cached by default by Node.js, based on their resolved filename but depending on the caller module location. See the details here http://nodejs.org/api/modules.html#modules_caching.
The requireHook
just simply override Module._load
so basically will be invoked AFAIK before the cache ... It seams that even the cashed require()
calls will involve some penalty.
if this happens...
Does that mean the two
a.js
must be different versions and therefor are not the same file on the disk?If I make sure they are the same version should that eliminate of the requires because it should be cached and take less than 1%?