Computer Hope

Other => Other => Topic started by: unlovedwarrior on August 28, 2006, 10:36:05 AM

Title: .rar vs. .zip
Post by: unlovedwarrior on August 28, 2006, 10:36:05 AM
whats the better compression format? .rar or .zip? which compresses more and extracts better?


TIA

unlovedwarrior
Title: Re: .rar vs. .zip
Post by: Dilbert on August 28, 2006, 10:57:17 AM
I just tested this with 7-Zip.

Original size: 639 KB.

Sizes when compressed (normal compression):

.7z - 200 KB
.zip - 243 KB
.rar (done with WinRAR, since 7-Zip can only open .rar files) - 217 KB

As you can see, the winner is neither of your choices; 7z wins by 17 KB. :)

Oh, and none of these operations took more than 1.5 seconds apiece. :)
Title: Re: .rar vs. .zip
Post by: unlovedwarrior on August 28, 2006, 11:01:39 AM
ok where can i get this 7z dilbert??

thanks for testing for me

edit: you say normal compression, what other types are there? and whats the differences?
Title: Re: .rar vs. .zip
Post by: Dilbert on August 28, 2006, 11:18:38 AM
http://www.google.com/search?hl=en&q=7-zip&btnG=Google+Search

You can compress the files more, but it takes longer. For example, my 639 KB file can be 7-zipped down to 198 KB with the 7-zip "Ultra" setting. But that takes longer and isn't really worth the trouble (2 KB difference from Normal to Ultra... who cares?). So I usually just use Normal.
Title: Re: .rar vs. .zip
Post by: unlovedwarrior on August 28, 2006, 11:23:16 AM
ok thanks alot  :D
Title: Re: .rar vs. .zip
Post by: Neil on August 28, 2006, 02:04:20 PM
RAR can use solid archives which gives much better compression when dealing with lots of files than zip.. does 7s do this also?
Title: Re: .rar vs. .zip
Post by: unlovedwarrior on August 28, 2006, 02:23:47 PM
so you want to use rar when compressing bigger files or alot of files  at single time??
Title: Re: .rar vs. .zip
Post by: Dilbert on August 28, 2006, 03:37:42 PM
Test #2: A folder with 830 KB worth of 7 pictures.

.7z - 829 KB
.rar - 829 KB
.zip - 828 KB

Hmm... doesn't work for pictures all that well.

My download folder: 71.9 MB of programs. 14 programs. (This takes a while, maybe I should not have done this...)

.7z - 71.6 MB

*TEST CANCELLED*

You know what? This test proves that a lot of files can't really be all that compressed. Either that or my programs decided to mess up on their own... single files compress well...
Title: Re: .rar vs. .zip
Post by: unlovedwarrior on August 28, 2006, 03:43:53 PM
s ocompress each file by itself then put them in a folder and compress that folder to get maxium compression??
Title: Re: .rar vs. .zip
Post by: Dilbert on August 28, 2006, 03:55:12 PM
I have no idea, actually. I wonder what's going on, here... let's see what the other regulars have to say about this. This is confusing me, now. :-?
Title: Re: .rar vs. .zip
Post by: unlovedwarrior on August 28, 2006, 03:59:03 PM
lol im just think if you do it that way you'll save more space but i dont know. cuz i have to reformat my laptop most likely and i want to be able to put as much stuff on a disc as possible
Title: Re: .rar vs. .zip
Post by: Rob Pomeroy on August 28, 2006, 05:38:16 PM
Oh dear!

Compression, in a nutshell, relies on being able to spot patterns in data.  So instead of "000000000" the zip might say "10x'0'".  That's a trivial and somewhat inaccurate example, but it conveys the gist of what's going on here.

Most zip formats seem to create a file that consists of (1) a lookup table/key (2) the compressed data.  Pick a chunk of data from (2) and use (1) to work out what it should be.  Clear as mud?

So when you recompress an already compressed file, you're adding another lookup table to data that has virtually no repeating patterns.  i.e. the data can't be compressed any further, and you're actually increasing the file size by adding another lookup table.  You can prove this by recursively zipping a file.  Eventually it would become larger than the original.

The quality of a zip algorithm is reflected in the compression ratio.  My example above would actually work very badly.  But maths whizzkids have come up with much cleverer ways of achieving this objective.  7-Zip and BZip are two of the most effective zip algorithms to come into the public domain in recent years.

Executables and JPEGs will compress very badly, because they have already been compressed.  JPEG is a lossy compression format; executables are often compressed after compilation to reduce file sizes and to make it harder to reverse-engineer the code.
Title: Re: .rar vs. .zip
Post by: unlovedwarrior on August 28, 2006, 06:13:13 PM
thats interesting.. i learn every time i get on here and i love it
Title: Re: .rar vs. .zip
Post by: Dilbert on August 28, 2006, 07:25:15 PM
Cool. :D

"To close one's self from emberassment is to close one's self from knowledge"