﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3978	Front-end becomes slower when running multiple simulations in the same omc session	Francesco Casella	somebody	"Try the following test script:
{{{
loadModel(Modelica);getErrorString();
simulate(Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.fullRobot""); getErrorString();
simulate(Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.fullRobot""); getErrorString();
simulate(Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.fullRobot""); getErrorString();
}}}
On my Linux workstation, I get the following statistics (similar results are obtained under Windows):
{{{
    timeFrontend = 2.52863065,
    timeBackend = 2.066548218,
    timeSimCode = 0.30550237,
    timeTemplates = 0.3628526,
    timeCompile = 1.114593528,
    timeSimulation = 3.508818502,

    timeFrontend = 3.725743959,
    timeBackend = 2.228759248,
    timeSimCode = 0.239114848,
    timeTemplates = 0.704168436,
    timeCompile = 1.104611544,
    timeSimulation = 3.449464435,

    timeFrontend = 3.873891418,
    timeBackend = 2.155416396,
    timeSimCode = 0.322995975,
    timeTemplates = 0.366981225,
    timeCompile = 1.159414522,
    timeSimulation = 3.55739262
}}}

On the second run, the front-end takes 50% more time to flatten the very same model, and on the third run another 5% more. On some proprietary models we get an even worse result, e.g. the second run takes three times longer than the first.

In principle the time should be the same, unless the front-end is trying to re-use some old results, in which case this turns out not to be a good idea. I would suggest to discard all old results and restart from scratch. Or maybe this is due to the garbage collection taking all this time to get rid of the old data?"	defect	closed	normal	2.0.0	MetaModelica		fixed		
