Mercurial > public > mercurial-scm > hg-stable
diff mercurial/utils/compression.py @ 46789:471cd86c8eb4
bundle: optional multithreaded compression, ATM zstd-only
Compression type can be a huge chunk of "hg bundle", especially when
using the higher compression levels. With level=22 and threads=7, the
NetBSD test repository took 28:39 wall time and 157:47 user time.
Before, level=22 would take 129:20 wall time and 129:07 user time.
Differential Revision: https://phab.mercurial-scm.org/D9283
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Sun, 08 Nov 2020 20:17:09 +0100 |
parents | 84130fd74a22 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/mercurial/utils/compression.py Sat Mar 13 08:59:03 2021 +0100 +++ b/mercurial/utils/compression.py Sun Nov 08 20:17:09 2020 +0100 @@ -685,9 +685,11 @@ # while providing no worse compression. It strikes a good balance # between speed and compression. level = opts.get(b'level', 3) + # default to single-threaded compression + threads = opts.get(b'threads', 0) zstd = self._module - z = zstd.ZstdCompressor(level=level).compressobj() + z = zstd.ZstdCompressor(level=level, threads=threads).compressobj() for chunk in it: data = z.compress(chunk) if data: