Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[performance] JDT initialization blocks IDE startup #1860

Open
laeubi opened this issue Dec 17, 2024 · 7 comments
Open

[performance] JDT initialization blocks IDE startup #1860

laeubi opened this issue Dec 17, 2024 · 7 comments
Labels
help wanted Extra attention is needed performance Issues related to performance.

Comments

@laeubi
Copy link
Contributor

laeubi commented Dec 17, 2024

org.eclipse.jdt.ui.StandardJavaElementContentProvider.getParent(Object) calls this code

the existence check currently triggers all classpath containers of all projects to be resolved what is a costly operation and blocks the whole IDE startup procedure see here:

instead one needs a more lightweight check or even always return null as allowed by the API or a better way to determine the parents.

@jukzi
Copy link
Contributor

jukzi commented Dec 17, 2024

I would like to see initialize deferred, but i don't know why you are looking at getPartent() specificly. As far as i understand any line between e4.compatibility and initializeContainer could be blamed:

        at org.eclipse.pde.internal.core.RequiredPluginsInitializer.initialize(RequiredPluginsInitializer.java:50)
        at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:3209)
        at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:2136)
        at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:3970)
        at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:3127)
        at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:3291)
        at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:2405)
        at org.eclipse.jdt.internal.core.JavaProject.buildStructure(JavaProject.java:488)
        at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
        at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:508)
        at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:228)
        at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:569)
        at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:292)
        at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:278)
        at org.eclipse.jdt.internal.core.PackageFragmentRoot.getKind(PackageFragmentRoot.java:539)
        at org.eclipse.jdt.internal.core.PackageFragment.getKind(PackageFragment.java:367)
        at org.eclipse.jdt.internal.core.PackageFragment.validateExistence(PackageFragment.java:596)
        at org.eclipse.jdt.internal.core.Openable.exists(Openable.java:212)
        at org.eclipse.jdt.internal.core.PackageFragment.exists(PackageFragment.java:189)
        at org.eclipse.jdt.ui.StandardJavaElementContentProvider.exists(StandardJavaElementContentProvider.java:509)
        at org.eclipse.jdt.ui.StandardJavaElementContentProvider.getParent(StandardJavaElementContentProvider.java:246)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaEditorBreadcrumb$JavaEditorBreadcrumbContentProvider.getParent(JavaEditorBreadcrumb.java:354)
        at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.BreadcrumbViewer.buildItemChain(BreadcrumbViewer.java:571)
        at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.BreadcrumbViewer.buildItemChain(BreadcrumbViewer.java:573)
        at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.BreadcrumbViewer.inputChanged(BreadcrumbViewer.java:275)
        at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282)
        at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1636)
        at org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.EditorBreadcrumb.setInput(EditorBreadcrumb.java:168)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaEditorBreadcrumb.setInput(JavaEditorBreadcrumb.java:797)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setBreadcrumbInput(JavaEditor.java:2007)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.showBreadcrumb(JavaEditor.java:1981)
        at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.createPartControl(JavaEditor.java:3119)
        at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.createPartControl(CompilationUnitEditor.java:1526)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:96)
        at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:365)

And there are other usecases where initialize is also called before UI is shown. For example:

