You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One way you will see this affect is a plain SvelteKit project:
With node_modules mounted
$ npm run dev
...
VITE v6.1.1 ready in 23280 ms
With local file system
$ npm run dev
VITE v6.1.1 ready in 1493 ms
This was done by running the SvelteKit template within a mounted project folder. Unfortunately, npm does not allow moving node_modules to another location (trick I use in Rust development, very successfully).
The local version was run by:
$ cp -R Pulu Pulu.2
$ cd Pulu.2
$ npm run dev
..i.e. one-to-one replicate of the files, but running off local (VM internal) folder.
Repeated runs show similar speeds.
The node_modules has ~260MB of files (most small, as npm modules are..)
Solutions
try pnpm, instead of npm
Note: node can be made to find its modules elsewhere (see NODE_PATH), but npm install (local mode) goes after a fixed node_modules in the working directory. I tried hoops. Many. Failed.
Summary
Launching an npm based web project is 17x slower from a mounted (--type native) path, compared to a path within the VM's file system.
The text was updated successfully, but these errors were encountered:
The current solution of using either tmpfs or --bind mount for node_modules is adequate, but requires that setup to be renewed at each restart of the particular VM instance.
Multipass (I'm running 1.15.0) has problems with native mount performance on Macs.
One way you will see this affect is a plain SvelteKit project:
With
node_modules
mountedWith local file system
This was done by running the SvelteKit template within a mounted project folder. Unfortunately,
npm
does not allow movingnode_modules
to another location (trick I use in Rust development, very successfully).The local version was run by:
..i.e. one-to-one replicate of the files, but running off local (VM internal) folder.
Repeated runs show similar speeds.
The
node_modules
has ~260MB of files (most small, asnpm
modules are..)Solutions
pnpm
, instead ofnpm
Summary
Launching an
npm
based web project is 17x slower from a mounted (--type native
) path, compared to a path within the VM's file system.The text was updated successfully, but these errors were encountered: