Opened 9 years ago
Closed 6 years ago
#3978 closed defect (fixed)
Front-end becomes slower when running multiple simulations in the same omc session
Reported by: | Francesco Casella | Owned by: | somebody |
---|---|---|---|
Priority: | normal | Milestone: | 2.0.0 |
Component: | MetaModelica | Version: | |
Keywords: | Cc: |
Description
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?
Change History (7)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
What is strange is that it mostly affects the front-end, not the other phases
comment:4 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone moved to 1.12.0 due to 1.11.0 already being released.
comment:5 by , 7 years ago
Component: | Frontend → New Instantiation |
---|---|
Milestone: | 1.12.0 → 2.0.0 |
Owner: | changed from | to
Priority: | high → normal |
Status: | new → assigned |
comment:6 by , 7 years ago
Component: | New Instantiation → MetaModelica |
---|---|
Owner: | changed from | to
Running the simulation of various models multiple times gives me inconsistent results, where different phases in both the frontend (old and new) and the backend sometimes taking up to twice as much time for no reason. I don't think there's much we can do about this, it's most likely just one of the disadvantages of using a GC. But it's not something that the new instantiation is going to fix.
I guess it has to do mostly with GC and memory fragmentation.