Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix search.matching.MatchLocator.bindings #3418 #3522

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

jukzi
Copy link
Contributor

@jukzi jukzi commented Jan 6, 2025

A map with keys char[] did only find keys by identity (but not by equal characters as needed).

#3418

tested by RunJavaSearchTests

A map with keys char[] did only find keys by identity (but not by equal
characters as needed).

eclipse-jdt#3418

tested by RunJavaSearchTests
@jukzi jukzi added bug Something isn't working performance labels Jan 6, 2025
@iloveeclipse
Copy link
Member

Wouldn't this cause more memory pressure and more GC work by creating new Strings, how often is this code used and in which context? Is this index related? I haven't checked this in the IDE.

@jukzi
Copy link
Contributor Author

jukzi commented Jan 7, 2025

This PR can even reduce memory pressure (and computational effort) as equal char[] are not stored multiple times in the Map. Not only are equal keys avoided but also their TypeBinding values.
Take for example org.eclipse.jdt.core.tests.model.JavaSearchGenericTypeTests.testParameterizedArrayTypeMultipleArguments02()
where "Ljava.lang.String" was stored multiple times in MatchLocator.bindings:
image
The "cache" just did not cache anything.

@jukzi jukzi merged commit bb91fc9 into eclipse-jdt:master Jan 7, 2025
10 checks passed
@jukzi jukzi deleted the MatchLocator.bindings branch January 7, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants