Skip to content

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   1h 9m 45s ⏱️ + 9m 56s
 3 633 tests ±0   3 579 ✅ +1   54 💤 ±0  0 ❌  - 1 
10 833 runs  ±0  10 670 ✅ +1  163 💤 ±0  0 ❌  - 1 

Results for commit 52df5ee. ± Comparison against base commit f2cc40b.

♻️ 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.

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 <[email protected]>
@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.

if (cachedArgs != null) {
return cachedArgs;
}

Copy link
Member

Choose a reason for hiding this comment

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

This extra blank line is IMO not necessary after a closing brace.

Suggested change

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.

4 participants