I have a very large array of structs (more than 100k structs) that have to be saved to a file. Later, these have to be loaded and processed one at a time. The current approach is to save it using just save. This takes ~8s to save and ~100s to load.
I've tried a couple of ways to speed this up:
Using the
-v6flags withsave. This sped things up, but not significantly.Serializing and deserializing using
getByteStreamFromArray()andgetArrayFromByteStream()respectively. This had no effect. Specifically, serializing and deserializing took just as long as simply saving and loading.(still working on this) Serializing the array, saving it, loading it, then only deserializing each structure as it is processed (rather than the whole array)
Does anyone have any recommendations to improve performance in this situation? It seems like it would be a common problem.
matfile) is taking just as long (just to callmatfile). That's why I'm looking into serializing it, then deserializing only the needed parts (loading in the entire array as a vector of uint8s is almost instantaneous)