You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was curious how this project approached various scenarios, after doing so I believe I can share some past findings and alternative approaches that may be of use to you.
Specifically finding package.json's recursively across a large dep graph with duplicates can easily consume a large amount of time (in some of our applications this alone could take many minutes) (although our approach did traverse node_modules, which amplifies this problem)
To mitigate this problem, some collaborators and I implemented a pretty fast approach that worked well for our use cases ultimately turning those minutes into seconds in the largest of our applications.
Our approach does the following:
carefully avoids unnecessary IO
added various levels of memoization, which by default mimics that of nodes require but is configurable to suit most use cases.
This is a cool project!
I was curious how this project approached various scenarios, after doing so I believe I can share some past findings and alternative approaches that may be of use to you.
Specifically finding package.json's recursively across a large dep graph with duplicates can easily consume a large amount of time (in some of our applications this alone could take many minutes) (although our approach did traverse node_modules, which amplifies this problem)
The existing approach ->
backfill/packages/hasher/src/helpers.ts
Line 17 in 03b0e80
To mitigate this problem, some collaborators and I implemented a pretty fast approach that worked well for our use cases ultimately turning those minutes into seconds in the largest of our applications.
Our approach does the following:
require
but is configurable to suit most use cases.When profiling slow builds, we noticed many such problems and ended up extracting our approach for reuse. If you are interested, it can be found here -> https://github.com/stefanpenner/resolve-package-path
The text was updated successfully, but these errors were encountered: