ibpsa / modelica-ibpsa

Modelica library for building and district energy systems developed within IBPSA Project 1
https://ibpsa.github.io/project1
140 stars 83 forks source link

Remove inline=false for Media functions #191

Closed mwetter closed 9 years ago

mwetter commented 9 years ago

I see no reason why they should not be inlined. For example, Modelica.Media.SimpleAir.specificEnthalpy has also no inline annotation.

thorade commented 9 years ago

Maybe it was once Inline=false, LateInline=true as in some other Media functions and someone deleted the LateInline only?

mwetter commented 9 years ago

@thorade : do you see any demonstratable benefit in using Inline=false, LateInline=true rather than no annotation at all?

thorade commented 9 years ago

There can be a speed benefit when using BaseProperties that call a function that defines an annotation derivative (e.g. Modelica.Media.Water.WaterIF97_base.BaseProperties call density_ph, which then calls some function that calls setState_ph; during symbolic manipulation you want the function that defines the annotation derivative, but during simulation you want the inlined function that calls the setState_ph. Another example would be Modelica.Media.Air.ReferenceMoistAir.Utilities.rho_pTx).

That is not the case with Annex60.Media.Air, so removing the annotation as in your commit seems to be just fine.