eclipse-platform / eclipse-platform/eclipse.platform

Full workspace save does unnecessary work on large workspaces

Offen
#2,887 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
performance plan
Vorherrschende Sprache
Java
Sterne
165
Forks
174
Ø Merge
2 T. 8 Std.
Gemergte PRs (30 T.)
22

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit SaveManager.save(FULL_SAVE, ...), und untersuche anschließend visitAndSave, visitAndSnap, resetSnapshots, removeUnusedTreeFiles und saveMetaInfo; vergleiche das Verhalten beim vollständigen Speichern mit der Snapshot-Verfolgung und der parallelen Arbeit pro Projekt. Prüfe beim Messen des Herunterfahrverhaltens auch IDEWorkbenchAdvisor.disconnectFromWorkspace() und SafeFileOutputStream. Als erledigt gilt die Aufgabe, wenn unveränderte Ressourcen redundante Schreibvorgänge vermeiden, unnötige Uhrzeitabfragen reduziert werden, sequenzielle Durchläufe adressiert sind und das Timing von ISaveParticipant sichtbar ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
desktop-dev, performance
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.