Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not require cached packuments to construct npm resolution from the lockfile #27264

Open
dsherret opened this issue Dec 6, 2024 · 0 comments
Labels
perf performance related

Comments

@dsherret
Copy link
Member

dsherret commented Dec 6, 2024

If we store more information in the lockfile it should be possible to not need to reach into the global cache to get information for running a Deno program that already has the tarballs cached.

Right now we load:

  • cpu, os
  • dependencies
  • dist
  • optional dependencies
  • bin
  • scripts
  • deprecated

But probably in the case that the tarballs are cached we can avoid reading the packuments entirely and only require reading them for npm resolution or for fetching the tarballs (Ideally we don't store tarball urls in the lockfile because it can lead to someone changing urls in the lockfile to cause security issues).

This would require a new lockfile version.

Also, we should investigate how we optimize for these three scenarios:

  1. information required when everything is cached (this issue)
  2. information required when doing npm resolution
  3. information required when the package itself is not cached (info to download tarballs)

It might mean doing something like downloading the packument and then creating a subset from it (ex. a shortened version of the packument that only has the information we need).

Related:

@dsherret dsherret added the perf performance related label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf performance related
Projects
None yet
Development

No branches or pull requests

1 participant