eclipse-platform / eclipse-platform/eclipse.platform
Full workspace save does unnecessary work on large workspaces
- Lingua principale
- Java
- Stelle
- 165
- Fork
- 174
- Merge medio
- 2g 8h
- PR unite (30g)
- 22
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con SaveManager.save(FULL_SAVE, ...), poi esamina visitAndSave, visitAndSnap, resetSnapshots, removeUnusedTreeFiles e saveMetaInfo; confronta il comportamento del salvataggio completo con il tracciamento degli snapshot e il lavoro parallelo per progetto. Controlla anche IDEWorkbenchAdvisor.disconnectFromWorkspace() e SafeFileOutputStream durante la misurazione del comportamento in fase di arresto. Il lavoro è completato quando le risorse invariate evitano scritture ridondanti, le letture non necessarie dell’orologio sono ridotte, i percorsi sequenziali sono affrontati e la temporizzazione di ISaveParticipant è visibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- desktop-dev, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100