Thread [main] (Suspended (breakpoint at line 41 in org.eclipse.pde.internal.core.RequiredPluginsInitializer))	
	org.eclipse.pde.internal.core.RequiredPluginsInitializer.initialize(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) line: 41	
	org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IPath) line: 3209	
	org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) line: 2136	
	org.eclipse.jdt.core.JavaCore.getClasspathContainer(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject) line: 3970	
	org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(org.eclipse.jdt.core.IClasspathEntry[], org.eclipse.jdt.core.IClasspathEntry[], boolean, boolean) line: 3127	
	org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(org.eclipse.jdt.internal.core.JavaModelManager$PerProjectInfo, boolean, boolean) line: 3291	
	org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath() line: 2405	
	org.eclipse.jdt.internal.core.PackageFragmentRoot.getRawClasspathEntry() line: 616	
	org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.internalGetParent(java.lang.Object) line: 381	
	org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(org.eclipse.jdt.core.IJavaElementDelta, java.util.Collection<java.lang.Runnable>) line: 734	
	org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(org.eclipse.jdt.core.IJavaElementDelta, org.eclipse.jdt.core.IJavaElement, java.util.Collection<java.lang.Runnable>) line: 815	
	org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(org.eclipse.jdt.core.IJavaElementDelta, java.util.Collection<java.lang.Runnable>) line: 758	
	org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(org.eclipse.jdt.core.IJavaElementDelta, org.eclipse.jdt.core.IJavaElement, java.util.Collection<java.lang.Runnable>) line: 815	
	org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(org.eclipse.jdt.core.IJavaElementDelta, java.util.Collection<java.lang.Runnable>) line: 758	
	org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.elementChanged(org.eclipse.jdt.core.ElementChangedEvent) line: 139	
	org.eclipse.jdt.internal.core.DeltaProcessor$3.run() line: 1751	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(org.eclipse.jdt.core.IJavaElementDelta, int, org.eclipse.jdt.core.IElementChangedListener[], int[], int) line: 1739	
	org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(org.eclipse.jdt.core.IJavaElementDelta, org.eclipse.jdt.core.IElementChangedListener[], int[], int) line: 1572	
	org.eclipse.jdt.internal.core.DeltaProcessor.fire(org.eclipse.jdt.core.IJavaElementDelta, int) line: 1548	
	org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation(org.eclipse.jdt.internal.core.JavaModelOperation).run(org.eclipse.core.runtime.IProgressMonitor) line: 791	
	org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation(org.eclipse.jdt.internal.core.JavaModelOperation).runOperation(org.eclipse.core.runtime.IProgressMonitor) line: 816	
	org.eclipse.jdt.internal.core.CompilationUnit.becomeWorkingCopy(org.eclipse.jdt.core.IProblemRequestor, org.eclipse.core.runtime.IProgressMonitor) line: 115	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.createFileInfo(java.lang.Object) line: 1015	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider(org.eclipse.ui.editors.text.TextFileDocumentProvider).connect(java.lang.Object) line: 481	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.connect(java.lang.Object) line: 1253	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor(org.eclipse.ui.texteditor.AbstractTextEditor).doSetInput(org.eclipse.ui.IEditorInput) line: 4187	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor(org.eclipse.ui.texteditor.StatusTextEditor).doSetInput(org.eclipse.ui.IEditorInput) line: 262	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor(org.eclipse.ui.texteditor.AbstractDecoratedTextEditor).doSetInput(org.eclipse.ui.IEditorInput) line: 1526	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor(org.eclipse.jdt.internal.ui.javaeditor.JavaEditor).internalDoSetInput(org.eclipse.ui.IEditorInput) line: 2567	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor(org.eclipse.jdt.internal.ui.javaeditor.JavaEditor).doSetInput(org.eclipse.ui.IEditorInput) line: 2540	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(org.eclipse.ui.IEditorInput) line: 1415	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor(org.eclipse.ui.texteditor.AbstractTextEditor).lambda$1(org.eclipse.ui.IEditorInput, org.eclipse.core.runtime.IProgressMonitor) line: 3171	
	org.eclipse.ui.texteditor.AbstractTextEditor$$Lambda.0x000001ea90690000.run(org.eclipse.core.runtime.IProgressMonitor) line: not available	
	org.eclipse.ui.internal.WorkbenchWindow.run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress) line: 2285	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor(org.eclipse.ui.texteditor.AbstractTextEditor).internalInit(org.eclipse.ui.IWorkbenchWindow, org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput) line: 3188	
	org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor(org.eclipse.ui.texteditor.AbstractTextEditor).init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput) line: 3213	
	org.eclipse.ui.internal.EditorReference.initialize(org.eclipse.ui.IWorkbenchPart) line: 353	
	org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor(org.eclipse.ui.internal.e4.compatibility.CompatibilityPart).create() line: 344	
	java.lang.invoke.LambdaForm$DMH.0x000001ea901ae000.invokeVirtual(java.lang.Object, java.lang.Object) line: not available	
	java.lang.invoke.LambdaForm$MH.0x000001ea900b2c00.invoke(java.lang.Object, java.lang.Object) line: not available	
	java.lang.invoke.Invokers$Holder.invokeExact_MT(java.lang.Object, java.lang.Object, java.lang.Object) line: not available	
	jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(java.lang.Object, java.lang.Object[]) line: 153	
	jdk.internal.reflect.DirectMethodHandleAccessor.invoke(java.lang.Object, java.lang.Object[]) line: 103	
	java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 580	
	org.eclipse.e4.core.internal.di.MethodRequestor.execute() line: 56	
	org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(org.eclipse.e4.core.internal.di.AnnotationLookup.AnnotationProxy, java.lang.Object, java.lang.Class<?>, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier, java.util.List<java.lang.Class<?>>) line: 977	
	org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(org.eclipse.e4.core.internal.di.AnnotationLookup.AnnotationProxy, java.lang.Object, java.lang.Class<?>, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier, java.util.List<java.lang.Class<?>>) line: 939	
	org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(java.lang.Object, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier) line: 139	
	org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(java.lang.Class<?>, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier) line: 386	
	org.eclipse.e4.core.internal.di.InjectorImpl.make(java.lang.Class<T>, org.eclipse.e4.core.di.suppliers.PrimaryObjectSupplier) line: 312	
	org.eclipse.e4.core.contexts.ContextInjectionFactory.make(java.lang.Class<T>, org.eclipse.e4.core.contexts.IEclipseContext) line: 203	
	org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(org.osgi.framework.Bundle, org.eclipse.e4.core.contexts.IEclipseContext, org.eclipse.e4.core.contexts.IEclipseContext, org.eclipse.emf.common.util.URI) line: 90	
	org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(java.lang.String, org.eclipse.e4.core.contexts.IEclipseContext, org.eclipse.e4.core.contexts.IEclipseContext) line: 59	
	org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(java.lang.String, org.eclipse.e4.core.contexts.IEclipseContext) line: 42	
	org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object) line: 134	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object) line: 991	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 658	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 1389	
	org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer(org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer).postProcess(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 114	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 676	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.AreaRenderer(org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer).processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 72	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 672	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run() line: 543	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 527	
	org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object) line: 73	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object) line: 991	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 658	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer(org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer).processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 72	
	org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 147	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 672	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer(org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer).processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 72	
	org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 147	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 672	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer(org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer).processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 72	
	org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 147	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 672	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer(org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer).processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 72	
	org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 48	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 672	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 79	
	org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer(org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer).postProcess(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 114	
	org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 61	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 676	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer(org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer).processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 72	
	org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 147	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 672	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer(org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer).processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 72	
	org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(org.eclipse.e4.ui.model.application.ui.MElementContainer<org.eclipse.e4.ui.model.application.ui.MUIElement>) line: 662	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement, java.lang.Object, org.eclipse.e4.core.contexts.IEclipseContext) line: 672	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 762	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run() line: 727	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 47	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(org.eclipse.e4.ui.model.application.ui.MUIElement) line: 711	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run() line: 1079	
	org.eclipse.core.databinding.observable.Realm.runWithDefault(org.eclipse.core.databinding.observable.Realm, java.lang.Runnable) line: 339	
	org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(org.eclipse.e4.ui.model.application.MApplicationElement, org.eclipse.e4.core.contexts.IEclipseContext) line: 1042	
	org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(org.eclipse.e4.ui.model.application.MApplicationElement) line: 153	
	org.eclipse.ui.internal.Workbench.lambda$3(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor, int[]) line: 663	
	org.eclipse.ui.internal.Workbench$$Lambda.0x000001ea901ee3f8.run() line: not available	
	org.eclipse.core.databinding.observable.Realm.runWithDefault(org.eclipse.core.databinding.observable.Realm, java.lang.Runnable) line: 339	
	org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 570	
	org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 173	
	org.eclipse.ui.internal.ide.application.IDEApplication.start(org.eclipse.equinox.app.IApplicationContext) line: 178	
	org.eclipse.equinox.internal.app.EclipseAppHandle.run(java.lang.Object) line: 208	
	org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(java.lang.Object) line: 143	
	org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(java.lang.Object) line: 109	
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.Object) line: 439	
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.String[], java.lang.Runnable) line: 271	
	java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object) line: not available	
	java.lang.invoke.LambdaForm$MH.0x000001ea90005c00.invoke(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object) line: not available	
	java.lang.invoke.LambdaForm$MH.0x000001ea90006000.invokeExact_MT(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object) line: not available	
	jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(java.lang.Object, java.lang.Object[]) line: 155	
	jdk.internal.reflect.DirectMethodHandleAccessor.invoke(java.lang.Object, java.lang.Object[]) line: 103	
	java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 580	
	org.eclipse.equinox.launcher.Main.invokeFramework(java.lang.String[], java.net.URL[]) line: 668	
	org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[]) line: 605	
	org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1481	
	org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1454	

