﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4033	Default clang flags for faster build time	Francesco Casella	Adeel Asghar	"Compare the performance of the ScalableTestSuite when the C code is compared with the flag {{{-Os}}}

https://test.openmodelica.org/libraries/history/ScalableTestSuite_Experimental/ScalableTestSuite_Experimental-2016-08-29.html

and with the flag {{{-O0}}}

https://test.openmodelica.org/libraries/history/ScalableTestSuite_Experimental/ScalableTestSuite_Experimental-2016-08-30.html

It is apparent that the clang optimizations cause the C code compilation time to scale as O(N^2^) when using {{{-Os}}}, while it scales as O(N) when using {{{-O0}}}. For larger models, using {{{-Os}}} causes the C code compilation time to blow up to times over one hour, which is totally unacceptable.

The use of {{{-Os}}} leads to a reduction in simulation time between 25% and 50%, which is significant, but almost never pays off if the total build+simulation time is considered. In fact, the only cases when {{{-Os}}} pays off if the total time is considered are the BreakerNetwork and HeatingSystem test cases. In the case of BreakerNetwork, this is only true because the event handling is still very inefficient (the sparse solver is not used for event processing), so the simulation time grows very quickly.

I would therefore suggest changing the default optimization flag to {{{-O0}}}, at least until #3964 is implemented. Once the C source code is split in more smaller files, the situation might need to be reconsidered.
"	enhancement	closed	critical		Run-time		fixed		Adeel Asghar jean-philippe.tavella@… Andrea Bartolini massimo ceraolo
