Community
Participate
Working Groups
Since the beginning, PossibleMatchSet.add(PossibleMatch) method uses a map of ObjectVector. Before adding the given possible match to the map, it verifies whether it has been already stored or not. For this, it uses the contains(Object) method of ObjectVector which seek all elements in a linear manner. Usually it should not matter, but when there's a huge number of possible matches (typically for common method/field name search - see bug 102279), it may be a good idea to use an HashSet to decrease the time spent to make this verification. I opened a specific bug instead of including this improvement in bug 102279 fix as this may be not enough to completely address the problem noticed in that bug.
I've tracked down FullSourceWorkspaceSearctTests.testPerfMethod() with yourkit and saw that there's only 360 calls to PossibleMatchSet.add() method for around 1,300 matches found. The time ratio spent in this method reagrding to the search request whole time is only about 0.02% (15ms / 65s) which is definitely negligible and make any improvement absolutely unnecessary...
Verified for 3.4M4.