How to use all the cores on the CPU to do archiving? #716
-
|
Let's say i have a code like this: import py7zr
with py7zr.SevenZipFile("Archive.7z", "w") as archive:
archive.writeall("test/")I want to use all the cores in my cpu to do compression, how do i do it? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
7-Zip uses a compression method called solid compression. In computing, solid compression means that multiple files are concatenated and treated as a single data stream before compression. An archive created this way is called a solid archive, and this is the native approach used by the 7z format. Because of this design, extracting files from a solid archive has inherent limitations for parallelism. When extracting a file located in the middle of a solid archive, the decompressor must process the data sequentially from the beginning of the solid block up to the target file. In other words, extracting a single file requires processing all preceding files in the same solid block. In py7zr, parallel extraction depends on the archive structure. If the archive contains multiple solid blocks, py7zr can extract those blocks in parallel by assigning each block to a separate thread. However, if the archive consists of a single solid block, extraction is necessarily single-threaded, as the data must be processed sequentially. |
Beta Was this translation helpful? Give feedback.
7-Zip uses a compression method called solid compression. In computing, solid compression means that multiple files are concatenated and treated as a single data stream before compression. An archive created this way is called a solid archive, and this is the native approach used by the 7z format.
Because of this design, extracting files from a solid archive has inherent limitations for parallelism. When extracting a file located in the middle of a solid archive, the decompressor must process the data sequentially from the beginning of the solid block up to the target file. In other words, extracting a single file requires processing all preceding files in the same solid block.
In py7zr, …