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
Only symlink the folder instead of hardlinking every single file #3109
Comments
I don't understand this. You probably mean symlinks, not hard links. It is not possible to create a hard link of a directory. And pnpm only creates symlinks for directories, so I don't understand how you got symlinked files as on the screenshot. |
But hard links are real files. They are just pointing to the same location on the disk. I don't understand why your file explorer marks those files with some arrows. To any program, a hard link is just a file. A regular file. |
ok, I see, your explorer UI marks hardlinks. OK. This is correct. But this is not an issue because there is "one indirection". Node.js will resolve the symlinked directory to its real location and will resolve the file. Node.js is not looking for other locations of a hard link. |
Not sure about Node's @mischnic might know better. BTW, to get your explorer like me, install the link shell extension: |
Since pnpm has bumped up the major version, I did another benchmark of Parcel builds for solid-simple-table. Using a yarn bootstrapped repository results in ~4s faster build times compared to pnpm bootstrapped repo. Build time:
Maybe this is solely a Parcel issue as they don't seem to use |
I think this should be the default behavior, the folder |
@aminya @DanielRios549 symlinking only the folders will not work, it would cause problems with deduping module instances. For example, in a React project, all components need to use the same instance of the Let's say you have two projects: foo "react": "16.8.0",
"my-react-comp": "1.0.0", bar "react": "17.0.0",
"my-react-comp": "1.0.0" Inside With the behavior you want, The only way to avoid this is for |
The current behaviour is actually problematic with Angular, in particular ngcc, which writes new files into the packages. These new files don't end up in the global store and thus need to be generated anew all the time, especially on CI. |
Avoiding symlinks would allow to use pnpm in a scenario with a container based build and mounting a global cache to the build container. |
I have noticed that pnpm hardlinks every single separate file separately. This results in lower performance when the package is
require
d because therealpath
function should be called every time for each single file.I am proposing to only symlink the top-level folder to fix this issue.
pnpm version: all
Expected/Actual behavior:
These should be real files, not hardlinks. Only the top-level folder should be symlinked:
Additional information:
node -v
prints: 15An example of lower performance is in Parcel builds is this. Using yarn results in ~3s faster build times.
Build time:
The text was updated successfully, but these errors were encountered: