What makes pnpm performant | Zoltan Kochan | ViteConf 2022

Key takeaways
  • pnpm uses a content-addressable storage to link the files of dependencies, resulting in efficient disk space usage.
  • pnpm’s unique node modules directory structure, called “flat” or “hoisted,” eliminates duplicate copies of files and improves performance.
  • pnpm’s algorithm for resolving and fetching dependencies is more efficient, leading to faster installation times compared to npm and yarn.
  • pnpm’s isolated node modules are beneficial for monorepos, allowing projects to access dependencies without hoisting them to the root.
  • pnpm supports features like side effects cache and non-modules, which are not yet available in npm or yarn.
  • pnpm is now the official package manager shipped by Node.js, alongside yarn, and is supported by many large companies.
  • pnpm can be used to manage Node.js versions through the pnpm nviews command, providing an alternative to tools like nvm or nvs.
  • pnpm’s virtual store feature ensures that files are stored in a central location and only linked to, preventing duplicate copies and saving disk space.
  • pnpm’s deterministic behavior and the introduction of a log file have addressed previous concerns about its reliability.
  • pnpm’s performance advantages are particularly noticeable in scenarios with many dependencies or large projects.