Best compression setting to achieve lowest possible archive file

Discussion in 'Linux' started by adi2, Aug 15, 2020.

  1. adi2

    adi2 MDL Novice

    May 8, 2017
    16
    3
    0
    I've downloaded a file containing videos. The archive was in .rar format. The actual size of the archive was 2.5GB but after decompression it came out as a 10GB folder.
    I want to know how to compress the folders with lowest possible archive size be in any format i.e. zip, .rar, .7z or any other? Please also tell me which app to use for this purpose? Currently I'm using 7zip but I can't make my folder that small because I don't know the correct setting.
    Thank you for helping.
     
  2. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,812
    10,426
    210
    I use LZMA1 compression on ultra settings with 1024mb dictionary size. I have 16gb of ram.
    If you use commandline set the "-t7z -mx=9 -myx=9 -md=1024m -m0=LZMA"
    Change the 1024m to whatever dictionary size you want to use. You can get away with 1536 if you have >20gb
     
  3. adi2

    adi2 MDL Novice

    May 8, 2017
    16
    3
    0
    Great thanks @murphy78 :worthy:
    I got 300 MB lesser size than the actual archive by applying same setting as you mentioned.
    Noticed LZMA2 is also there. Is it better than LZMA? I will try with 1536 dictionary size and LZMA2 to see if it gets me even lesser archive.:p
    Can't thank you enough.:hug2:
     
  4. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    6,812
    10,426
    210
    LZMA2 uses more threads, but is much less efficient than LZMA1. If you use 4x the threads, it also uses 4x the memory.
    In my experience, LZMA2 isn't worth using, but then I'm not pressed for time. It is obviously faster, but that's the only benefit.
    I don't have 128gb of ram so I can't test using 8 thread 1536mb LZMA2. If you do, it might be worth trying.
     
  5. adi2

    adi2 MDL Novice

    May 8, 2017
    16
    3
    0
    Okay, I understood the point.
    Thank you.