I’m pleased to announce that JLD2 is now ready for testing. Like JLD, it reads and writes Julia objects to disk in an HDF5-compatible format, along with metadata to reconstruct the types if the type definitions are no longer available. Unlike JLD, it does so in pure Julia, without a dependency on the HDF5 C library. For large arrays of immutables, this makes little difference to performance, but for complex data structures, JLD2 typically achieves far greater performance. In fact, it sometimes outperforms Julia’s built-in serializer. Additionally, most issues reported against JLD should be fixed in JLD2.
For now, you should be cautious when using JLD2. Although it has decent test coverage, it hasn’t received the same amount of real-world testing as JLD, so there is some possibility that it won’t be able to correctly read back in the data that it writes. So for now, it’s best to stick to data that you can reconstruct if necessary.
So until that happens, JLD is the recommended way to save Julia objects?
And what about base serialize - do I understand correctly that this is meant for more low-level things?
JLD.jl by default, Base.serialize only when you are really willing to sacrifice compatibility across versions for a small speed gain (which may or may not be significant, you have to benchmark).
Thanks for the answers!
I think we will go with JLD2 because in our case it is possible to restore the state from raw data as well if something really should go wrong.
But I hope JLD2 (as a pure Julia solution) will replace JLD once things stabilize with Julia 0.7.
There is more I believe. As far as I know JLD(2) has trouble storing data structures which in their turn store functions. That is not a problem for serialization. So that would be a significant reason for choosing serialization over JLD(2).