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

fix: avoid recreating existing, valid symlinks #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Aug 19, 2024

  1. fix: avoid recreating existing, valid symlinks

    This is a somewhat lazy approach to fixing an issue where pnpm
    regenerates symlinks, even if the existing symlink is perfectly fine.
    This behavior (of clobbering valid symlinks) can have adverse downstream
    effects, like triggering watchers and invalidating caches (the mtime
    changes).
    
    This is not the ideal solution, because it incurs the cost of a failed
    `readlink` if the symlink does _not_ currently exist (which is always
    the case in a fresh pnpm install, and _sometimes_ the case in a pnpm
    install that needs to move things around).
    
    But in the happy case—when the node_modules are already mostly correct,
    at Discord, we saw a 0.2-0.5s speedup in `pnpm install`. So I think it's
    worth doing this, and then considering this function more holistically
    if we find time.
    stevenpetryk committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    92c6298 View commit details
    Browse the repository at this point in the history