Zstd: The speed of zstd at default compression level(3) is only 0.43 of snappy. Is this phenomenon normal?

Created on 8 Jul 2020  路  2Comments  路  Source: facebook/zstd

Hi, I have tested lz4, snappy and zstd algorithms on my server, and there is a problem confused me.

I use the default compression level(3) of zstd, the compression speed is almost the same as snappy,
but the decompression speed of zstd is only 0.43 of snappy. Is this phenomenon normnal?

My test environment is as follows:
Server OS: Redhat Enterprise Linux Server release 6.3
CPU: Intel(R) Xeon(R) CPU [email protected]
zstd version: v1.4.5
snappy version: 1.1.3
Test Data: From hbase table without any compression algorithm.

Could you give me some advise?
Thanks.

question

Most helpful comment

Hi @wangxiaoq,

Compression algorithms are always balancing compression ratio against compression and decompression speed. By default, Zstd works harder to achieve a higher compression ratio than Snappy. So it decompresses a little slower. If you care more about decompression speed than ratio, you could try a "negative" compression level (e.g., --fast=1), which disables the entropy coding of the literals. Alternatively, give LZ4 a try.

Hope that helps.

All 2 comments

Hi @wangxiaoq,

Compression algorithms are always balancing compression ratio against compression and decompression speed. By default, Zstd works harder to achieve a higher compression ratio than Snappy. So it decompresses a little slower. If you care more about decompression speed than ratio, you could try a "negative" compression level (e.g., --fast=1), which disables the entropy coding of the literals. Alternatively, give LZ4 a try.

Hope that helps.

@wangxiaoq, I'm going to close this based on inactivity. If you have any follow-up questions, please feel free to re-open.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AbdulrahmanAltabba picture AbdulrahmanAltabba  路  3Comments

icebluey picture icebluey  路  3Comments

g666gle picture g666gle  路  3Comments

pjebs picture pjebs  路  3Comments

robert3005 picture robert3005  路  4Comments