Bug 391127 - Displaying of dialogs slow when XML editors were opened
Summary: Displaying of dialogs slow when XML editors were opened
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Linux
: P3 major with 5 votes (vote)
Target Milestone: 4.3 M4   Edit
Assignee: Bogdan Gheorghe CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 380377 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-04 10:42 EDT by Jörg von Frantzius CLA
Modified: 2013-05-24 09:31 EDT (History)
17 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg von Frantzius CLA 2012-10-04 10:42:43 EDT
On Linux GTK/64bit, opening of the "Find" dialog (Ctrl+F) sometimes is very slow, i.e. multiple seconds, with delay increasing over time of running the same Eclipse process. When taking threaddumps meanwhile, the following shows up:

"main" prio=10 tid=0x00007f6d78009800 nid=0x50e0 runnable [0x00007f6d7fab2000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.swt.internal.gtk.OS._gdk_window_at_pointer(Native Method)
        at org.eclipse.swt.internal.gtk.OS.gdk_window_at_pointer(OS.java:5261)
        at org.eclipse.swt.widgets.Shell.setToolTipText(Shell.java:2421)
        at org.eclipse.swt.widgets.Shell.setToolTipText(Shell.java:2389)
        at org.eclipse.swt.widgets.ToolItem.setToolTipText(ToolItem.java:1193)
        at org.eclipse.swt.widgets.ToolItem.setToolTipText(ToolItem.java:1167)
        at org.eclipse.jface.action.ActionContributionItem.update(ActionContributionItem.java:810)
        at org.eclipse.jface.action.ActionContributionItem$1.propertyChange(ActionContributionItem.java:113)
        at org.eclipse.jface.action.ExternalActionManager$CommandCallback.bindingManagerChanged(ExternalActionManager.java:281)
        at org.eclipse.jface.bindings.BindingManager.fireBindingManagerChanged(BindingManager.java:900)
        at org.eclipse.jface.bindings.BindingManager.setActiveBindings(BindingManager.java:2176)
        at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1742)
        at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:689)
        at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:165)
        at org.eclipse.core.commands.contexts.ContextManager.setActiveContextIds(ContextManager.java:295)
        at org.eclipse.e4.ui.internal.services.ContextContextService.getActiveContextIds(ContextContextService.java:83)
        at org.eclipse.ui.internal.contexts.ContextService.getActiveContextIds(ContextService.java:256)
        at org.eclipse.ui.internal.contexts.ActiveContextSourceProvider.getCurrentState(ActiveContextSourceProvider.java:68)
        at org.eclipse.ui.internal.contexts.ActiveContextSourceProvider.contextManagerChanged(ActiveContextSourceProvider.java:50)
        at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:165)
        at org.eclipse.core.commands.contexts.ContextManager.setActiveContextIds(ContextManager.java:295)
        at org.eclipse.e4.ui.bindings.internal.BindingServiceImpl.setContextIds(BindingServiceImpl.java:237)
        at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
        at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:88)
        at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:107)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:318)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:332)
        at org.eclipse.e4.ui.internal.services.ContextContextService.activateContext(ContextContextService.java:53)
        at org.eclipse.ui.internal.contexts.ContextService$UpdateExpression$1.run(ContextService.java:128)
        at org.eclipse.e4.core.contexts.RunAndTrack.runExternalCode(RunAndTrack.java:53)
        - locked <0x00000000fcef5908> (a org.eclipse.ui.internal.contexts.ContextService$UpdateExpression)
        at org.eclipse.ui.internal.contexts.ContextService$UpdateExpression.changed(ContextService.java:126)
        at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:318)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:332)
        at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:630)
        at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener$2.run(ShellActivationListener.java:120)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.activate(ShellActivationListener.java:117)
        at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.handleEvent(ShellActivationListener.java:73)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1483)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1275)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1300)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1281)
        at org.eclipse.swt.widgets.Shell.filterProc(Shell.java:731)
        at org.eclipse.swt.widgets.Display.filterProc(Display.java:1495)
        at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
        at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2332)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3177)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

This is similar to bug 384590 where performance of switching between editors is affected.
Comment 1 Bogdan Gheorghe CLA 2012-10-04 16:42:07 EDT
Hi Jörg - I'm interested in trying to get to the bottom of this (and the other tabs issue).

Can you tell me exactly the build, JRE and plugins you have installed? I'd like to try to replicate your setup.

Also can you tell me about your workspace setup? What types of projects do you have? (If you are using open source projects I can try to recreate your workspace). What are the steps you take to get to this state? Does it happen right out of the box on startup? Do you have to work for an hour before things slow down? 

These types of bugs are hard to track down so the more data points the better. Thanks!
Comment 2 Jörg von Frantzius CLA 2012-10-05 04:08:09 EDT
Hi Bogdan, great you want to have a look!

