Show More
@@ -1648,6 +1648,14 b' def bundle(ui, repo, fname, dest=None, *' | |||||
1648 | if complevel is not None: |
|
1648 | if complevel is not None: | |
1649 | compopts[b'level'] = complevel |
|
1649 | compopts[b'level'] = complevel | |
1650 |
|
1650 | |||
|
1651 | compthreads = ui.configint( | |||
|
1652 | b'experimental', b'bundlecompthreads.' + bundlespec.compression | |||
|
1653 | ) | |||
|
1654 | if compthreads is None: | |||
|
1655 | compthreads = ui.configint(b'experimental', b'bundlecompthreads') | |||
|
1656 | if compthreads is not None: | |||
|
1657 | compopts[b'threads'] = compthreads | |||
|
1658 | ||||
1651 | # Bundling of obsmarker and phases is optional as not all clients |
|
1659 | # Bundling of obsmarker and phases is optional as not all clients | |
1652 | # support the necessary features. |
|
1660 | # support the necessary features. | |
1653 | cfg = ui.configbool |
|
1661 | cfg = ui.configbool |
@@ -866,6 +866,31 b' coreconfigitem(' | |||||
866 | ) |
|
866 | ) | |
867 | coreconfigitem( |
|
867 | coreconfigitem( | |
868 | b'experimental', |
|
868 | b'experimental', | |
|
869 | b'bundlecompthreads', | |||
|
870 | default=None, | |||
|
871 | ) | |||
|
872 | coreconfigitem( | |||
|
873 | b'experimental', | |||
|
874 | b'bundlecompthreads.bzip2', | |||
|
875 | default=None, | |||
|
876 | ) | |||
|
877 | coreconfigitem( | |||
|
878 | b'experimental', | |||
|
879 | b'bundlecompthreads.gzip', | |||
|
880 | default=None, | |||
|
881 | ) | |||
|
882 | coreconfigitem( | |||
|
883 | b'experimental', | |||
|
884 | b'bundlecompthreads.none', | |||
|
885 | default=None, | |||
|
886 | ) | |||
|
887 | coreconfigitem( | |||
|
888 | b'experimental', | |||
|
889 | b'bundlecompthreads.zstd', | |||
|
890 | default=None, | |||
|
891 | ) | |||
|
892 | coreconfigitem( | |||
|
893 | b'experimental', | |||
869 | b'changegroup3', |
|
894 | b'changegroup3', | |
870 | default=False, |
|
895 | default=False, | |
871 | ) |
|
896 | ) |
@@ -685,9 +685,11 b' class _zstdengine(compressionengine):' | |||||
685 | # while providing no worse compression. It strikes a good balance |
|
685 | # while providing no worse compression. It strikes a good balance | |
686 | # between speed and compression. |
|
686 | # between speed and compression. | |
687 | level = opts.get(b'level', 3) |
|
687 | level = opts.get(b'level', 3) | |
|
688 | # default to single-threaded compression | |||
|
689 | threads = opts.get(b'threads', 0) | |||
688 |
|
690 | |||
689 | zstd = self._module |
|
691 | zstd = self._module | |
690 | z = zstd.ZstdCompressor(level=level).compressobj() |
|
692 | z = zstd.ZstdCompressor(level=level, threads=threads).compressobj() | |
691 | for chunk in it: |
|
693 | for chunk in it: | |
692 | data = z.compress(chunk) |
|
694 | data = z.compress(chunk) | |
693 | if data: |
|
695 | if data: |
@@ -5,6 +5,11 b'' | |||||
5 | * The `rev-branch-cache` is now updated incrementally whenever changesets |
|
5 | * The `rev-branch-cache` is now updated incrementally whenever changesets | |
6 | are added. |
|
6 | are added. | |
7 |
|
7 | |||
|
8 | * The new options `experimental.bundlecompthreads` and | |||
|
9 | `experimental.bundlecompthreads.<engine>` can be used to instruct | |||
|
10 | the compression engines for bundle operations to use multiple threads | |||
|
11 | for compression. The default is single threaded operation. Currently | |||
|
12 | only supported for zstd. | |||
8 |
|
13 | |||
9 | == New Experimental Features == |
|
14 | == New Experimental Features == | |
10 |
|
15 |
@@ -201,6 +201,15 b' zstd-v1 always fails' | |||||
201 | (see 'hg help bundlespec' for supported values for --type) |
|
201 | (see 'hg help bundlespec' for supported values for --type) | |
202 | [10] |
|
202 | [10] | |
203 |
|
203 | |||
|
204 | zstd supports threading | |||
|
205 | ||||
|
206 | $ hg init test-compthreads | |||
|
207 | $ cd test-compthreads | |||
|
208 | $ hg debugbuilddag +3 | |||
|
209 | $ hg --config experimental.bundlecompthreads=1 bundle -a -t zstd-v2 zstd-v2-threaded.hg | |||
|
210 | 3 changesets found | |||
|
211 | $ cd .. | |||
|
212 | ||||
204 | #else |
|
213 | #else | |
205 |
|
214 | |||
206 | zstd is a valid engine but isn't available |
|
215 | zstd is a valid engine but isn't available |
General Comments 0
You need to be logged in to leave comments.
Login now