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

Compression creates even larger files #17

Open
nzain opened this issue Aug 1, 2019 · 0 comments
Open

Compression creates even larger files #17

nzain opened this issue Aug 1, 2019 · 0 comments

Comments

@nzain
Copy link

nzain commented Aug 1, 2019

During my comparison of compression algorithms I've tested your nuget package (Snappy.Sharp 1.0.0), but something is wrong: compressing a 10MB binary file results in about 18MB output, which is quite the opposite of compression :-)

10478124 bytes => 18661217 bytes ~ 178,10%

Switching to another snappy binding (Snappy.Net if I remember correctly) results in a 64% compression ratio.

My code looks something like this:

FileInfo tmp = new FileInfo(Path.GetTempFileName());
using (FileStream fs = new FileStream(tmp.FullName, FileMode.Open, FileAccess.Write, FileShare.None))
using (SnappyStream s = new SnappyStream(fs, CompressionMode.Compress))
{
    // ... pump data into s
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

1 participant