elastic / require-in-the-middle

Module to hook into the Node.js require function
MIT License
168 stars 26 forks source link

Cache exports in additional code paths #76

Closed nwalters512 closed 1 year ago

nwalters512 commented 1 year ago

Makes the change proposed in #75.

Note that there are a few other early-returns of exports where we could in theory use the exports cache as well. However, those all occur prior to the call to resolve.sync(...), which AFAICT is the slowest part of this code since that actually does a lot of filesystem operations. Everything before that point should be fast code that doesn't do any async filesystem/etc. operations, which means that the benefits to caching in that case is most likely negligible.

cla-checker-service[bot] commented 1 year ago

💚 CLA has been signed

nwalters512 commented 1 year ago

I signed the CLA - do I have to do anything to get it to update the check status? Edit: ah, there we go!

trentm commented 1 year ago

Thanks! I'll get a release out soon. ... then I think opentelemetry-js.git will pick up the new version? If not I can make a PR to update it (eventually, I'll be on vacation for a while).