Bug 575445

Summary: [performance] Slow java project bulk close
Product: [Eclipse Project] JDT Reporter: Jörg Kubitz <jkubitz-eclipse>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: NEW --- QA Contact:
Severity: minor    
Priority: P3 CC: loskutov
Version: 4.20   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=327471
Whiteboard: stalebug

Description Jörg Kubitz CLA 2021-08-17 04:27:52 EDT
When i close a single Java Project it feels OK (~ 3 seconds). If i close multiple Projects (~500 of them) it feels unnecessary slow (3s*500 = 25minutes):

For every single project i close ALL projects are saved (to workspace\.metadata\.plugins\org.eclipse.jdt.core\variablesAndContainers.dat) i.e. n times the same effort done:

JavaModelManager$VariablesAndContainersSaveHelper.saveProjects(IJavaProject[]) line: 4617	
JavaModelManager$VariablesAndContainersSaveHelper.save(ISaveContext) line: 4477	
JavaModelManager.saveVariablesAndContainers(ISaveContext) line: 4448	
JavaModelManager.saving(ISaveContext) line: 4680	
SaveManager.executeLifecycle(int, ISaveParticipant, SaveContext) line: 387	
SaveManager$1.run() line: 204	
SafeRunner.run(ISafeRunnable) line: 45	
SaveManager.broadcastLifecycle(int, Map<String,SaveContext>, MultiStatus, IProgressMonitor) line: 207	
SaveManager.save(int, boolean, Project, IProgressMonitor) line: 1164	
SaveManager.save(int, Project, IProgressMonitor) line: 1143	
Project.close(IProgressMonitor) line: 197	

Can anybody tell me why closing a single projects requires to save ALL projects? Is there a way to suppress such until i bulk closed all projects? Would be better to save a single time after bulk close.

(There is a similar problem in PDE: closing each single project does always recalculate the whole state)
Comment 1 Andrey Loskutov CLA 2021-08-18 05:33:47 EDT
(In reply to Jörg Kubitz from comment #0)
> Can anybody tell me why closing a single projects requires to save ALL
> projects? Is there a way to suppress such until i bulk closed all projects?
> Would be better to save a single time after bulk close.

See commit b1e3d60e355d081cd7eb3bded0d6e53fd9fb2ceb, bug 327471 comment 7.
Comment 2 Eclipse Genie CLA 2023-08-11 02:27:25 EDT
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.

If you have further information on the current state of the bug, please add it. 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.