﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1509	Modelica.Electrical.Digital needs better performance	Per Östlund	Per Östlund	"The Modelica.Electrical.Digital test case takes 250 seconds for me at the moment. 198 of these are spent in the Absyn.MATRIX case of Static.elabExp, due to the large lookup tables of enumeration literals in Modelica.Electrical.Digital.Interfaces.Tables.

The first thing done in the MATRIX case is to elaborate the expressions in the matrix to get the types of them. This leads to a huge number of instantiations of the Modelica.Electrical.Digital.Interfaces package when the lookup looks for the literals. These types are then used to find out the maximum dimension of the matrix and if it contains Reals or not. This information is then given to elabMatrixSemi, which elaborates all expressions again!

One way of speeding this up would be to rewrite the elaboration of matrices so that the type of the previously elaborated element is available when elaborating an element (except for the first element of course). This can then be used to check that all elements have the same type, and also used to simplify the elaborating of enumeration literals. The type of an enumeration literal contains a list of the literals in the enumeration, so this can be used to construct an enumeration literal without lookup it up with Lookup, as well as confirming that it really is an enumeration literal. The elaboration of arrays should probably be rewritten in the same way."	defect	closed	high	1.9.0	Instantiation	trunk	fixed		Per Östlund
