Skip to content

Keep marker attribute access off the UI thread in the markers view - #4304

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:lv/markers-view-ui-thread-cost
Open

Keep marker attribute access off the UI thread in the markers view#4304
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:lv/markers-view-ui-thread-cost

Conversation

@vogella

@vogella vogella commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Profiling a Problems view rebuild (3350 markers, full build of org.eclipse.jface as the marker churn, in-IDE sampler plus JFR) showed three avoidable costs. The severity counts for the view title were computed on the UI thread by calling IMarker.getAttribute again for every entry, which throws a ResourceException for each marker deleted since the gather; they are now computed on the update job and carried into the clone. Collation keys for sorting were recomputed after every update with a fresh Collator per cache miss; one Collator is shared and the previous update's keys are kept for one round. The summary message pattern was re-parsed by MessageFormat on every title update and is now parsed once.

Measured before and after with the same workload, from the two JFR recordings:

metric before after
exceptions thrown through views.markers code 54 (ResourceException plus wrapped IllegalStateException from Markers.getMarkerCounts on the UI thread, IllegalArgumentException inside MessageFormat) 0
exception stacks containing UIUpdateJob.runInUIThread 41 0
allocation samples in MarkerEntry.getCollationKey 96 (largest allocator of the view, about 14 MB weighted) 0
execution samples in MarkerUpdateJob.run 30 7

The last row is not a like-for-like speedup: the dependent auto-build ran 53 s in the baseline and 17 s in the second run, so fewer marker updates happened. The exception and collation rows are per-update effects and hold regardless. The markers view is a small share of a rebuild overall; the point of the change is that the UI thread no longer touches marker attributes or throws for stale markers during builds.

@eclipse-platform-bot

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From f72446f947acb9239b3208694e71a2a64009442f Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Mon, 31 Aug 2026 06:17:55 +0000
Subject: [PATCH] Version bump(s) for 4.42 stream


diff --git a/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
index 32bc975604..94d64b2f96 100644
--- a/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.ide; singleton:=true
-Bundle-Version: 3.23.200.qualifier
+Bundle-Version: 3.23.300.qualifier
 Bundle-Activator: org.eclipse.ui.internal.ide.IDEWorkbenchPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %Plugin.providerName
-- 
2.55.0

Further information are available in Common Build Issues - Missing version increments.

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

Moves marker counting off the UI thread and reduces repeated sorting and formatting allocations.

Changes:

  • Cache severity counts in background updates and clones.
  • Reuse collation keys and a shared Collator.
  • Reuse the parsed summary message format.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Markers.java Computes and clones cached marker counts.
MarkerEntry.java Adds shared collation and prior-generation caching.
ExtendedMarkersView.java Reuses a parsed summary formatter.

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

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Test Results

   858 files  ±0     858 suites  ±0   47m 42s ⏱️ - 4m 27s
 8 217 tests ±0   7 974 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 556 runs  ±0  19 886 ✅ ±0  670 💤 ±0  0 ❌ ±0 

Results for commit 32528c3. ± Comparison against base commit 3e8e23d.

♻️ This comment has been updated with latest results.

@vogella
vogella force-pushed the lv/markers-view-ui-thread-cost branch 3 times, most recently from 11759c7 to d933591 Compare September 3, 2026 06:08
Profiling a rebuild showed three avoidable costs. The severity counts for
the title were computed on the UI thread by calling IMarker.getAttribute
for every entry again, throwing a ResourceException for each marker
deleted since the gather; they are now computed on the update job and
carried into the clone. Collation keys for sorting were recomputed after
every update with a fresh Collator per miss; one Collator is shared and
the previous update's keys are kept for one round. The summary message
pattern was re-parsed by MessageFormat on every title update; it is now
parsed once.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
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.

3 participants