-
Enhancement
-
Resolution: Unresolved
-
P5
-
None
-
None
ZoneOffset instances are cached by the ZoneOffset class for values in the range [-18h, 18h] for each second that is on an even quarter of an hour (i.e. at most 2*18*4+1 = 145 values).
Instead of using a `ConcurrentHashMap` for caching instanced, we could instead use an `AtomicReferenceArray` with direct slot value access for said even seconds. This will improve performance and reduce the number of object even though the backing array will go from an initial 32 in the CHM to 145 in the ARA. The CHM will contain much more objects for typical numbers of entries in the cache and will compute hash/bucket/collision on the hot code path for each cache access.
Instead of using a `ConcurrentHashMap` for caching instanced, we could instead use an `AtomicReferenceArray` with direct slot value access for said even seconds. This will improve performance and reduce the number of object even though the backing array will go from an initial 32 in the CHM to 145 in the ARA. The CHM will contain much more objects for typical numbers of entries in the cache and will compute hash/bucket/collision on the hot code path for each cache access.
- links to
-
Review openjdk/jdk/12346