Skip to content

Instantly share code, notes, and snippets.

@chrdek
Last active February 21, 2023 23:57
Show Gist options
  • Save chrdek/857855af35ccadae4ff4662ded378878 to your computer and use it in GitHub Desktop.
Save chrdek/857855af35ccadae4ff4662ded378878 to your computer and use it in GitHub Desktop.
Various data compression methods for file archiving using 7z, other programs
:: Method 1 (Zip compression using 15 passes with deflate)
"%PROGRAMFILES%\7-Zip\7z.exe" a -mm=Deflate -mfb=258 -mpass=15 -r "%USERPROFILE%\Downloads\samples1.zip" "%USERPROFILE%\Downloads\zipfiles\*"
1294MB -> 1192 MB (7.9% compression)
:: Method 2 (Zip compression using max compression with deflate)
"%PROGRAMFILES%\7-Zip\7z.exe" a "%USERPROFILE%\Downloads\samples1.zip" "%USERPROFILE%\Downloads\zipfiles\*" -tzip -mx9 -mm=Deflate64
1294 MB -> 1189 MB (8.2% compression)
:: Method 3 (7z lzma compression using max compression with 32mb part.)
"%PROGRAMFILES%\7-Zip\7z.exe" a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on "%USERPROFILE%\Downloads\samples1.7z" "%USERPROFILE%\Downloads\zipfiles\*"
:: Method 3.1 (7z lzma compression using max compression with 32mb part and split into 512MB volumes)
"%PROGRAMFILES%\7-Zip\7z.exe" a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -v512m "%USERPROFILE%\Downloads\samples1.7z" "%USERPROFILE%\Downloads\zipfiles\*"
1294 MB -> 1049MB (19% compression)
:: Method 4 (zpaq journaling archive using 4-passes)
zpaq.exe -m4 add "%USERPROFILE%\Downloads\samples1.zpaq" "%USERPROFILE%\Downloads\zipfiles\*"
1294MB -> 959.973669 MB (25.9% compression)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment