Skip to content

AbstractBundleContainer.java - Caching & Performance#2059

Merged
vogella merged 1 commit intoeclipse-pde:masterfrom
vogella:abstractbundlecontainer
Dec 3, 2025
Merged

AbstractBundleContainer.java - Caching & Performance#2059
vogella merged 1 commit intoeclipse-pde:masterfrom
vogella:abstractbundlecontainer

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Oct 25, 2025

Optimizations:

  • Line 72: Renamed poorly-named static field hash to fVMArgsCache with proper documentation - much clearer intent
  • Line 229-233: Replaced inefficient loop through hash entries (for (Entry<...> entry : hash.entrySet())) with direct HashMap get() - O(n) → O(1) lookup
  • Line 268, 271: Updated all references to use the renamed fVMArgsCache

Impact:

  • Major performance improvement: Changed from O(n) iteration through all cache entries to O(1) HashMap lookup
  • Better code clarity with descriptive naming
  • No API changes - purely internal optimization

laeubi
laeubi previously requested changes Oct 25, 2025
Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

@vogella I don't think that such "modernization" currently bring us forward, if you absolute want this can you place make sure that:

  1. We can not cover it by cleanup action, if we can, enable them and let it happen automatically
  2. Batch other changes in one PR after cleanups where run.

@vogella
Copy link
Contributor Author

vogella commented Oct 25, 2025

@vogella I don't think that such "modernization" currently bring us forward, if you absolute want this can you place make sure that:

  1. We can not cover it by cleanup action, if we can, enable them and let it happen automatically
  2. Batch other changes in one PR after cleanups where run.

I'm currently not looking into clean-up actions and have no plans to do so. Thanks for the suggestions but AFAIK according to the Eclipse policy you are not entitled to tell other committers how to work.

@vogella
Copy link
Contributor Author

vogella commented Oct 25, 2025

I assume the build will fail (PDE build is currently not working), so I plan to leave this here and return to it, once PDE build are green again.

@laeubi
Copy link
Contributor

laeubi commented Oct 25, 2025

I'm currently not looking into clean-up actions and have no plans to do so. Thanks for the suggestions but AFAIK according to the Eclipse policy you are not entitled to tell other committers how to work.

You can work as you like, but as soon as you open a PR you need to accept to get it reviewed and probably there are some discussion, suggestions and best practices.

For a while we have enabled cleanups to get a consistent codebase and to improve JDT leanups and you even agreed and asked it to rool out to platform, so it feel a bit odd now to complain.

So if cleaning up the codebase is important to you I can only ask to follow what is established as it works on a larger scale and we are already familiar with that and it makes sure the same style is applied also in the future.

@github-actions
Copy link

github-actions bot commented Oct 25, 2025

Test Results

   771 files  ±0     771 suites  ±0   58m 2s ⏱️ + 3m 4s
 3 648 tests ±0   3 594 ✅ ±0   54 💤 ±0  0 ❌ ±0 
10 878 runs  ±0  10 715 ✅ ±0  163 💤 ±0  0 ❌ ±0 

Results for commit e4b5d8d. ± Comparison against base commit ca484e5.

♻️ This comment has been updated with latest results.

Copy link
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

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

This performance optimazation seems useful.

But for my taste this adds too many comments and I also think the commit message isn't suitable.
Instead of listing the changes line-by-line it should give an high level overview over the change and/or explain the rational behind it.
The headline could also be more expressive, like
Speed-up vm-arguments lookup in AbstractBundleContainer or similar.

Due to this style I assume this change is AI generated, isn't it?
I know they are good at generating text, but I think we should still only add what's necessary and avoid what's not. Even comments have to be maintained.

Comment on lines 68 to 70
/**
* Cache for VM arguments to avoid repeated expensive resolution
*/
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment is superflous and should be removed. IMHO comments only should be added if the code itself isn't clear or needs further explaination about its background.
In this case I think the use of this map is is obvious enough and I would just remove this comment.
The renmaing clearly helps to make the purpose obvious.

if (entry.getKey().equals(this)) {
return entry.getValue();
}
// Check cache first for faster lookup
Copy link
Member

Choose a reason for hiding this comment

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

This comment is IMO also superflous.

Suggested change
// Check cache first for faster lookup

@laeubi laeubi dismissed their stale review October 25, 2025 16:07

Obsolete now, hand review over to hannes

@akurtakov
Copy link
Member

A general statement: As much as automated optimizations/cleanups/modernizations/etc. are preferred, if someone feels like doing such a thing manually or via some other tool - It's equally welcome. We can make use of all the improvements in whatever way someone might decide to deliver them.

@vogella vogella force-pushed the abstractbundlecontainer branch from 644da33 to 52df5ee Compare November 2, 2025 11:29
@vogella
Copy link
Contributor Author

vogella commented Nov 2, 2025

Thanks @HannesWell update the PR according to your comments

Copy link
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

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

Thanks for the update.
This looks good to me now.

@vogella vogella force-pushed the abstractbundlecontainer branch from 52df5ee to ccc25ee Compare December 1, 2025 14:10
@eclipse-pde-bot
Copy link
Contributor

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

ui/org.eclipse.pde.core/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 c12c21ce294a2e9cd2ea3fa1a12982ed0b783173 Mon Sep 17 00:00:00 2001
From: Eclipse PDE Bot <pde-bot@eclipse.org>
Date: Mon, 1 Dec 2025 14:16:04 +0000
Subject: [PATCH] Version bump(s) for 4.39 stream


diff --git a/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
index a83a7c3f04..d1d5acc8e3 100644
--- a/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
+++ b/ui/org.eclipse.pde.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %name
 Bundle-SymbolicName: org.eclipse.pde.core; singleton:=true
-Bundle-Version: 3.21.100.qualifier
+Bundle-Version: 3.21.200.qualifier
 Bundle-Activator: org.eclipse.pde.internal.core.PDECore
 Bundle-Vendor: %provider-name
 Bundle-Localization: plugin
-- 
2.51.2

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

@vogella vogella force-pushed the abstractbundlecontainer branch from 034d305 to 4fc765e Compare December 3, 2025 13:11
Optimized the getVMArguments() method by replacing an inefficient O(n)
iteration through all cache entries with a direct O(1) HashMap lookup.
Also renamed the cache field from 'hash' to 'fVMArgsCache' for clarity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vogella vogella force-pushed the abstractbundlecontainer branch from 4fc765e to e4b5d8d Compare December 3, 2025 13:17
@vogella vogella merged commit 2ecbcf2 into eclipse-pde:master Dec 3, 2025
19 checks passed
@vogella vogella deleted the abstractbundlecontainer branch December 3, 2025 14:10
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.

5 participants