Results 1 to 3 of 3

Thread: tarballs

  1. #1
    Member
    Join Date
    Aug 2015
    Location
    tokyo
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    tarballs

    Let's say I have many files to compress. I was wondering... is a compressed tarball the same size of a tarball of compressed files?
    I know that this is a very general question with many variables involved, but I'm curious to know if, in general, I should expect the size to be the same or one methods compresses slightly better than the other. I'm using Debian, xarchiver, and tar/bz2.

  2. #2
    Member
    Join Date
    Feb 2015
    Location
    United Kingdom
    Posts
    176
    Thanks
    29
    Thanked 74 Times in 44 Posts
    Generally if the files within a tarball have some similar data characteristics the compressor would pickup on that and compress better than if these similarities were separate.
    As proof of concept I selected 15 common files (1 swf, 1 bmp, 2 mp3's, 5 gifs, 6 jpgs) with gzip prior to tarballing. Then another test with tarballing then gzip. The result was that tarballing then compressing was better but only by a small amount, less than 1%.
    Hopefully this helps you.

  3. #3
    Member
    Join Date
    Apr 2012
    Location
    Stuttgart
    Posts
    448
    Thanks
    1
    Thanked 101 Times in 61 Posts
    Quote Originally Posted by waldo View Post
    Let's say I have many files to compress. I was wondering... is a compressed tarball the same size of a tarball of compressed files?
    No, certainly not. Compressing the tarball gives the compressor a chance to use correlation between files it cannot exploid when compressing files separately. On the other hand, compressing the tarball may also spoil the statistics which is otherwise reset for each new file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •