Skip to content

Avoid allocations on MarkerEntry cache hits - #4469

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lv/marker-entry-cache-lookup
Oct 11, 2026
Merged

vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lv/marker-entry-cache-lookup

Conversation

@vogella

@vogella vogella commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

The Problems, Tasks and Markers views read cached marker attributes, the location, the path and description collation keys inside every sort comparison. Each of these reads allocated a capturing lambda for the computation and computeIfAbsent allocated a second one, even when the value was already cached, so sorting a large marker list produced garbage proportional to the number of comparisons. This change looks the value up with a plain get first and passes non-capturing compute functions, so a cache hit allocates nothing. The computations themselves are unchanged, only moved into private methods.

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.

🟢 Approval recommended

The focused optimization preserves existing behavior and introduces no unresolved correctness issues.

0 open findings

What changed in this PR

Optimizes marker sorting by eliminating lambda allocations on cache hits while preserving existing computations.

Changes:

  • Adds direct cache lookups before deferred computation.
  • Extracts marker attribute, location, and path computations into private methods.
  • Avoids unnecessary collation-key computation lambdas on hits.
File Description
MarkerEntry.java Introduces allocation-free cache-hit paths for marker values and collation keys.

🧠 Review effort: Balanced


💡 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 Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   50m 7s ⏱️ + 4m 28s
 8 413 tests ±0   8 171 ✅ ±0  242 💤 ±0  0 ❌ ±0 
21 114 runs  ±0  20 431 ✅ ±0  683 💤 ±0  0 ❌ ±0 

Results for commit 6e55229. ± Comparison against base commit 75b5ba7.

♻️ This comment has been updated with latest results.

The markers views read cached marker attributes, the location, the path
and description collation keys inside every sort comparison. Each read
allocated a capturing lambda for the computation, and computeIfAbsent
allocated a second one, even when the value was already cached.

Look the value up with a plain get first and pass non-capturing compute
functions, so a cache hit allocates nothing.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the lv/marker-entry-cache-lookup branch from 00dbea1 to 6e55229 Compare October 11, 2026 10:44
@vogella
vogella merged commit b291672 into eclipse-platform:master Oct 11, 2026
18 checks passed
@vogella
vogella deleted the lv/marker-entry-cache-lookup branch October 11, 2026 18:20
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