Concerning the best way to write the code, I assume you meant the below?
matwrite(F1, Dict(
“x” => B[:,1],
“y” => B[:,2],
“f” => B[:,3]
); compress = true);
My question is why they use a semicolon, instead of a comma after the dictionary variable? Both seem to work though.
Semicolon can be used to delimit positional arguments from keyword ditto. It’s not necessary here, but both bluestyle and yas recommend it. And there is this feature, where it does matter:
You made MATLAB fast in your pre-Julia days, then you made the same in Julia, just slower… That’s unusual for you.
[I’m really not complaining. your MAT.jl really helped me, port MATLAB code to Julia at my job. It was my first assignment, and I had used MATLAB (or Octave actually) a bit before but never professionally nor Julia.]
It’s probably easy to enable compression for MAT.jl? [Not pushing for it, I don’t need .mat files, they just helped be temporarily while I needed to run both Julia and MATLAB while porting, until I completely got rid of all MATLAB code.]
I didn’t really write MAT.jl, because by the time I helped get HDF5 and JLD off the ground I was pretty solidly in the Julia camp. So why would I need to save *.mat files anymore? Making MAT better is now up to people who need it.
By now, I’m pretty sure the reason MAT files created by Julia are so large is because MAT.jl stores info in the format of a Dictionary, which takes up an order of magnitude more disk space than Arrays or Tuples.
I wonder if they could upgrade the package so that they will use named tuples to store the variables instead. Named tuples takes up as little space as a regular tuple, and is the most efficient of storing variables.
I think HDF5 files (which is what .mat file really is) are compressed by default in Matlab, but not in Julia. Enable compression when writing the file.