Disabling The Model History
If you run a model in a loop you can experience a slowdown when the number of iterations increases. This happens only with a large amount of iterations. The increasing memory requirements for storing the model history explains this slowdown. You can see all the operations performed on the model when saving it as an M-file. If you run a model in a loop you do not need to store the model history because it contains the same operations as many times as you have iterations in the loop. The solution is to disable the history recording. To do this, enter the command:
model.hist.disable
When the model history is disabled you no longer see the commands used to set up the model when saving it as an M-file.
The functions mphload and mphopen automatically disables the model history when loading a model.
To activate the model history, enter the command:
model.hist.enable