﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4601	C-code compilation times are too large for models with many state variables	Francesco Casella	Martin Sjölund	"The ScalableTestSuite contains several models with a moderately high number of state variables (up to 25600, as of today) and a very simple structure, such as a cascade connection of first order systems:
- CascadedFirstOrder
- SimpleAdvection
- AdvectionReaction

The C compilation times shown in the latest [https://libraries.openmodelica.org/branches/master/ScalableTestSuite/ScalableTestSuite.html Hudson report] show both good and bad news. 

The good news is that at least the C compilation time scales linearly. The bad news is that, depending on the specific test case, the C compilation takes between 5 and 12 ms for each state variable. This means that a model with 50.000 state variables, which I think should be perfectly reasonable, would take between 4 and 10 minutes to compile the C sources.

It is true that C source splitting and parallel compilation can help a lot, but yet 10 ms is an awful lot of time for a modern 4 GHz processor. I wonder if such a time is really necessary for each state variable, if the expression of the corresponding derivative is something as simple as {{{1/T*(x[i-1]-x[i])}}}. 

Could we try to streamline the generated code to reduce this substantially, without too much effort?"	defect	new	high		Code Generation				
