Skip to content

Detect plugins lazily when loading a site from disk - #2862

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lazy-plugin-detection
Aug 10, 2026
Merged

Detect plugins lazily when loading a site from disk#2862
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lazy-plugin-detection

Conversation

@vogella

@vogella vogella commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

SiteEntry.loadFromDisk() eagerly scanned the plugins directory and opened every jar on the site to read its manifest. That happens on the IDE startup path, synchronously on the UI thread: WorkbenchActionBuilder asks for bundle groups to decide whether to contribute the Welcome and Tips and Tricks actions, which builds the PlatformConfiguration and triggers the scan. On a user-reported freeze this burned about 5.5 seconds.

The scan is wasted work there. That path only ever reads feature entries, and every consumer of the plugin data already null-checks pluginEntries and detects on demand, so dropping the eager detectPlugins() call simply defers the cost to whoever actually needs it. The change-stamp bookkeeping is untouched, and a deferred scan still sees pluginEntries == null and performs the same full scan the eager one did. Persistence is unaffected: SiteEntry.toXML writes only site attributes and feature entries, so nothing is lost from platform.xml.

Adds SiteEntryTests, which asserts that features are detected without opening any plugin jar and that plugins are still found on first access.

PlatformConfiguration.reconcile() calls SiteEntry.loadFromDisk(), which
eagerly scanned the plugins directory and opened every jar on the site to
read its manifest. On the IDE startup path this runs synchronously on the
UI thread: WorkbenchActionBuilder asks for bundle groups to decide whether
to contribute the Welcome and Tips and Tricks actions, which builds the
PlatformConfiguration and triggers the scan. Only feature entries are ever
consulted on that path, so the jar scan is wasted work and cost seconds on
installations with many plugins.

Drop the eager detectPlugins() call. Every consumer of the plugin data
already null-checks pluginEntries and detects on demand, and the
persistence path (SiteEntry.toXML) writes only site attributes and feature
entries, so nothing is lost from platform.xml. The change stamp bookkeeping
is untouched, and a deferred scan sees pluginEntries == null exactly as the
eager one did, so it still performs a full scan rather than a timestamp
comparison.
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   58m 52s ⏱️ + 1m 41s
 4 709 tests +2   4 687 ✅ +2   22 💤 ±0  0 ❌ ±0 
12 018 runs  +6  11 865 ✅ +6  153 💤 ±0  0 ❌ ±0 

Results for commit ef2a349. ± Comparison against base commit d4d35c6.

@vogella
vogella marked this pull request as ready for review August 10, 2026 12:48
@vogella
vogella requested a lite review from Copilot August 10, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Eclipse IDE startup responsiveness by deferring expensive plugin-jar scanning when a SiteEntry is loaded from disk. It removes an eager plugin detection step from SiteEntry.loadFromDisk() (which can run synchronously on the UI thread during startup) and relies on the existing lazy, null-checked plugin detection pathways.

Changes:

  • Stop eagerly scanning the plugins/ directory (and opening every jar) during SiteEntry.loadFromDisk().
  • Add JUnit tests to verify features are detected without pre-populating plugin entries, and that plugins are still detected on first access.
  • Wire the new test into the existing automated configurator test suite and add the required JUnit package import.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/SiteEntry.java Removes eager detectPlugins() call during disk load to defer jar scanning until plugin data is requested.
update/org.eclipse.update.configurator.tests/src/org/eclipse/update/internal/configurator/tests/SiteEntryTests.java Adds coverage asserting lazy plugin detection behavior and feature detection without eager plugin population.
update/org.eclipse.update.configurator.tests/src/org/eclipse/update/configurator/tests/AutomatedConfiguratorSuite.java Registers the new test class in the existing JUnit Platform suite.
update/org.eclipse.update.configurator.tests/META-INF/MANIFEST.MF Imports org.junit.jupiter.api.io for @TempDir usage in the new tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@vogella
vogella merged commit ab64a78 into eclipse-platform:master Aug 10, 2026
18 checks passed
@vogella
vogella deleted the lazy-plugin-detection branch August 10, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants