feat(archive): enable multithreaded zstd compression

This commit is contained in:
2025-11-27 19:57:30 +01:00
parent 4ea3b28081
commit 31c3f7d438

View File

@@ -28,7 +28,7 @@ def archive_repo(source: Path, target_dir: Path, dry_run: bool) -> Path:
return archive_path return archive_path
with open(archive_path, "wb") as f: with open(archive_path, "wb") as f:
cctx = zstandard.ZstdCompressor(level=20) cctx = zstandard.ZstdCompressor(level=20, threads=-1)
with cctx.stream_writer(f) as compressor: with cctx.stream_writer(f) as compressor:
with tarfile.open(fileobj=compressor, mode="w|") as tar: with tarfile.open(fileobj=compressor, mode="w|") as tar:
tar.add(source, arcname=source.name) tar.add(source, arcname=source.name)