JDK-6982173: Small problem causing thousands of wasted CPU hours

Jan Peter Stotz jpstotz at gmx.de
Thu Jan 24 18:53:26 UTC 2019


Hi.

Unfortunately in my last message I made mistake and mixed up the two 
sections. The main reasons for were first too many coding hours 
yesterday and second I had investigated this issue not yesterday but 
some weeks ago. During the last weeks I searched a way to participate in 
OpenJDK except for some high-traffic mailing list (that is IMHO 
development as it was in the last millennium). Especially the useless 
bug tracker (as it is only a bug viewer) is really not understandable to me.

Federico Peralta Schaffner wrote:
> Now, how have you come to the conclusion that the problem is in the first
> branch of the above if statement, and that it is related to the passed
> collection's implementation details of the remove(Object o) method? I think
> this is not the problem, as elements are removed from this set and not from
> the passed collection.

You are right, the first section is not the problem but the second one 
is. I came to the same conclusion as you did when I first investigated 
this issue.

However I would not call a marker interface HashAccess as it reflects a 
technology not an implementation characteristic. E.g. a TreeSet has an 
access time of O(log(n)) which may also be sufficiently fast enough for 
the second code part of AbstractSet.removeAll() but it's implementation 
does not base on hashing.

Therefore my suggestion is still to simply check if the other collection 
is a Set and only if it is one use the second code part.

Jan

PS: If somebody answers please cc me personally as I only use the digest 
mode of this list.


More information about the core-libs-dev mailing list