The base installation was "Eclipse IDE for Java EE Developers" Juno / Eclipse 4.2, meanwhile updated to SR1 (Build id: 20120920-0800).

"Installed Software" does list the following:

  AnyEditTools	2.4.2.201205131655	AnyEditTools.feature.group	Andrey Loskutov
  Atlassian JIRA Connector (Recommended)	3.0.6.v20120628	com.atlassian.connector.eclipse.jira.feature.group	Atlassian
  Eclipse Checkstyle Plug-in	5.6.0.201209221626	net.sf.eclipsecs.feature.group	http://eclipse-cs.sf.net/
  Eclipse EGit	2.1.0.201209190230-r	org.eclipse.egit.feature.group	Eclipse EGit
  Eclipse EGit Mylyn GitHub Feature	2.1.0.201209190230-r	org.eclipse.mylyn.github.feature.feature.group	Eclipse EGit
  Eclipse IDE for Java EE Developers	1.5.1.20120917-1257	epp.package.jee	null
  Eclipse JGit	2.1.0.201209190230-r	org.eclipse.jgit.feature.group	Eclipse JGit
  EGit Mylyn	2.1.0.201209190230-r	org.eclipse.egit.mylyn.feature.group	Eclipse EGit
  EGit Plug-in Import Support	2.1.0.201209190230-r	org.eclipse.egit.import.feature.group	Eclipse EGit
  FreeMarker IDE	1.2.0.v20120611-1732-H94-Final	org.jboss.ide.eclipse.freemarker.feature.feature.group	JBoss by Red Hat
  m2e - Maven Integration for Eclipse	1.2.0.20120903-1050	org.eclipse.m2e.feature.feature.group	Eclipse.org - m2e
  m2e - slf4j over logback logging (Optional)	1.2.0.20120903-1050	org.eclipse.m2e.logback.feature.feature.group	Eclipse.org - m2e
  Mylyn Context Connector: Java Development	3.8.2.v20120916-1200	org.eclipse.mylyn.java_feature.feature.group	Eclipse Mylyn
  Mylyn Reviews Connector: Gerrit	1.0.2.v20120916-1200	org.eclipse.mylyn.gerrit.feature.feature.group	Eclipse Mylyn
  Mylyn Versions Connector: Git	1.0.2.v20120916-1200	org.eclipse.mylyn.git.feature.group	Eclipse Mylyn
  Oracle Enterprise Pack for Eclipse	2.1.0.201207241647	oracle.eclipse.tools.juno.oepe.product.feature.group	Oracle
  Subversive Revision Graph (Optional)	1.0.0.I20120601-1700	org.eclipse.team.svn.revision.graph.feature.group	Eclipse.org
  Subversive SVN Connectors	3.0.0.I20120818-1700	org.polarion.eclipse.team.svn.connector.feature.group	Polarion Software
  Subversive SVN Integration for the Mylyn Project (Optional)	1.0.0.I20120601-1700	org.eclipse.team.svn.mylyn.feature.group	Eclipse.org
  Subversive SVN JDT Ignore Extensions (Optional)	1.0.0.I20120601-1700	org.eclipse.team.svn.resource.ignore.rules.jdt.feature.group	Eclipse.org
  Subversive SVN Team Provider	1.0.0.I20120818-1700	org.eclipse.team.svn.feature.group	Eclipse.org
  Subversive SVN Team Provider Localization (Optional)	1.0.0.I20120818-1700	org.eclipse.team.svn.nl1.feature.group	Eclipse.org
  Subversive SVN Team Provider Sources	1.0.0.I20120818-1700	org.eclipse.team.svn.source.feature.group	Eclipse.org
  SVNKit 1.3.8 Implementation (Optional)	3.0.0.I20120803-1700	org.polarion.eclipse.team.svn.connector.svnkit16.feature.group	Polarion Software
  SVNKit 1.7.5.v1 Implementation (Optional)	3.0.0.I20120818-1700	org.polarion.eclipse.team.svn.connector.svnkit17.feature.group	Polarion Software
  Tasktop Dev Pro	2.4.1.20120830-0054-RELEASE	com.tasktop.client.pro.feature.group	Tasktop Technologies

The Linux underneath is Kubuntu 12.04 x86_64, with Oracle Java 1.7.0_07 64-Bit.

I'm right experimenting with different workspaces to find out whether it's related to what I have in the workspace, or what kind of editors or open or something like that.
Comment 3 Jörg von Frantzius CLA 2012-10-05 04:44:21 EDT
It's great you asked about the workspace. I can reproduce it by simply opening a second POM editor from m2eclipse. With a single POM editor performance seems normal, but after opening a second things slow down noticeably.

