Bug 536905 - [GTK3] Massive drop in performance in Combo.add compared to GTK2
Summary: [GTK3] Massive drop in performance in Combo.add compared to GTK2
Status: CLOSED DUPLICATE of bug 489640
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-07-11 05:56 EDT by Emond Papegaaij CLA
Modified: 2018-07-12 06:08 EDT (History)
2 users (show)

See Also:


Attachments
Eclipse configuration (99.01 KB, text/plain)
2018-07-11 05:56 EDT, Emond Papegaaij CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emond Papegaaij CLA 2018-07-11 05:56:26 EDT
Created attachment 274934 [details]
Eclipse configuration

The resource bundle editor (RBE) constructs a Combo with all (736) available locales when it is opened. On GTK3 this takes 15 seconds to complete whereas it was almost instant on GKT2. The majority of the time is spent adding the locales to the Combo using Combo.add(String):
https://github.com/essiembre/eclipse-rbe/blob/master/eclipse-rbe-plugin/src/com/essiembre/eclipse/rbe/ui/widgets/LocaleSelector.java#L96

The complete stacktrace is:
"main" #1 prio=6 os_prio=0 tid=0x00007f3914012800 nid=0x46fa runnable  [0x00007f391ddf2000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.swt.internal.gtk.GTK._gtk_combo_box_text_insert(Native Method)
        at org.eclipse.swt.internal.gtk.GTK.gtk_combo_box_text_insert(GTK.java:1546)
        at org.eclipse.swt.widgets.Combo.add(Combo.java:181)
        at org.eclipse.swt.widgets.Combo.add(Combo.java:139)
        at com.essiembre.eclipse.rbe.ui.widgets.LocaleSelector.<init>(LocaleSelector.java:96)
        at com.essiembre.eclipse.rbe.ui.editor.locale.NewLocalePage.<init>(NewLocalePage.java:83)
        at com.essiembre.eclipse.rbe.ui.editor.ResourceBundleEditor.createPages(ResourceBundleEditor.java:174)
        at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:153)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:364)
        at jdk.internal.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@10.0.1/DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(java.base@10.0.1/Method.java:564)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:1005)
        at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:970)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:137)
        at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:412)
        at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:331)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:190)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
        at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
        at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:1012)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:778)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:749)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:743)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:727)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:104)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
        at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
        at org.eclipse.swt.widgets.Display.syncExec(Display.java:5831)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:196)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:52)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
        at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:174)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:634)
        at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:598)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:788)
        at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1235)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3277)
        at org.eclipse.ui.internal.WorkbenchPage.access$26(WorkbenchPage.java:3192)
        at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:3174)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:71)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3169)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3133)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3123)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:563)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:518)
        at org.eclipse.ui.internal.ide.handlers.OpenResourceHandler.execute(OpenResourceHandler.java:127)
        at org.eclipse.ui.internal.ide.handlers.OpenResourceHandler.run(OpenResourceHandler.java:182)
        at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:296)
        at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:93)
        at jdk.internal.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@10.0.1/DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(java.base@10.0.1/Method.java:564)
        at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:318)
        at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:252)
        at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:161)
        at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
        at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:204)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:305)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:579)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:648)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:438)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$2(KeyBindingDispatcher.java:381)
        at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:93)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
        at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1721)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1369)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1396)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1379)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1408)
        at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:784)
        at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:3738)
        at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:842)
        at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1986)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:6468)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5904)
        at org.eclipse.swt.internal.gtk.GTK._gtk_main_do_event(Native Method)
        at org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(GTK.java:4084)
        at org.eclipse.swt.widgets.Display.eventProc(Display.java:1383)
        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:1626)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4516)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1170)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1059)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:667)
        at org.eclipse.ui.internal.Workbench$$Lambda$101/1900971551.run(Unknown Source)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:597)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@10.0.1/Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@10.0.1/NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@10.0.1/DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(java.base@10.0.1/Method.java:564)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:656)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:592)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1498)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1471)
Comment 1 Alexander Kurtakov CLA 2018-07-11 06:02:57 EDT
Can you come up with pure SWT snippet to reproduce this? It would save us some time when starting to work on the issue.
Comment 2 Emond Papegaaij CLA 2018-07-11 07:33:10 EDT
I'm not an SWT developer. I merely use Eclipse (and the RBE) for my projects. However, I would say that the file I linked should be very easy to convert to a pure SWT testcase: simply remove all code not related to filling the Combo, which is done at line 96.
Comment 3 Eric Williams CLA 2018-07-11 10:10:17 EDT
Please try with a 4.9 I-build, I believe this was already fixed by bug 489640.
Comment 4 Emond Papegaaij CLA 2018-07-11 10:35:13 EDT
I can confirm that 4.9 is a lot faster than 4.8 when opening RBE.
Comment 5 Alexander Kurtakov CLA 2018-07-12 06:08:47 EDT
(In reply to Emond Papegaaij from comment #4)
> I can confirm that 4.9 is a lot faster than 4.8 when opening RBE.

Marking as duplicate as per this comment.

*** This bug has been marked as a duplicate of bug 489640 ***