@jukzi jukzi added the performance Issues related to performance. label Dec 17, 2024
@laeubi
Copy link
Contributor Author

laeubi commented Dec 17, 2024

but i don't know why you are looking at getPartent() specificly.

Because it is the first call somewhere in UI and the problem is gone if I comment out this specific line.

e4.compatibility and initializeContainer could be blamed

This is creating the UI (what is hard to delay if we want to see something) the same for a lot of stuff up from there..

PackageExplorerContentProvider.elementChanged might be a candidate I leave it to the decision of the JDT devs where the best entry point is.

And there are other usecases where initialize is also called before UI is shown. For example:

That is sadly the case yes... see for example:

@jukzi
Copy link
Contributor

jukzi commented Dec 17, 2024

A clean solution might asynchronously update the UI once JDT is fully initialized.
But don't expect anybody to work on it, since it "works" and JDT is understaffed. Contributions welcome.

@jukzi jukzi added the help wanted Extra attention is needed label Dec 17, 2024
@jukzi jukzi changed the title [performance] StandardJavaElementContentProvider.getParent(Object) blocks IDE startup [performance] JDT initialization blocks IDE startup Dec 17, 2024
@laeubi
Copy link
Contributor Author

laeubi commented Dec 17, 2024

But don't expect anybody to work on it, since it "works" and JDT is understaffed.

I just noticed many people including you and @vogella are always concerned about IDE startup times and this one can have a huge impact (its not only PDE affected but also m2e and JDT itself) as much stuff is loaded and initialized and as it even blocks the UI thread the loadscreen is also not updated.

So I decided to at least report the problem :-)

@jukzi
Copy link
Contributor

jukzi commented Dec 17, 2024

Thanks for reporting. I definitely would like to see it fixed.

@vogella
Copy link
Contributor

vogella commented Dec 17, 2024

You can also trace the activator startup time per bundle: see https://www.vogella.com/tutorials/EclipsePerformance/article.html#example-tracing-the-startup-time-of-plug-ins

@laeubi
Copy link
Contributor Author

laeubi commented Dec 18, 2024

The activator is not the problem here.

I noticed another undesirable side-effect:

Actually jdt UI plugin has a job that should batch initialize all classpathcontainers for performance reasons with

org.eclipse.jdt.internal.ui.InitializeAfterLoadJob

but because this is an UI Workbench job it is called after the UI is created, due to the calls to the classpath containers already while creating the UI some are already initialized the "slow" way without batching, afterwards the job is run and performs the init of the other containers (if any).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed performance Issues related to performance.
Projects
None yet
Development

No branches or pull requests

3 participants