From: Doug Lea <###@###.###>
* Compile attached file HashSetTest.java
* Run java -server HashSetTest java.util.HashSet 10 50000
* look at the time for line:
Remove (absent) : 79991
* Uncomment out line 32:
// if (j == 0) t0(s, key, size);
* run again, with time:
Iterator.remove : 536
Times are approx time per operation in nanosec on my ultra80 using b74.
I believe the code triggering this problem is the same as that
from our first exchange (which made me remember John's mail).
It is the lines in java.util.HashMap.remove()
Entry e = removeEntryForKey(key);
return (e == null ? e : e.value);
The commented line above forces a few iterations early on
to execute this with e null.
* Compile attached file HashSetTest.java
* Run java -server HashSetTest java.util.HashSet 10 50000
* look at the time for line:
Remove (absent) : 79991
* Uncomment out line 32:
// if (j == 0) t0(s, key, size);
* run again, with time:
Iterator.remove : 536
Times are approx time per operation in nanosec on my ultra80 using b74.
I believe the code triggering this problem is the same as that
from our first exchange (which made me remember John's mail).
It is the lines in java.util.HashMap.remove()
Entry e = removeEntryForKey(key);
return (e == null ? e : e.value);
The commented line above forces a few iterations early on
to execute this with e null.