Bug 466718 - Semantic candidates expressions are called twice on a refresh
Summary: Semantic candidates expressions are called twice on a refresh
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-05-07 07:42 EDT by Cedric Brun CLA
Modified: 2018-12-18 04:54 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2015-05-07 07:42:46 EDT
I have 2 diagrams open. When I set the focus on one of this diagram I can see in the Time Profiler View that all semantic candidates expressions have been called twice. It's particularly annoying when the expression is itself a bit slow, because we pay the cost a second time for no reason.

After analysis : it appears the semantic candidate expressions might get evaluated two times as the refresh algorithm starts by checking of the element should change its "actualMapping" and a second time when the delta between the "current" and "new" content is computed.
Comment 1 Cedric Brun CLA 2015-05-11 07:50:57 EDT
After further analysis : semantic candidates expressions which are relying on the fact that "another mapping has refreshed its content already" are not that rare. Introducing a cache is not a valid approach. 
(I'm closing the patchset)

A general solution to this is to tangle the "this element should change it's mapping" logic with the diagram content refresh. That's something we did for the tree representations, so reusing the framework developped for the trees could be a sensible option but in the end it basically means re-implementing the diagram refresh with it which is too risky to undertake now. 

Another option would be to make sure the MappingsUpdater will not call the semantic candidates expressions or not even do anything if we can know upfront (based on the Mapping hierachies) that a change of mapping is impossible for this element. That would definititely reduce the number of "double evaluations".
Comment 2 Eclipse Genie CLA 2015-06-30 07:33:31 EDT
New Gerrit change created: https://git.eclipse.org/r/51093