Replies: 8 comments 28 replies
-
FWIW, I think that an infra tool with such performance needs would benefit from a full re-write in rust. |
Beta Was this translation helpful? Give feedback.
-
Currently, pnpm's tab completion is slow enough that I find typing out the whole command more productive. Re-implementing tab completion in Rust would certainly boost its performance. |
Beta Was this translation helpful? Give feedback.
-
Cross compile will be a problem since Github actions is lack of support for BSD systems |
Beta Was this translation helpful? Give feedback.
-
I get a lot of value from the way pnpm is decomposed into many small packages, so I wouldn't want to lose this to a monolithic Rust dependency doing various things. A good strategy could be to create optional native Rust bindings for some packages containing hot code paths or anything impacting cli startup performance. I wonder though if some inter-package dependencies would not benefit from perf improvements if they are in separate packages. I wonder if you could have native bindings per package, and have them communicate natively, instead of marshalling objects through v8... We should do some benchmarking on various things to figure out where the best wins could be. I started benchmarking some cli stuff here last month - #3346. It would be great if Also, on a large repo, Should not that some perf improvements could also come from persistent file watchers, and daemons, in some cases. Although the current |
Beta Was this translation helpful? Give feedback.
-
Someone is experimenting with writing a Node.js package manager in Rust |
Beta Was this translation helpful? Give feedback.
-
@Jarred-Sumner recommended to try Zig which might be easier to learn than Rust. |
Beta Was this translation helpful? Give feedback.
-
@zkochan Hi. I have had the same ideas before and developed some tools to achieve that goal. It's very happy to share them with you. There are some portability problems in rust's standard I also think you could use js_workspace_tools and graph_executor to supports features about monorepo in pnpm is a wonderful tool. I'll see what I could do rather than create a new one. |
Beta Was this translation helpful? Give feedback.
-
An update regarding this. I have resumed work on the pnpm wrapper but I am reducing scope for now. It will implement the I am also planning to implement a tarball fetcher written in Rust. So Rust will download the tarball, extract its contents, calculate the checksums of each file and write them to the content-addressable store. I hope that this will make pnpm a couple times faster. A full rewrite is unrealistic for now. We cannot switch all our efforts to it. The goal is to make pnpm fast enough for our users to stick with us instead of switching to less mature but faster alternatives written in Rust/Zig/etc. |
Beta Was this translation helpful? Give feedback.
-
pnpm install
is fast but not all the pnpm commands are fast. Thepnpm run
commands are slow #3409, volta-cli/volta#984. Although we can come up with some workarounds, a Node.js CLIs startup will be always slower than a native program's startup.Furthermore, if we would like to implement a builtin version switcher #1383, pnpm will load itself twice, causing even more delays.
On the other hand, if we create a wrapper written in Rust, we could use Rust for some actions, and pass thru to Node.js for the rest. The Rust wrapper could:
pnpm run
commandUnfortunately,
pnpm run
has currently a lot of features, so this new CLI wrapper will have to be experimental for a long time. We can name itpn
and keep it as a separate project for now.PoC: https://github.com/pnpm/pn
Beta Was this translation helpful? Give feedback.
All reactions