Skip to content

Commit cdad990

Browse files
authored
perf(core): skip unnecessary stat call in the zip worker (#4166)
1 parent aedfbea commit cdad990

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

.yarn/versions/3519c54e.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
releases:
2+
"@yarnpkg/cli": patch
3+
"@yarnpkg/core": patch
4+
5+
declined:
6+
- "@yarnpkg/plugin-compat"
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-dlx"
9+
- "@yarnpkg/plugin-essentials"
10+
- "@yarnpkg/plugin-exec"
11+
- "@yarnpkg/plugin-file"
12+
- "@yarnpkg/plugin-git"
13+
- "@yarnpkg/plugin-github"
14+
- "@yarnpkg/plugin-http"
15+
- "@yarnpkg/plugin-init"
16+
- "@yarnpkg/plugin-interactive-tools"
17+
- "@yarnpkg/plugin-link"
18+
- "@yarnpkg/plugin-nm"
19+
- "@yarnpkg/plugin-npm"
20+
- "@yarnpkg/plugin-npm-cli"
21+
- "@yarnpkg/plugin-pack"
22+
- "@yarnpkg/plugin-patch"
23+
- "@yarnpkg/plugin-pnp"
24+
- "@yarnpkg/plugin-pnpm"
25+
- "@yarnpkg/plugin-stage"
26+
- "@yarnpkg/plugin-typescript"
27+
- "@yarnpkg/plugin-version"
28+
- "@yarnpkg/plugin-workspace-tools"
29+
- "@yarnpkg/builder"
30+
- "@yarnpkg/doctor"
31+
- "@yarnpkg/nm"
32+
- "@yarnpkg/pnpify"
33+
- "@yarnpkg/sdks"

packages/yarnpkg-core/sources/worker-zip/Worker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {PortablePath, ZipFS} from '@yarnpkg/fslib';
1+
import {PortablePath, statUtils, ZipFS} from '@yarnpkg/fslib';
22
import {getLibzipPromise} from '@yarnpkg/libzip';
33
import {parentPort} from 'worker_threads';
44

@@ -13,7 +13,7 @@ parentPort.on(`message`, async (data: ConvertToZipPayload) => {
1313
const {opts, tgz, tmpFile} = data;
1414
const {compressionLevel, ...bufferOpts} = opts;
1515

16-
const zipFs = new ZipFS(tmpFile, {create: true, libzip: await getLibzipPromise(), level: compressionLevel});
16+
const zipFs = new ZipFS(tmpFile, {create: true, libzip: await getLibzipPromise(), level: compressionLevel, stats: statUtils.makeDefaultStats()});
1717

1818
// Buffers sent through Node are turned into regular Uint8Arrays
1919
const tgzBuffer = Buffer.from(tgz.buffer, tgz.byteOffset, tgz.byteLength);

packages/yarnpkg-core/sources/worker-zip/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)