Community
Participate
Working Groups
Created attachment 282132 [details] RCP 3.x application showing the problem Hello, I'd like to report a performance problem with large layouts in RCP applications on a Windows PC. My example layout (see attachment) has a size of 2550 x 7200 pixels and contains about 1300 children (Texts and Labels). When it is run as a simple Java Application, independent of any RCP application, there is no problem. But if an editor in an RCP application is showing this layout it is extremely slow: it takes several seconds to open, it often freezes when it is scrolled and when switching between editors it can even cause the whole application to hang itself. Where I tested this layout so far: * Java Application (no RCP) => No Problem * 3.x RCP in Eclipse for RCP and RAP Developers Indigo Service Release 2, Build id: 20120216-1857 => No Problem * 3.x RCP in Eclipse for RCP and RAP Developers 2019-09 R (4.13.0), Build id: 20190917-1200 => slow as described above * 4.x RCP in Eclipse for RCP and RAP Developers 2019-09 R (4.13.0), Build id: 20190917-1200 => slow as described above These RCP applications are based on the corresponding Examples available in the New Project Wizard. So obviously there are some changes between the Eclipse version from 2012 and 2019 (in between versions not tested). This problem occurs on Windows systems, not on a Linux system (Mac not tested). In the attachment there is a RCP 3.x application showing the problem. The layout snipped to be run independently as a Java Application is in package test01.test. (I could also add the RCP 4.x application but it seems I can only add one attachment.) Thanks for caring about this problem!
Can you activate UI freeze monitor and post stack traces during the freeze? https://www.vogella.com/tutorials/EclipsePerformance/article.html#eclipse_uifreeze_monitor
If I had to guess - i'd say this is because of the CSS - turn of CSS and it will be as fast as before
It's not the '-cssTheme none' option. Sorry not mentioning it. It made a visible difference on Linux, where it was anyway faster also without that option. But on Windows this option does not make any difference.
(In reply to Lars Vogel from comment #1) > Can you activate UI freeze monitor and post stack traces during the freeze? > https://www.vogella.com/tutorials/EclipsePerformance/article. > html#eclipse_uifreeze_monitor This monitor is activated with default values (Warning: 500 ms, Error: 1000 ms), but the Error Log view does not show any UI freeze messages. Although I can see the 'Not Responding' message in the window title of the application.
(In reply to jule from comment #4) > (In reply to Lars Vogel from comment #1) > > Can you activate UI freeze monitor and post stack traces during the freeze? > > https://www.vogella.com/tutorials/EclipsePerformance/article. > > html#eclipse_uifreeze_monitor > > This monitor is activated with default values (Warning: 500 ms, Error: 1000 > ms), but the Error Log view does not show any UI freeze messages. > Although I can see the 'Not Responding' message in the window title of the > application. If the automatic generation of stack traces is not working, you can try to manually create the stack traces. Check the following page for instructions: https://wiki.eclipse.org/How_to_report_a_deadlock
Created attachment 282206 [details] Dump: Open Editor
well did you try attaching flight recorder to see where time is spent?
(In reply to jule from comment #6) > Created attachment 282206 [details] > Dump: Open Editor (Somehow the text below was not submitted the first time) So what I did: Export the project as RCP product, start the executable with a terminal and hitting Ctrl+Break to get a stack trace at certain points: - During editor open directly after the createPartControl method had finished - During editor open shortly before the editor is actually open - During no response after scrolling - During switching from the empty editor to the editor in question - During switching from the editor in question to the empty editor Which of these is of interest for you? The eclipse.ini file of the exported application looks like this: -consoleLog -cssTheme none -vmargs -XX:+HeapDumpOnOutOfMemoryError
(In reply to Thomas Schindl from comment #7) > well did you try attaching flight recorder to see where time is spent? No, never used this tool. It seems it is only available with a commercial Java-Version.
no it is not anymore, it got opensourced - anyways you need so profiler to see where the time is really spend
From the attached trace its seems that the CSS engine is not disabled. Could you try to disable the CSS engine via plugin_customization.ini by adding: org.eclipse.e4.ui.workbench.renderers.swt/themeEnabled=false
(In reply to Rolf Theunissen from comment #11) > From the attached trace its seems that the CSS engine is not disabled. > > Could you try to disable the CSS engine via plugin_customization.ini by > adding: > > org.eclipse.e4.ui.workbench.renderers.swt/themeEnabled=false I added this line to plugin_customization.ini in plugins\org.eclipse.platform_4.13.0.v20190916-1045 of the eclipse install directory. But there is no change in performance nor in the stack trace.
(In reply to Thomas Schindl from comment #10) > no it is not anymore, it got opensourced - anyways you need so profiler to > see where the time is really spend Which tool do you recommend and where can I get it?
Created attachment 282319 [details] VisualVM profiling: Open Editor From the result of the CPU sampling in VisualVM the time consuming call is org.eclipse.swt.internal.win32.OS.GetProp[native] () which is called by org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles () So the CSS styling is still there (as already seen in the dump before) although * The application is run with the '-cssTheme none' argument * Eclipse has the line org.eclipse.e4.ui.workbench.renderers.swt/themeEnabled=false in plugins\org.eclipse.platform_4.13.0.v20190916-1045\plugin_customization.ini
Just for comparison: On a linux machine the '-cssTheme none' argument works: Without it there are method calls like org.eclipse.e4.ui.css.core.impl.engine.AbstractCSSEngine.applyStyles () in the CPU sampling (consuming only 0.4% of the total time). When setting this css none option there are no calls from org.eclipse.e4.ui.css any more.
Hi Julie, I believe this was fixed in 4.15 (see bug #558227). The issue was also discussed on StackOverflow https://stackoverflow.com/questions/58451881/eclipse-4-ui-slow-css-engine-called-too-often-windows
(In reply to Mike Marchand from comment #16) > Hi Julie, I believe this was fixed in 4.15 (see bug #558227). > > The issue was also discussed on StackOverflow > https://stackoverflow.com/questions/58451881/eclipse-4-ui-slow-css-engine- > called-too-often-windows Yes it's fixed in 4.15. Perfect!!
Still strange that '-cssTheme none' still does perform some work on Window. Jule, I'm a Linux user, can you test the upcoming Gerrit on Windows and tell me if that improves performance?
(In reply to Lars Vogel from comment #18) > Still strange that '-cssTheme none' still does perform some work on Window. > > Jule, I'm a Linux user, can you test the upcoming Gerrit on Windows and tell > me if that improves performance? https://git.eclipse.org/r/#/c/160897/
(In reply to Lars Vogel from comment #19) > (In reply to Lars Vogel from comment #18) > > Still strange that '-cssTheme none' still does perform some work on Window. > > > > Jule, I'm a Linux user, can you test the upcoming Gerrit on Windows and tell > > me if that improves performance? > > https://git.eclipse.org/r/#/c/160897/ Lars, actually, I have no idea how to do that! I never used Gerrit before. I'll try to work with the "How to Contribute" instructions and see how far I get...
(In reply to jule from comment #20) > (In reply to Lars Vogel from comment #19) > > (In reply to Lars Vogel from comment #18) > > > Still strange that '-cssTheme none' still does perform some work on Window. > > > > > > Jule, I'm a Linux user, can you test the upcoming Gerrit on Windows and tell > > > me if that improves performance? > > > > https://git.eclipse.org/r/#/c/160897/ > > Lars, actually, I have no idea how to do that! I never used Gerrit before. > I'll try to work with the "How to Contribute" instructions and see how far I > get... See https://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#exericse-eclipse-user-creation-and-gerrit-server-configuration After this setup use Ctrl+3 Fetch from Gerrit and enter the Gerrit change ID (160897) in the dialog. This will fetch the change. If you add the workspace plug-in to your runtime, the updated version will be used.
Maybe this information is already helpful: With Version 4.15 (on Windows) I don't see any calls from org.eclipse.e4.ui.css in the VisualVM CPU sampling when opening an editor, no matter if the '-cssTheme none' option is set or not.
(In reply to jule from comment #22) > Maybe this information is already helpful: > > With Version 4.15 (on Windows) I don't see any calls from > org.eclipse.e4.ui.css > in the VisualVM CPU sampling when opening an editor, > no matter if the '-cssTheme none' option is set or not. Can you put a breakpoint into PartRenderingEngine and see if the CSS Engine is still called? See https://git.eclipse.org/r/#/c/160897/1/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java
(In reply to Lars Vogel from comment #23) > (In reply to jule from comment #22) > > Maybe this information is already helpful: > > > > With Version 4.15 (on Windows) I don't see any calls from > > org.eclipse.e4.ui.css > > in the VisualVM CPU sampling when opening an editor, > > no matter if the '-cssTheme none' option is set or not. > > Can you put a breakpoint into PartRenderingEngine and see if the CSS Engine > is still called? See > https://git.eclipse.org/r/#/c/160897/1/bundles/org.eclipse.e4.ui.workbench. > swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java My project has no dependency to the plugin org.eclipse.e4.ui.workbench.swt which contains the PartRenderingEngine. So I guess it's not called. It is a RCP 3.x application, not a 4.x one.
(In reply to jule from comment #24) > (In reply to Lars Vogel from comment #23) > > (In reply to jule from comment #22) > > > Maybe this information is already helpful: > > > > > > With Version 4.15 (on Windows) I don't see any calls from > > > org.eclipse.e4.ui.css > > > in the VisualVM CPU sampling when opening an editor, > > > no matter if the '-cssTheme none' option is set or not. > > > > Can you put a breakpoint into PartRenderingEngine and see if the CSS Engine > > is still called? See > > https://git.eclipse.org/r/#/c/160897/1/bundles/org.eclipse.e4.ui.workbench. > > swt/src/org/eclipse/e4/ui/internal/workbench/swt/PartRenderingEngine.java > > My project has no dependency to the plugin > org.eclipse.e4.ui.workbench.swt > which contains the PartRenderingEngine. > > So I guess it's not called. > > It is a RCP 3.x application, not a 4.x one. I just see several calls from org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine in the CPU sampling. It seems I'm misunderstanding the plugin dependency thing here. If I don't see this class in my workspace, how can I set a breakpoint there?
New Gerrit change created: https://git.eclipse.org/r/160897
(In reply to jule from comment #25) > If I don't see this class in my workspace, how can I set a breakpoint there? Ctrl+Shift+T to open it, if you set "Include all plug-ins from target..." via preferences (Windows -> Preferences -> Plug-in Development) tab.
Hi Lars, I should be able to give your Gerrit patch a try as well.
(In reply to Mike Marchand from comment #28) > Hi Lars, I should be able to give your Gerrit patch a try as well. Thanks.
(In reply to Lars Vogel from comment #27) > (In reply to jule from comment #25) > > > If I don't see this class in my workspace, how can I set a breakpoint there? > > Ctrl+Shift+T to open it, if you set "Include all plug-ins from target..." > via preferences (Windows -> Preferences -> Plug-in Development) tab. OK, going into org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.initializeStyling(Display, IEclipseContext) with a breakpoint, I see that String cssTheme = (String) appContext.get(E4Application.THEME_ID); is org.eclipse.e4.ui.css.theme.high-contrast no matter if I use '-cssTheme none' or not. So the lines you changed are not called.
(In reply to jule from comment #30) > with a breakpoint, I see that > String cssTheme = (String) appContext.get(E4Application.THEME_ID); > is > org.eclipse.e4.ui.css.theme.high-contrast > no matter if I use '-cssTheme none' or not. Do you have a high contrast theme selected in Windows? When the high contrast mode is detected, the theme selection in E4Application#setCSSContextVariables always selects the high-contrast theme. Probably, it should only change the 'default' to high-contrast, i.e., only select high-contrast when no theme is provided.
(In reply to Rolf Theunissen from comment #31) > Do you have a high contrast theme selected in Windows? > Yes.
Just checked performance with and without high-contrast theme selected in Windows and with and without the css none option: Eclipse 4.13: high-contrast selected | not selected css default slow | slow css none slow | fast Eclipse 4.15: high-contrast selected | not selected css default fast | fast css none fast | fast So in 4.15 all cases are fast, in 4.13 it is only fast when no high-contrast is selected and css none option is set. There is no difference between the two version for String cssTheme = (String) appContext.get(E4Application.THEME_ID); in org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.initializeStyling(Display, IEclipseContext) Eclipse 4.13 / 4.15: high-contrast selected | not selected css default high-contrast | e4_default css none high-contrast | none
Gerrit change https://git.eclipse.org/r/160897 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d552e204f61cdbbe173c8c17efb39e94fed062ff
I merged the small optimization and the theme issue will be handled by Bug 562237. Hence I mark this bug as solved.
Hi Julia, if you are concerned about performance and theming, you can also look at bug 562127, it should have a positive impact on performance of large layouts with many children.
This Windows high-contrast theme is nice to make the screen look mostly black, which i really like. But in the end it makes more problems than benefits (not only with Eclipse). So finally after many years I'll now giving up using it. Anyway, thanks for all your help!