Is there any way to improve performance of 7-Zip extract? #512

Open
opened 2026-01-29 22:13:07 +00:00 by claunia · 5 comments
Owner

Originally created by @v2codes on GitHub (Mar 31, 2022).

Hello,
I have a performance problem described below, how can I solve this?
If the 7z file without password, decompress it expend less then 1 seconds.
But when set a password, it takes more then 50 seconds.

7z file info:
Size: 6MB
File Count: 67

Sample Code :
`

        using (var archive = SevenZipArchive.Open(ppFile, new SharpCompress.Readers.ReaderOptions() { Password = key1 }))
        // using (var archive = SevenZipArchive.Open(ppFile))
        {
            archive.WriteToDirectory(ppFilePath, new ExtractionOptions()
            {
                ExtractFullPath = true,
                Overwrite = true,
                PreserveFileTime = false,
                PreserveAttributes = false
            });
        }

`

Thanks for help.

Originally created by @v2codes on GitHub (Mar 31, 2022). Hello, I have a performance problem described below, how can I solve this? If the 7z file without password, decompress it expend less then 1 seconds. But when set a password, it takes more then 50 seconds. 7z file info: Size: 6MB File Count: 67 Sample Code : ` using (var archive = SevenZipArchive.Open(ppFile, new SharpCompress.Readers.ReaderOptions() { Password = key1 })) // using (var archive = SevenZipArchive.Open(ppFile)) { archive.WriteToDirectory(ppFilePath, new ExtractionOptions() { ExtractFullPath = true, Overwrite = true, PreserveFileTime = false, PreserveAttributes = false }); } ` Thanks for help.
claunia added the bugup for grabs labels 2026-01-29 22:13:07 +00:00
Author
Owner

@adamhathcock commented on GitHub (Mar 31, 2022):

Sounds like someone should take some debugging to this because you're right.

@adamhathcock commented on GitHub (Mar 31, 2022): Sounds like someone should take some debugging to this because you're right.
Author
Owner

@ericsia commented on GitHub (Nov 3, 2022):

Sorry for asking, is it necessary for second parameter to be self initialise?
Because the ReaderOption options when null will initialise leaveStreamOpen as false right?

@ericsia commented on GitHub (Nov 3, 2022): Sorry for asking, is it necessary for second parameter to be self initialise? Because the `ReaderOption options` when null will initialise leaveStreamOpen as false right?
Author
Owner

@adamhathcock commented on GitHub (Nov 3, 2022):

Looking at the code, it won't because it if no options are supplied then one is made internally and the default option is true.

@adamhathcock commented on GitHub (Nov 3, 2022): Looking at the code, it won't because it if no options are supplied then one is made internally and the default option is true.
Author
Owner

@ericsia commented on GitHub (Nov 3, 2022):

Looking at the code, it won't because it if no options are supplied then one is made internally and the default option is true.

I have one last question. For this project do it support .net framework 3.5? Or it need framework 6 to work?
I wish to test lzma2 for unzip only

@ericsia commented on GitHub (Nov 3, 2022): > Looking at the code, it won't because it if no options are supplied then one is made internally and the default option is true. I have one last question. For this project do it support .net framework 3.5? Or it need framework 6 to work? I wish to test lzma2 for unzip only
Author
Owner

@adamhathcock commented on GitHub (Nov 3, 2022):

this is out of scope of this issue but the csproj and nuget list what targets are supported and legacy .NET Framework 3.5 isn't one of them.

@adamhathcock commented on GitHub (Nov 3, 2022): this is out of scope of this issue but the csproj and nuget list what targets are supported and legacy .NET Framework 3.5 isn't one of them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#512