United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7038542 : Small performace regression in ConcurrentHashMap on c1 since CR 7036559

Details
Type:
Bug
Submit Date:
2011-04-21
Status:
Closed
Updated Date:
2011-06-08
Project Name:
JDK
Resolved Date:
2011-06-08
Component:
core-libs
OS:
generic
Sub-Component:
java.util.concurrent
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
Small performace regression in ConcurrentHashMap on c1 since the integration of CR 7036559: "ConcurrentHashMap footprint and contention improvements".

Paraphrasing Doug's comments:

On ARM/C1, the cost of using Unsafe and the cost of a read fence seem to
both be in the 10-30ns range. Using them together combines cost. I
suspect that the Unsafe cost is actually mainly due to c1 not inlining
the little methods that encapsulate the accesses.

The solution is to manually expand out these for get(). This seems to
balance things out so that the change is performance-neutral or maybe
even a bit faster that the old-CHM, even on ARM. It is not the
first time we've done this for such reasons in collections.

The new-CHM is also 20% faster than old-CHM for #threads==1 on c1 on sparc,
so it looks like it is worth doing (mainly for get and containsKey; others
entail calls anyway). It is no faster on c2 on any machine I have, so is not
likely to make much of a difference in practice (since most systems using
CHMs much will be using c2 anyway) except in helping speed up class loading
etc a bit.

                                    

Comments
EVALUATION

JDK7 Changeset: e9ec52c63a9f
Author:    dl
Date:      2011-04-21 17:00 +0100
URL:       http://hg.openjdk.java.net/jdk7/tl/jdk/rev/e9ec52c63a9f

7038542: Small performace regression in ConcurrentHashMap on c1 since CR 703655
Reviewed-by: chegar

! src/share/classes/java/util/concurrent/ConcurrentHashMap.java
                                     
2011-04-21
EVALUATION

Seems like a good idea.
                                     
2011-04-21



Hardware and Software, Engineered to Work Together