Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 518949

Summary: ResourceWorkingSetsFilter causes huge CPU consumption on projects with a lot of data
Product: [Eclipse Project] Platform Reporter: Jerome Sivadier <jerome.sivadier>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: mauromol
Version: 4.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=530450
Whiteboard: stalebug

Description Jerome Sivadier CLA 2017-06-29 08:25:51 EDT
I've discovered something interesting which is present since a long time (not seemed to be present in Mars release, but I've encountered the behavior since Neon).

Some of my projects contain a lot of auto-generated Java classes (>30k). If I choose in the options:
- Packages presentation: hierarchical
- Group by "working sets"

Then if I try to unfold the first/second/third package level for this plugin, all my CPU is eaten for at least 5 minutes (not the machine fault, SSD + i7 CPU).

I've run a bit of JMC and it seems to be related to the "ResourceWorkingSetFilter#isEnclosed()" method, stack trace is the following:
   java.util.HashMap.get(Object)
      java.util.Collections$SynchronizedMap.get(Object)
         org.eclipse.jdt.internal.core.ExternalFoldersManager.getFolder(IPath)
            org.eclipse.jdt.internal.core.JavaProject.contains(IResource)
               org.eclipse.jdt.internal.core.JavaModel.contains(IResource)
                  org.eclipse.jdt.internal.ui.JavaElementContainmentAdapter.contains(Object, Object, int)
                     org.eclipse.ui.ResourceWorkingSetFilter.isEnclosed(IResource)
                        org.eclipse.ui.ResourceWorkingSetFilter.select(Viewer, Object, Object)

If I untick "Group by: working sets" it becomes instantly super smooth, no more lag or latency.

I'm not sure it's easy to reproduce but I have approx 150 plugins in my workspace with approx 1 million loc inside. Some of these plugins contain >30k Java classes in their src/ folder.

Thanks!
Comment 1 Eclipse Genie CLA 2021-01-28 01:40:30 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.