Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Should archives be marked as Solid by default? #161

Open
doug24 opened this issue Apr 11, 2022 · 0 comments
Open

Should archives be marked as Solid by default? #161

doug24 opened this issue Apr 11, 2022 · 0 comments

Comments

@doug24
Copy link

doug24 commented Apr 11, 2022

I'm hoping someone has some insight to the 'Solid' property setting in archives. Are there really archive formats that are Solid archives but not marked with the Solid property = true? I've checked a number of different archives, and the only ones that have a Solid property set to false are 7Zip and RAR. But I think there are many formats that are not Solid and do not have a Solid property setting. Shouldn't this property default to false? Or allow the caller to set this flag?

I ran into the problem identified in issue #21 about slow performance extracting many files from large archives. My test archive has 46,550 files with a compressed size of 85MB. The application - dnGrep - uses streams to recursively search files in the archive without extracting them to disk. My first test took 2hr 24minutes to search the archive.

Then I found that SevenZipSharp is marking this as a Solid archive, even though it is not. When I made that change, the total search time dropped to less than 30 seconds.

SevenZipSharp is saying that it is Solid because that is the default fallback value. I know this code has been around since long ago, but I'm wondering if anyone has any idea why it would be this way, other than the original author thought it would be a safe default?

Here is the code: https://github.com/squid-box/SevenZipSharp/blob/dev/SevenZip/SevenZipExtractor.cs#L577. If the archive does not have a ItemPropId.Solid property, and the archive is not a Zip format, then the code defaults it to Solid:

if (!_isSolid.HasValue && _format == InArchiveFormat.Zip)
{
    _isSolid = false;
}

if (!_isSolid.HasValue)
{
    _isSolid = true;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant