JuliaIO / JLD2.jl

HDF5-compatible file format in pure Julia
Other
547 stars 85 forks source link

No compression with `jldsave` #444

Closed cafaxo closed 8 months ago

cafaxo commented 1 year ago

With

jldsave("example1.jld2", compress=ZlibCompressor(); x=zeros(10_000))

I do not get any compression. The following works fine:

jldopen("example2.jld2", "w"; compress = ZlibCompressor()) do f
    f["large_array"] = zeros(10_000)
end
JonasIsensee commented 1 year ago

Hm, it could be that the docstring is misleading here... Try jldsave("example1.jld2", ZlibCompressor(); x=zeros(10_000))

(without giving a name for the positional argument)

cafaxo commented 1 year ago

Yes, the docstring says

  jldsave(filename, compress=false; kwargs...)

It works without the compress=.