Skip to content

Full workspace save does unnecessary work on large workspaces #2887

Description

@vogella

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceplanPlanned bugs/enhancements for a release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions