Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Why does snappy encodes the file ( increases the size ) instead of compressing it ? #43

Open
Praveenrajmani opened this issue Jul 5, 2018 · 1 comment

Comments

@Praveenrajmani
Copy link

Praveenrajmani commented Jul 5, 2018

I tried compressing a dd generated file of bigger size using snappy.
And i found the resulting compressed size to be larger than the actual size.
How to avoid it ?
Is fixed size compression possible?

@creachadair
Copy link
Contributor

Any compression algorithm that reduces the length of some strings will necessarily increase the length of others (intuitively, there are fewer possible codes of length n than strings of length n+1). Typically random-looking data will result in at least some expansion, since each literal will have some framing and Snappy doesn't use entropy coding.

I wouldn't expect more than a couple percent overhead even from a random file, but some expansion is possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants