eclipse-platform / eclipse-platform/eclipse.platform

Full workspace save does unnecessary work on large workspaces

Open
#2,887 0 comments 0 reactions 0 assignees View on GitHub
performance plan
Dominant language
Java
Stars
165
Forks
174
Avg merge
2d 8h
Merged PRs (30d)
22

Description

During tracing the startup time of Eclipse I noticed that shutdown is also slow.
On a workspace with 756 projects and ~3300 markers the "Saving Workspace" dialog shown by
`IDEWorkbenchAdvisor.disconnectFromWorkspace()` stays up for several seconds on shutdown.

Happens in `SaveManager.save(FULL_SAVE, ...)`, and parts of it are done regardless of
what actually changed:

- `SafeFileOutputStream` commits by copying the temporary file over the target, so the workspace
tree, `.markers` and `.syncinfo` are written twice.
- `visitAndSave` rewrites `.markers` and `.syncinfo` for every project, even when neither changed
since the last full save. The snapshot path already tracks this per resource, the full save does not.
- `visitAndSave` and `visitAndSnap` read the clock four times per visited resource even when no
save trace option is enabled.
- `resetSnapshots`, `removeUnusedTreeFiles` and `saveMetaInfo` walk all projects sequentially doing
file system stats, while `visitAndSave` next to them already runs per project in parallel.
- A slow `ISaveParticipant` is invisible without enabling `-debug`, so third party contributions
cannot be told apart from platform work.

I plan to work on these.

Contributor guide

Open the contributing guide

Research direction

Start with SaveManager.save(FULL_SAVE, ...), then inspect visitAndSave, visitAndSnap, resetSnapshots, removeUnusedTreeFiles, and saveMetaInfo; compare full-save behavior with snapshot tracking and the parallel per-project work. Check IDEWorkbenchAdvisor.disconnectFromWorkspace() and SafeFileOutputStream when measuring shutdown behavior. Done means unchanged resources avoid redundant writes, unnecessary clock reads are reduced, sequential walks are addressed, and ISaveParticipant timing is visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.