Skip to content

DO NOT MERGE, brute force change in LocationMap - #2253

Closed
iloveeclipse wants to merge 1 commit into
eclipse-platform:masterfrom
iloveeclipse:issue_2251_brute_force
Closed

iloveeclipse wants to merge 1 commit into
eclipse-platform:masterfrom
iloveeclipse:issue_2251_brute_force

Conversation

@iloveeclipse

Copy link
Copy Markdown
Member

LocationMap should use HashMap for better performance

Fixes #2251

LocationMap should use HashMap for better performance

Fixes eclipse-platform#2251
matching = map;
}
Map<IFileStore, Object> matching = map;
for (Object value : matching.values()) {

@laeubi laeubi Nov 5, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we need to iterate over the entryset here and check that key is actually greater than endpoint if prefixParent != null?

Before we have only passed a subset to the consumer now its always the whole map what makes it feel wrong given the name is "matchingPrefixDo"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Please don't review draft PR's with the prefix "DON'T MERGE".
This one is simply to see if there are any tests available that validate exactly this removed code.
See #2252 (comment)

* Map of FileStore-&gt;IResource OR FileStore-&gt;ArrayList of (IResource)
*/
private final SortedMap<IFileStore, Object> map = new TreeMap<>(IFileStore::compareTo);
private final Map<IFileStore, Object> map = new HashMap<>(10_000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Form the javadoc

Iteration over collection views requires time proportional to the "capacity" of the HashMap instance (the number of buckets) plus its size (the number of key-value mappings). Thus, it's very important not to set the initial capacity too high (or the load factor too low) if iteration performance is important.

Maybe we should start smaller (or use a system property to control the inital size)

@github-actions

github-actions Bot commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Test Results

 1 866 files   -  81   1 866 suites   - 81   1h 24m 45s ⏱️ -57s
 4 581 tests  - 153   4 537 ✅  - 173   24 💤 ±0  14 ❌ +14   6 🔥 + 6 
13 743 runs   - 459  13 507 ✅  - 516  179 💤 ±0  43 ❌ +43  14 🔥 +14 

For more details on these failures and errors, see this check.

Results for commit d1e15a2. ± Comparison against base commit f752dd4.

This pull request removes 153 tests.
AllCompareTests AsyncExecTests ‑ testCancelOnRequeue
AllCompareTests AsyncExecTests ‑ testQueueAdd
AllCompareTests AsyncExecTests ‑ testWorker
AllCompareTests CompareFileRevisionEditorInputTest ‑ testPrepareCompareInputWithNonLocalResourceTypedElements
AllCompareTests CompareUIPluginTest ‑ testFindContentViewerDescriptorForTextType_StreamAccessor
AllCompareTests CompareUIPluginTest ‑ testFindContentViewerDescriptor_TextType_NotStreamAccessor
AllCompareTests CompareUIPluginTest ‑ testFindContentViewerDescriptor_UnknownType
AllCompareTests ContentMergeViewerTest ‑ testFFFX
AllCompareTests ContentMergeViewerTest ‑ testFFTX
AllCompareTests ContentMergeViewerTest ‑ testFFXF
…

@iloveeclipse

Copy link
Copy Markdown
Member Author

Good to know there are tests for this code and they also fail if something is wrong :-)
With that, this PR is not needed anymore, the solution is #2252

@iloveeclipse
iloveeclipse deleted the issue_2251_brute_force branch November 6, 2025 16:26
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.

Project import spends most of the time in AliasManager.computeAliases()

2 participants