Bug 442464

Summary: Do not refresh representations which are opened but not visible
Product: [Modeling] Sirius Reporter: Yann Mortier <yann.mortier>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: laurent.redor, matthieu.helleboid, maxime.porhel, pierre-charles.david
Version: 1.0.1Keywords: performance, triaged
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Yann Mortier CLA 2014-08-25 05:41:16 EDT
For the moment the auto-refresh feature refreshes all opened representations when a semantic change occurs. It causes performance problems when many representations are opened.

A basic solution could be to refresh only opened and visible editors (IWorkbenchPage.isPartVisible(IWorkbenchPart)). This solution implies to:
 - refresh a representation when an editor becomes visible and the auto-refresh is enabled
 - not refresh a representation on opening and the auto refresh is enabled (the representation should be refreshed when the editor becomes visible).
Comment 1 Maxime Porhel CLA 2014-09-02 05:12:34 EDT
Note that refreshing a representation on setFocus/setVisible might cause performance issues too. The current behavor can take time to refresh all opened editors, but then the switch to other editors is nearly free. With the proposed behavior, the user might not understand why making an editor visible takes time and make the session dirty.
Comment 2 Laurent Redor CLA 2014-09-03 10:10:02 EDT
With the proposed solution, a new status is needed to know if an editor is already refreshed. Indeed, if a refresh is launched between each editor change (without changes in the model), this will be problematic for performance.
Comment 3 Laurent Redor CLA 2014-09-03 10:13:12 EDT
For information: We have already notice some problems around setFocus notification that is not handled by the same way in different OS (linux, windows, mac). I do not remember in which context but it will have that in mind.
Comment 4 Laurent Redor CLA 2014-09-03 10:15:50 EDT
The method IWorkbenchPage.isPartVisible(IWorkbenchPart) uses LayoutPart.getVisible(): Returns true if this part was set visible. This returns whatever was last passed into setVisible, but does not necessarily indicate that the part can be seen (ie: one of its ancestors may be invisible)...