Page 1 of 1

identifying contributors to large file size and slow run time

Posted: Thu Apr 28, 2022 10:21 am
by Tim_IEA
Hi All,

Thanks for past help and thanks in advance for future help!

I'm looking to improve the run time of my model and reduce the output file size. I would like to know if there are any tools or means to identify which variables make the biggest contribution to slowing the model down and/or to the output file size.

There are usual suspects I'm addressing (reducing the number of subscripts in variables, vector select instead of sum used as sumproduct) but it would be good to have a more targeted approach across the thousands of variables in the model.

Any other advice is appreciated!
Thanks very much,
Tim

Re: identifying contributors to large file size and slow run time

Posted: Thu Apr 28, 2022 2:29 pm
by Administrator
There is a post on Tom's blog about how to optimize models, these steps can really speed up model execution.
https://metasd.com/2011/01/optimizing-vensim-models/

For saving, all you can really do is use a savelist and play with saveper.

Re: identifying contributors to large file size and slow run time

Posted: Fri Apr 29, 2022 8:00 pm
by tomfid
I probably need to update that post.

Compiled simulation is definitely the most reliable big win. The mdl.bat installed with Vensim now handles most versions of Visual Studio without editing, so it's easy.

File size is strictly proportional to variable count, which tends to be driven mostly by subscript complexity. It's also directly influenced by SAVEPER, so if you can get away with a longer period, you can save a lot of space.

I find VECTOR SELECT gains to be spotty.

One thing that's really expensive is GET DATA functions. These should be wrapped in an Initial() if at all possible.