Opened 9 years ago

Closed 5 years ago

#3743 closed defect (fixed)

Slowness and error in OMEdit error when resizing

Reported by: ceraolo Owned by: sjoelund.se
Priority: blocker Milestone: 1.14.0
Component: Interactive Environment Version: v1.9.4-dev-nightly
Keywords: Cc:

Description (last modified by 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 ceraolo 9 years ago.
ErrorMessage.txt (1.3 MB) - added by ceraolo 9 years ago.

Download all attachments as: .zip

Change History (18)

Changed 9 years ago by ceraolo

Changed 9 years ago by ceraolo

comment:1 Changed 9 years ago by adeas31

  • Component changed from OMEdit to Interactive Environment
  • Owner changed from adeas31 to sjoelund.se
  • Status changed from new to assigned

comment:2 Changed 9 years ago by ceraolo

  • Description modified (diff)
  • Priority changed from high to critical
  • Summary changed from Strange OMEdit error when resizing to Slowness and error in OMEdit error when resizing

comment:3 follow-up: Changed 9 years ago by adeas31

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 Changed 9 years ago by sjoelund.se

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 :)

comment:5 in reply to: ↑ 3 ; follow-up: Changed 9 years ago by ceraolo

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.

comment:6 in reply to: ↑ 5 ; follow-up: Changed 9 years ago by sjoelund.se

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).

comment:7 in reply to: ↑ 6 Changed 9 years ago by ceraolo

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 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.5

Milestone pushed to 1.9.5

comment:9 Changed 9 years ago by ceraolo

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 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.5 to 1.10.0

Milestone renamed

comment:11 Changed 9 years ago by ceraolo

  • Milestone changed from 1.10.0 to 2.0.0
  • Priority changed from critical to blocker

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 Changed 6 years ago by casella

  • Milestone changed from 2.0.0 to 1.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 Changed 6 years ago by casella

  • Milestone changed from 1.13.0 to 1.14.0

Rescheduled to 1.14.0

comment:14 Changed 5 years ago by casella

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

Thanks!

comment:15 Changed 5 years ago by ceraolo

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 Changed 5 years ago by ceraolo

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.