Steps to reproduce
1. download eclipse-jee-juno-SR1-linux-gtk-x86_64.tar.gz
2. install Subversive (from Marketplace)
3. install m2e (from Marketplace)
3. checkout http://svn.apache.org/repos/asf/jackrabbit/trunk
4. open /jackrabbit/pom.xml
5. open /jackrabbit/jackrabbit-spi-commons/pom.xml
6. click the "pom.xml" tab at the bottom of the POM editor
7. press Ctrl+F
8. observe delay
Comment 4 Bogdan Gheorghe CLA 2012-10-05 17:05:16 EDT
Thanks for the comprehensive set of instructions. I was able to reproduce the Find slowness (initial dialog comes up white, then paints after a few seconds).

Will keep you posted on the investigation.

BTW, are you able to provide the same reliable steps to get the tab slowdown? Or does that one happen only intermittently?
Comment 5 Robert Munteanu CLA 2012-10-08 15:12:54 EDT
See also bug 380377 ,there's a profiler screenshot which can indicate the root cause.
Comment 6 Paul Webster CLA 2012-10-10 10:32:29 EDT
*** Bug 380377 has been marked as a duplicate of this bug. ***
Comment 7 Jörg von Frantzius CLA 2012-10-19 10:00:56 EDT
(In reply to comment #4)
> Thanks for the comprehensive set of instructions. I was able to reproduce
> the Find slowness (initial dialog comes up white, then paints after a few
> seconds).

I just found out that it's the XML editor, not m2e, so the setup for reproducing can be reduced: 

1. download eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz , and 
2. install "Eclipse XML Editors and Tools 3.4.1.v201208170345-7H7GFeFDxumUpsw5rgjWnKDrsz0p4ymwjQz00T2S" from Juno update site
3. create two empty XML files and haven them open in editors
4. open *any* dialog, e.g. find dialog (won't open in empty editor), or "About Eclipse SDK"
5. observe delay
Comment 8 Jörg von Frantzius CLA 2012-10-23 03:58:26 EDT
Bogdan do you think this should be assigned to WTP? It would be great if they had some hint on what their mistake was, if any...
Comment 9 Larry Singer CLA 2012-10-30 21:45:33 EDT
This is probably related to bug 385272.
Comment 10 Bryn Cooke CLA 2012-11-02 06:31:44 EDT
Closing all XML editors returns performance to acceptable levels.
Comment 11 Tobias Oberlies CLA 2012-11-02 06:40:49 EDT
I a slightly different setup (using the m2e POM editor which embeds an XML editor), I can see the activation of the toolbar org.eclipse.wst.xml.ui.design.DesignToolBar (defined in org.eclipse.wst.xml.ui/plugin.xml) flicker for a while time. Maybe this helps finding the root cause.
Comment 12 Stephan Herrmann CLA 2012-11-02 12:15:53 EDT
(In reply to comment #11)
> I a slightly different setup (using the m2e POM editor which embeds an XML
> editor), I can see the activation of the toolbar
> org.eclipse.wst.xml.ui.design.DesignToolBar (defined in
> org.eclipse.wst.xml.ui/plugin.xml) flicker for a while time. Maybe this
> helps finding the root cause.

On a co-worker's machine I just observed two toolbar buttons to dance for the 30sec-or-so time of switching between an XML editor and a Java editor: one to toggle grammar constraints and one for refresh. Are those the same buttons you observed flickering?
Comment 13 Stephan Herrmann CLA 2012-11-02 12:23:47 EDT
x-ref: the buttons I saw dancing and the toolbar Tobias mentioned in comment 11 are the same as in bug 391868 comment 9.
Comment 14 Aristides Neto CLA 2012-11-02 16:35:24 EDT
Yes I feel the exact same behavior, It seems that when the XML Editor lost his focus the two buttons start flickering and it take almost 20s to Eclipse get get back to normal, this look like bug 391868
Comment 15 Jörg von Frantzius CLA 2012-11-08 10:23:10 EST
The fix announced in bug 385272 does work! I just downloaded

http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/M20121107-1200/eclipse-SDK-M20121107-1200-linux-gtk-x86_64.tar.gz

and tried to reproduce, but the dialogs now pop up without delay also after opening several XML editors.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=391868#c12 says the fix was provided by Bogdan, so now I'd be really curious what the problem was?
Comment 16 Jörg von Frantzius CLA 2012-11-12 03:43:07 EST
Fixed in M20121107-1200. 

E4 finally became a pleasure to work with :)
Comment 17 Jörg von Frantzius CLA 2012-12-14 03:58:45 EST
For anybody coming across this bug, explanations can be found in http://wiki.eclipse.org/Platform_UI/Juno_Performance_Investigation

(as mentioned in Paul Webster's closing comment of https://bugs.eclipse.org/bugs/show_bug.cgi?id=391868#c48)