Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants