SevenZipSharp icon indicating copy to clipboard operation
SevenZipSharp copied to clipboard

Should archives be marked as Solid by default?

Open doug24 opened this issue 3 years ago • 0 comments

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;
}

doug24 avatar Apr 11 '22 01:04 doug24