antony-jr / QArchive

Async C++ Cross-Platform library that modernizes libarchive using Qt :rocket:. Simply extracts 7z :hamburger:, Tarballs :8ball: and other supported formats by libarchive. :heart:
https://antony-jr.github.io/QArchive
BSD 3-Clause "New" or "Revised" License
81 stars 25 forks source link

Compressing small files increases archive size #101

Open d-divita opened 1 month ago

d-divita commented 1 month ago

Select your issue type: (check at least one)

Describe your issue: When compressing small files, for example a bunch of small .txt files, the resulting archive is bigger than the files it contains.

Ways to Reproduce the issue (optional):

  1. Create a .txt file with a few words in it (it will be some bytes in size)
  2. Compress it via QArchive
  3. The resulting archive is about 10KB (tested with ZipFormat, SevenZipFormat, TarFormat)
antony-jr commented 1 month ago

@d-divita do we have a baseline, like have you compared with Ark or any other archive tool, does it produce smaller archives than QArchive?

antony-jr commented 1 month ago

Also, we should try to compare QArchive with bsdtar (this is installed by default on all linux distro), the one that is included with libarchive.

Since I have no control over the compression algorithm, its all libarchive.

d-divita commented 1 month ago

Sorry I forgot to mention it, I'm on Windows 10/11. I compared it with the built-in zip compression and with 7zip. Libarchive is the latest stable version, I've used the prebuilt binaries for Windows.

antony-jr commented 1 month ago

Let me investigate this more.