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

[web] try out Deno // was: Dismal node performance #8

Open
akauppi opened this issue Feb 21, 2025 · 2 comments
Open

[web] try out Deno // was: Dismal node performance #8

akauppi opened this issue Feb 21, 2025 · 2 comments

Comments

@akauppi
Copy link
Owner

akauppi commented Feb 21, 2025

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 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.

@akauppi
Copy link
Owner Author

akauppi commented Feb 21, 2025

Tried pnpm.

VITE v6.1.1 ready in 40087 ms

Yeah.

@akauppi
Copy link
Owner Author

akauppi commented Mar 2, 2025

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.

  •  try out Deno, which

    [...] uses a global cache with hard links, like pnpm, to improve speed and reduce storage usage across projects.

Sorry, something went wrong.

@akauppi akauppi changed the title [web] Dismal node performance [web] Dismal node performance -> try out Deno Mar 2, 2025
@akauppi akauppi changed the title [web] Dismal node performance -> try out Deno [web] try out Deno // was: Dismal node performance Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant