Hello all,
In my code, I need to evaluate several functions across an NxN mesh. My code stores the results of these evaluations in an NxNx4x10 array where I would like N=2000.
In principle, I only need to populate this massive array once, and then I can save it and load it again whenever I need it. However, loading the array is actually slower than just reconstructing it by evaluating the functions at all points on the NxN mesh again. Specifically, evaluating a fast approximation of the functions takes 125s. Saving the resulting array takes 270s, and loading takes 2011s, as determined by tic and toc.
I understand that accessing nonvolatile memory is much slower than RAM, even though I am using an SSD, but is it really this slow or is there something wrong with Octave's loading? Even if it's just the slowness of nonvolatile memory, why is loading an order of magnitude slower than saving?