Skip to content

Instantly share code, notes, and snippets.

@christroutner
Last active April 13, 2019 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christroutner/de0fd899abcd4bd17be64bf9ecb36cfe to your computer and use it in GitHub Desktop.
Save christroutner/de0fd899abcd4bd17be64bf9ecb36cfe to your computer and use it in GitHub Desktop.
BCH Mainnet Blockchain Size With Compression

04/12/19

I did a test of the size of the BCH mainnet blockchain, along with different compression formats. I tried 7zip on the highest compression setting, and that seemed to do the best. For comparison, I did a tar.gz file, as that is a common compression format for Linux:

  • 165 GB - Blockchain size uncompressed
  • 130 GB - tar.gz compressions
  • 113 GB - 7zip ultra compression

Here is how I ran the 7zip compression. Note: it took about a day to compress the blockchain. 7zip has the best compression, but it comes at the cost of extremely expensive computing. Uncompressing the blockchain only take a few second. But compression takes a very long time.

Adds all files from directory "dir1" to archive archive.7z using "ultra settings"

7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1

@monsterbitar
Copy link

I think you should do one more, bzip2.

It strikes a much more reasonable balance between compression time and compression ratio.

@monsterbitar
Copy link

In particular, it might be worth to observe the intended use case:

If the ratio between how often the data is compressed, versus how often it is decompressed - paired with the acceptable costs at the time you run the functions and the costs of transferring the compressed data if it is supposed to be distributed - then different choice will make more sense than others.

xz/7z/any with high compression settings will usually result in highly compressed data, but doing so takes up a lot of power.
zip/gzip/any with low compression settings can compress with a low power cost, but does not compress as well.

"Bzip2 provides a good trade off between compression ratio and processing speed however it takes the longest to decompress so it may be a good option if the content that is being compressed will be infrequently decompressed."

-- https://www.rootusers.com/gzip-vs-bzip2-vs-xz-performance-comparison/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment