SevenZipSharp icon indicating copy to clipboard operation
SevenZipSharp copied to clipboard

Large Assembly Size, Consider shipping SFX Module separately

Open roguesaloon opened this issue 4 years ago • 4 comments

Was wanting to use this version of the library in an app I'm currently working on as it seems like the most up to date and maintained fork. I got it off NuGET (https://www.nuget.org/packages/Squid-Box.SevenZipSharp/), and it seems to be working fine. But I was rather surprised to find the dll file was 1.73MB, as (unless I'm missing something) this doesn't contain 7zip itself (had to point it to my 7zip folder), and should just be a library for working with it which shouldn't amount to more than ~200KB.

roguesaloon avatar May 06 '20 00:05 roguesaloon

I figured out what the issue is, so I'm essentially answering my own question. The reason for the inflated size is the SFX module which makes sense. I have built a version without the embedded SFX resources or the SevenZipSfx class which fits my needs a bit better.

Though going forward I would consider shipping the SFX module as a separate package/assembly, or at least provide a version that doesn't include it. It is a small footprint in most cases but my whole project is under 4MB, with the full assembly (which I don't need most of) blowing it up to just under 6MB.

roguesaloon avatar May 06 '20 19:05 roguesaloon

You're correct, much of the size of the dll comes from the SFX resources. I have been thinking about how to distribute a version without them, and how to best do that, but it has never been a priority.

Next time I have a free evening I might look into making a separate NuGet named something like Squid-Box.SevenZipSharp.Lite.

squid-box avatar May 06 '20 21:05 squid-box

Yep that would work, that's essentially what I've done, just created an unsigned nuget package locally (on my PC) called squid-box.sevenzipsharp.nosfx from the result of the build without the SFX stuff. The resulting dll is a much more manageable 160KB.

roguesaloon avatar May 06 '20 21:05 roguesaloon

On the other side of the spectrum, having a version with everything bundled (SFX and the 7z.dll) could also be useful to get something working "out of the Nuget".

Gimly avatar Sep 28 '20 14:09 Gimly