RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees (original) (raw)
Paul Sandoz paul.sandoz at oracle.com
Mon Jun 3 07:56:42 UTC 2013
- Previous message: RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees
- Next message: RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Brent,
On Jun 3, 2013, at 7:56 AM, Brent Christian <brent.christian at oracle.com> wrote:
I went ahead and created a new webrev. It includes this change, and the comment changes suggested by Alan:
A minor thing: take it or leave it :-)
In HashMap:
2207 void addEntry(int hash, K key, V value, int bucketIndex, boolean checkIfNeedTree) { 2208 // assert key != null; 2209 if ((size >= threshold) && (null != table[bucketIndex])) { 2210 resize(2 * table.length); 2211 hash = hash(key); 2212 bucketIndex = indexFor(hash, table.length); 2213 } 2214 createEntry(hash, key, value, bucketIndex, checkIfNeedTree); 2215 }
You could re-verify the bucket size if the table is resized rather than in createEntry, since that AFAICT is the only case where conditions after the call to addEntry might change.
Pau.
- Previous message: RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees
- Next message: RFR 8005698 : Handle Frequent HashMap Collisions with Balanced Trees
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]