Conversation
|
@dmichon-msft do you see obvious issues with these changes? These make pnpm slower at least 2 times. |
dmichon-msft
left a comment
There was a problem hiding this comment.
I'd need to see a CPU profile to know for sure, but this sounds like thread contention issues.
|
Thanks for the suggestions. I did some of the suggested changes and now the performance seems to be the same as without the changes. I still need to do the gunzip changes. |
|
OK, I did sync extraction too and some more benchmarks. It looks like, when the lockfile is up to date (so no resolution needs to happen) these optimizations actually make install about 33% faster. This is a great improvement. When there is no lockfile, the performance is almost the same because resolution of the lockfile is a bottleneck. |
| workerScriptPath: path.join(__dirname, 'worker/tarballWorker.js'), | ||
| }) | ||
| // @ts-expect-error | ||
| global.finishWorkers = () => workerPool.finishAsync() |
There was a problem hiding this comment.
This is a hack. For now it should be fine as I want to minimize the changes in this PR but in the future we'll have to find a better solution to call this function.
There was a problem hiding this comment.
Are this changes expected? (The workspace:* to versions) I tried to pull this PR to test it and every command fails with this error
✘ [ERROR] No matching export in "../../../Users/nacho/Documents/code/pnpm/fetching/tarball-fetcher/src/index.ts" for import "waitForFilesIndex"
../../../Users/nacho/Documents/code/pnpm/env/node.fetcher/src/index.ts:11:31:
11 │ import { createTarballFetcher, waitForFilesIndex } from '@pnpm/tarball-fetcher'
╵ ~~~~~~~~~~~~~~~~~
/Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:1649
let error = new Error(`${text}${summary}`);
^
Error: Build failed with 1 error:
../../../Users/nacho/Documents/code/pnpm/env/node.fetcher/src/index.ts:11:31: ERROR: No matching export in "../../../Users/nacho/Documents/code/pnpm/fetching/tarball-fetcher/src/index.ts" for import "waitForFilesIndex"
at failureErrorWithLog (/Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:1649:15)
at /Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:1058:25
at runOnEndCallbacks (/Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:1484:45)
at buildResponseToResult (/Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:1056:7)
at /Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:1085:16
at responseCallbacks.<computed> (/Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:703:9)
at handleIncomingPacket (/Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:762:9)
at Socket.readFromStdout (/Users/nacho/Documents/code/pnpm/node_modules/.pnpm/esbuild@0.18.17/node_modules/esbuild/lib/main.js:679:7)
at Socket.emit (node:events:514:28)
at addChunk (node:internal/streams/readable:343:12) {
errors: [
{
detail: undefined,
id: '',
location: {
column: 31,
file: '../../../Users/nacho/Documents/code/pnpm/env/node.fetcher/src/index.ts',
length: 17,
line: 11,
lineText: "import { createTarballFetcher, waitForFilesIndex } from '@pnpm/tarball-fetcher'",
namespace: '',
suggestion: ''
},
notes: [],
pluginName: '',
text: 'No matching export in "../../../Users/nacho/Documents/code/pnpm/fetching/tarball-fetcher/src/index.ts" for import "waitForFilesIndex"'
}
],
warnings: []
}There was a problem hiding this comment.
Did you run pnpm install?
There was a problem hiding this comment.
Yes, the weird thing is that I can go to the waitForFilesIndex import in Vscode
There was a problem hiding this comment.
I don't know why. Try
git clean -fdx
pnpm install
There was a problem hiding this comment.
Didn't work, I removed my local repo to start from scratch
There was a problem hiding this comment.
This didn't work either, I also tried in a codespace and it fails too, same error
There was a problem hiding this comment.
But on github actions it works.
|
I will merge these soon but I will not release the changes as stable yet. For now, it will be released under a prerelease version. |
|
Excited for the perf improvements here! |
To go along with vercel/next.js#54873 Includes pnpm/pnpm#6850, which improves installation performance.
To go along with vercel/next.js#54873 Includes pnpm/pnpm#6850, which improves installation performance. Closes WEB-1493
previous PR: #6819