File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ rayon = "1.0"
16
16
tar = " 0.4.13"
17
17
walkdir = " 2"
18
18
xz2 = " 0.1.4"
19
+ num_cpus = " 1"
19
20
20
21
[dependencies .clap ]
21
22
features = [" yaml" ]
Original file line number Diff line number Diff line change @@ -48,7 +48,11 @@ impl Tarballer {
48
48
let gz = GzEncoder :: new ( create_new_file ( tar_gz) ?, flate2:: Compression :: best ( ) ) ;
49
49
50
50
// Prepare the `.tar.xz` file.
51
- let xz = XzEncoder :: new ( create_new_file ( tar_xz) ?, 6 ) ;
51
+ let stream = xz2:: stream:: MtStreamBuilder :: new ( )
52
+ . threads ( num_cpus:: get ( ) as u32 )
53
+ . preset ( 6 )
54
+ . encoder ( ) ?;
55
+ let xz = XzEncoder :: new_stream ( create_new_file ( tar_xz) ?, stream) ;
52
56
53
57
// Write the tar into both encoded files. We write all directories
54
58
// first, so files may be directly created. (See rust-lang/rustup.rs#1092.)
You can’t perform that action at this time.
0 commit comments