question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Really inefficient resolution

See original GitHub issue

Suppose we are in /a/b/c/d.js and require some-thing and node_modules is in /a/node_modules, node-resolve handles this extremely efficiently

Current behavior:

Checks these in order to see which one exists

  • /a/b/c/node_modules/some-thing.js
  • /a/b/c/node_modules/some-thing/node_modules/package.json
  • /a/b/node_modules/some-thing.js
  • /a/b/node_modules/some-thing/node_modules/package.json
  • /a/b/c/node_modules/some-thing.js
  • /a/b/c/node_modules/some-thing/node_modules/package.json
  • /a/node_modules/some-thing.js
  • /a/node_modules/some-thing/node_modules/package.json

It gets even more inefficient as the number of possible extension grows, it does some many stats that for our module bundler bundling our app it can easily get to a hundred thousand unnecessary stats

The ideal behavior would be

  • /a/b/c/node_modules
  • /a/b/node_modules
  • /a/node_modules
  • /a/node_modules/some-thing.js
  • /a/node_modules/some-thing/node_modules/package.json

I’m on resolve@1.2.0 at the time of writing

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
ljharbcommented, Jan 26, 2017

That seems reasonable.

0reactions
ljharbcommented, May 10, 2018

I’d happily review a PR for it, but I’m not likely to have time in the near future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is super-resolution so inefficient? - ScienceDirect.com
According to the Abbe wave theory of the optical microscope, the limiting resolution which can be obtained is λ/2NA, where NA ≡n sin...
Read more >
Time To Resolution: What It Is, Why It Matters, How to Reduce It
How to measure Time To Resolution, why it's important, and our top tips for reducing resolution time for a better customer experience.
Read more >
windows 10 computer suddenly slow and the resolution is off ...
Everything was normal and my computer was running fine and everything was good, until today, today I noticed that my entire computer resolution...
Read more >
How to Fix Slow Video Playback and Performance Issues in ...
All the tips I know to make videos playback faster and smoother in the edit Timeline for DaVinci Resolve 18. Really essential for...
Read more >
Slow System: Symptoms, Causes, and Resolution - IBM
The symptoms of a slow system include: Slow transaction processing; Unusually long delay in starting a business process; Unusually large number of business ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found