Opened 9 years ago

Closed 5 years ago

#3743 closed defect (fixed)

Slowness and error in OMEdit error when resizing

Reported by: massimo ceraolo Owned by: Martin Sjölund
Priority: blocker Milestone: 1.14.0
Component: Interactive Environment Version: v1.9.4-dev-nightly
Keywords: Cc:

Description (last modified by massimo ceraolo)

In some cases resizing of a model in diagram view is very slow.
In the latest nightly build it even creates a huge error message.

I've tested the behaviour using two different versions:
v1.9.4-dev.beta1-101
v1.9.4-dev.beta2-99

Steps to reproduce (using EHPT.mo):
1) load EHPT in OMEdit
2) select FullVehicles|PSecu1
3) using the mouse slightly resize the icon of the large connector EHPT.SupportModels.Conn d
4) OMEdit hangs for a few seconds (both the above versions), then (only the above beta2 version) issues, in the message browser, the huge message (13915 lines) reported in ErrorMessage.txt.

I wonder why resizing is so slow. From my viewpoint it could be an operation carried out directly by OMEdit, without OMC interaction, so I expect it to be very fast.
Whatever the mechanism, the final user expects resizing to be fast since it appears to be just a graphical operation.

In the latest beta the additional issue of the reported error message has appeared.

For me the slowness makes the priority of this ticket "high"; the error message in the beta requires a "critical" priority. That's why I choose the latter.

Attachments (2)

EHPT.mo (294.3 KB ) - added by massimo ceraolo 9 years ago.
ErrorMessage.txt (1.3 MB ) - added by massimo ceraolo 9 years ago.

Download all attachments as: .zip

Change History (18)

by massimo ceraolo, 9 years ago

Attachment: EHPT.mo added

by massimo ceraolo, 9 years ago

Attachment: ErrorMessage.txt added

comment:1 by Adeel Asghar, 9 years ago

Component: OMEditInteractive Environment
Owner: changed from Adeel Asghar to Martin Sjölund
Status: newassigned

comment:2 by massimo ceraolo, 9 years ago

Description: modified (diff)
Priority: highcritical
Summary: Strange OMEdit error when resizingSlowness and error in OMEdit error when resizing

comment:3 by Adeel Asghar, 9 years ago

I wonder why resizing is so slow. From my viewpoint it could be an operation carried out directly by OMEdit, without OMC interaction, so I expect it to be very fast.
Whatever the mechanism, the final user expects resizing to be fast since it appears to be just a graphical operation.

OMEdit's resizing of the Graphical objects is very fast. But we need to sync the updated information with OMC. So OMEdit first do the resizing of the Graphical object and then sens the updated information of the object to OMC. In your case the diff algorithm is failing that is why I assigned it to Martin to have a look.

comment:4 by Martin Sjölund, 9 years ago

And it's slow because you are working with a huge package.mo :) Before Adeel changes that, some operations will be slow. Note that for simple things like resizing, OMEdit should do this work in a thread in the background and possibly queue up operations (all resize, move, graphical annotation things could be queued up in the background). At least on Linux :)

in reply to:  3 ; comment:5 by massimo ceraolo, 9 years ago

OMEdit's resizing of the Graphical objects is very fast. But we need to sync the updated information with OMC.

May I ask why OMC should be aware about the icon size?
Since this information is only of graphical type cannot it be confined to GUI (i.e. OMEdit)?
Would this be possible, the delay and error mentioned in this ticket would instantly disappear.

in reply to:  5 ; comment:6 by Martin Sjölund, 9 years ago

Replying to ceraolo:

May I ask why OMC should be aware about the icon size?
Since this information is only of graphical type cannot it be confined to GUI (i.e. OMEdit)?
Would this be possible, the delay and error mentioned in this ticket would instantly disappear.

I agree, but OMEdit was designed around letting OMC handle the Modelica text (OMEdit does not know where the annotation is or how to update it, so it asks OMC). Any update to the text is sent to OMC, and then in order to not change the text OMC is asked to merge its internal AST with the actual Modelica code that exists (this is relatively slow, but can be done in the background).

in reply to:  6 comment:7 by massimo ceraolo, 9 years ago

Replying to sjoelund.se:

I agree, but OMEdit was designed around letting OMC handle the Modelica text (OMEdit does not know where the annotation is or how to update it, so it asks OMC).

This explains that a lot of operations that one would expect to be immediate require some time to perform. Another example is opening a tree branch (see #2960).
I understand from your words that more background updating of OMC from OMEdit is planned, and this would increase speed. Naturally, background operations are still operations, and cpu time is consumed even if in background.

I also understand from your words that the design of OMEdit you mention cannot be changed, because of adverse cost/benefit ratio.

I'm not able to discuss effectively about this choice; however, at least from my standpoint, it seems a bit tricky, and indeed it has caused that, after several years of development, working with OMEdit appears still "gummy", especially in comparison with other tools.

I mean, OMEdit and and OMC are great for me. But newbies such as my students) immediately note, and maybe complain about, how slow are operations perceived as being very simple such as opening a tree or resizing an icon.

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:9 by massimo ceraolo, 9 years ago

I tried the same resizing on my one-year-plus old OM r25516 and resizing speed is absolutely normal (i.e. quasi-instantaneous), and no error occurs.

comment:10 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:11 by massimo ceraolo, 9 years ago

Milestone: 1.10.02.0.0
Priority: criticalblocker

I think this issue must be considered a blocker for release 2.0.
Considering comment 9 there must be an easy solution.

I will thus change target and priority.

comment:12 by Francesco Casella, 6 years ago

Milestone: 2.0.01.13.0

This should be fine with 1.13.0. We can move it to 1.14.0 if there are good reasons to do so.

comment:13 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0

comment:14 by Francesco Casella, 5 years ago

@ceraolo, can you please check this with -nfAPI and close the ticket if the performance has improved enough?

Thanks!

comment:15 by massimo ceraolo, 5 years ago

Yes, it has improved a lot.
I see that resizing is now cached, so if we resize a lot actual lag occurs only after we finish. This is a much awaited and very welcome improvement.
I'm going to close this ticket.

comment:16 by massimo ceraolo, 5 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.