chore: add enableGlobalVirtualStore: true#365
Conversation
|
|
I don't see any benefits, so I'm closing this. |
|
Setting $ rm -rf node_modules packages/*/node_modules
$ pnpm --config.enableGlobalVirtualStore=false --offline i
$ du -h -d 1 -P node_modules
0B node_modules/@mizdra
363M node_modules/.pnpm
0B node_modules/@types
64K node_modules/.bin
0B node_modules/@vscode
0B node_modules/@eslint
0B node_modules/@typescript
0B node_modules/@css-modules-kit
0B node_modules/@changesets
363M node_modules
$ rm -rf node_modules packages/*/node_modules
$ pnpm --config.enableGlobalVirtualStore=true --offline i
$ du -h -d 1 -P node_modules
0B node_modules/@mizdra
408K node_modules/.pnpm
0B node_modules/@types
64K node_modules/.bin
0B node_modules/@vscode
0B node_modules/@eslint
0B node_modules/@typescript
0B node_modules/@css-modules-kit
0B node_modules/@changesets
524K node_modulesThe command $ hyperfine \
--warmup 1 \
--setup="rm -rf node_modules packages/*/node_modules" \
--prepare="pnpm --config.enableGlobalVirtualStore=false --offline i" \
"rm -rf node_modules packages/*/node_modules" \
--prepare="pnpm --config.enableGlobalVirtualStore=true --offline i" \
"rm -rf node_modules packages/*/node_modules"
Benchmark 1: rm -rf node_modules packages/*/node_modules
Time (mean ± σ): 2.189 s ± 0.054 s [User: 0.018 s, System: 1.835 s]
Range (min … max): 2.120 s … 2.285 s 10 runs
Benchmark 2: rm -rf node_modules packages/*/node_modules
Time (mean ± σ): 43.8 ms ± 0.9 ms [User: 1.1 ms, System: 42.1 ms]
Range (min … max): 42.5 ms … 45.8 ms 10 runs
Summary
rm -rf node_modules packages/*/node_modules ran
49.97 ± 1.64 times faster than rm -rf node_modules packages/*/node_modules |
When
enableGlobalVirtualStore: false, the followingnode_modulesdirectory is created.On the other hand, when
enableGlobalVirtualStore: true, the followingnode_modulesdirectory is created.Benchmark
enableGlobalVirtualStore: trueseems to be slow. Could this be because there are few packages?