Closed nichollsh closed 4 months ago
Related to this...
Some of the plotting functions are also very slow. I've just re-written cpl_global.py
, which has led to a performance improvement of 25x. Making the plot on a near-completed run used to take ~2 mins, but now takes ~4 seconds. This was done by avoiding the use of SPIDER's json files, and just accessing data from the csv file that PROTEUS keeps.
And on this topic, it would probably be optimal to re-frame the way that the helpfile.csv is used. Why constantly save and load the file, when it could just be passed around as a variable? Saving it each iteration makes sense, but loading it again does not.
Currently,
spider.py
makes a lot of file I/O operations which slows down the model increasingly as the simulation progresses. This is because it reads-in all of the prior .json files when doing some of the spider-related stuff. It reads them in several times, depending on the variables being accessed and the calculations being performed, meaning that the performance drops off quickly (super-linearly) with model runtime. It would be a lot faster if they were just read-in once, and then analysed together.