-
Notifications
You must be signed in to change notification settings - Fork 92
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
Larger file size with compression than without #625
Comments
Hi @jbrea, what you are seeing is because your test data is not really compressible ( with lossless compression ). When you use
JLD2 will try to individually compress each of the When you use the "external" compression, what you are seeing is the compression of the JLD2 metadata. For comparison: Here's what you get with a modified example with 10 random integers between
Here, you can see that the most efficient way is to use JLD2 compression with a single flattened dataset. |
I see, thanks for the explanation. Would it therefore make sense to check if the metadata can be compressed, when |
No, that does not really make sense. JLD2 should always be able to open a file even without having compression libraries installed. (It may not be able to read the dataset but it can at least say, what library needs to be loaded to do so.) Of course, you can always try to externally compress the whole file. |
I was puzzled to find jld2 files with compression to be quite often larger than those without: 2.8M versus 2.3M in the code below (I discovered this, when I wanted to store an array of DataFrames). For the data below, zip 3.0 reduces the size to 1.2M, which is close to the file size JLD2 achieves when the data is completely flat.
The text was updated successfully, but these errors were encountered: