Compression

Jun 9, 2016 at 6:55 PM
Hi, Anlan.

I did 2 tests with version 2.0.1, both using the same set of data, only changing compression from 1 (fastest?) to 9 (ultra?). I got compressed data with the same size.

I think compression = 1 is giving the same result as ultra compression.

Can you verify this?
Coordinator
Jun 10, 2016 at 6:15 AM
Edited Jun 10, 2016 at 6:28 AM
Hi Thxdr,

well compression levels are deeply related to what type of content you're trying to compress.
If your file catalog is composed (mostly) by uncompressible files (for example other already compressed archives like zip or 7z or, again, almost uncompressible images files) then there is not much 7zip (or any other compressor) can do. Elevating the compression level wil only force 7zip to engage more cpu and ram resources to try harder and harder to do what it's not possible to do.

In some cases you could end up with archives which weight more than the sum of the weights of the single files archived: this is due to the fact that the compressor could not reduce the size of uncompressible files and adds it's envelope weight.

So the answer it's not a yes or no, it depends on what you're compressing.
You can easily test this behavior by creating some non compressible files in a folder (http://www.softwareok.com/?Freeware/NonCompressibleFiles) and try to archive them with different compressions levels : you will notice no changes in resulting archive size but great changes in execution time.
Coordinator
Jun 10, 2016 at 6:26 AM
Edited Jun 10, 2016 at 6:31 AM
Look this example where the catalog set is mostly composed by uncompressible images.
Did two runs : one with compression 1 and the second with compression 9.
As you can see the diffrences in size of the archives are negligible but the first run took 1 minute 50 seconds to complete the compression, while the second run took over 21 minutes to gain almost nothing in size (10x of execution time with only ~160Kb gain in size reduction ).

Due to this it's up to you decide what compression level to adopt balancing speed against potential size reduction.
Selection Details
 ------------------------------------------------------------------------------
 Extension                              Count          Total MB  Abs %   Inc %
 -------------------------------  ----------- ----------------- ------- -------
 .JPG                                  1.048          1.813,97   53,59   53,59
 .tif                                     53          1.500,12   44,32   97,91
 .pdf                                     25             65,97    1,95   99,86
 .gz                                       2              4,11    0,12   99,98
 .gif                                    129              0,37    0,01   99,99
 .html                                    46              0,22    0,01  100,00
 .php                                      9              0,04    0,00  100,00
 .pl                                       1              0,02    0,00  100,00
 .css                                      2              0,01    0,00  100,00
 .txt                                      4              0,01    0,00  100,00
 .htm                                      1              0,01    0,00  100,00
 .ico                                      1              0,00    0,00  100,00
 .csv                                      2              0,00    0,00  100,00
                                           2              0,00    0,00  100,00
                                  ----------- -----------------
 Total                                 1.325          3.384,85
                                  =========== =================
 Performance average                  19.381  files per minute
                                  =========== =================

 Created PC-ANDREA-full-20160610-075538.7z in E:\Backup\
 Archive Size 2.417,00 MB = 71,41% of original size
 Completed in 0 days, 0 hours, 21 minutes, 34,675 seconds
 Perfomance 2,61 MB/Sec.

 Post Processing Successfully Archived Files
 -------------------------------------------

 Completed in 0 days 0 hours 0 minutes 13,604 seconds

 Archives in E:\Backup\
 ------------------------------------------------------------------------------
 New      : PC-ANDREA-full-20160610-075538.7z                       2.417,00 MB  (Run with compression 9)
 Kept     : PC-ANDREA-full-20160610-075310.7z                       2.578,59 MB   (Run with compression 1)
Jun 10, 2016 at 1:03 PM
I understand your example but when I use 7-Zip interface on the same set of data I get 2 very different results when compression is set to fatest and ultra:
- Data    - Tool               - running time  - final size
- MyData  - 7-Zip (C=fastest)  - 2 seconds     - 15835 KB
- MyData  - 7-Zip (C=ultra)    - 13 seconds    - 1225 KB
- MyData  - 7zBackup (C=1)     - 15 seconds    - 1353 KB
- MyData  - 7zBackup (C=9)     - 15 seconds    - 1353 KB


That's why I'm thinking C=1 and C=9 are, in practice, using the same (ultra) compression.


Obs.: MyData

 Selection Details
 ------------------------------------------------------------------------------
 Extension                              Count          Total MB  Abs %   Inc % 
 -------------------------------  ----------- ----------------- ------- -------
-.doc                                    221             48,60   99,37   99,37
                                           2              0,17    0,35   99,72
-.odt                                      1              0,10    0,19   99,92
-.xls                                      2              0,03    0,06   99,98
 .txt                                      3              0,01    0,02  100,00
 .csv                                      2              0,00    0,00  100,00
                                  ----------- ----------------- 
 Total                                   231             48,91
Coordinator
Jun 10, 2016 at 6:05 PM
Edited Jun 10, 2016 at 6:20 PM
This is weird

just tested with a compressible set of data and here are the results.
 Selection Details
 ------------------------------------------------------------------------------
 Extension                              Count          Total MB  Abs %   Inc %
 -------------------------------  ----------- ----------------- ------- -------
 .pdf                                    203             52,93   92,31   92,31
 .odt                                     10              3,80    6,63   98,94
 .doc                                      8              0,60    1,05   99,99
 .txt                                      3              0,01    0,01  100,00
 .csv                                      2              0,00    0,00  100,00
                                  ----------- -----------------
 Total                                   226             57,34

 Archives in E:\Backup\
 ------------------------------------------------------------------------------
 Kept : PC-ANDREA-full-20160610-201753.7z                          57,59 MB (compression 0)
 Kept : PC-ANDREA-full-20160610-195958.7z                          20,09 MB (compression 9)
 Kept : PC-ANDREA-full-20160610-195912.7z                          46,70 MB (compression 1)
Could you please report me which version of 7-zip you're using ?
Jun 10, 2016 at 10:19 PM
Tested with 15.12 and 16.02. I will test again on another PC.