Skip to content

Commit a873e0c

Browse files
perf: Speed up creating archives when pusing big codebases (#1011)
1 parent f0704d3 commit a873e0c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/lib/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,13 @@ export const createActZip = async (zipName: string, pathsToZip: string[], cwd: s
307307
}
308308

309309
const writeStream = createWriteStream(zipName);
310-
const archive = archiver('zip');
310+
// Use compression level 6 for better balance between speed and compression ratio (default is 9)
311+
const archive = archiver('zip', {
312+
zlib: { level: 6 },
313+
});
311314
archive.pipe(writeStream);
312315

313-
pathsToZip.forEach((globPath) => archive.glob(globPath, { cwd }));
316+
pathsToZip.forEach((filePath) => archive.file(join(cwd, filePath), { name: filePath }));
314317

315318
await archive.finalize();
316319
};

0 commit comments

Comments
 (0)