-
Enhancement
-
Resolution: Unresolved
-
P5
-
None
-
6
-
Cause Known
-
x86
-
windows_xp
A DESCRIPTION OF THE REQUEST :
In class CoderResult there is a cache, where the cached CoderResult's are indirected via WeakReference.
IMHO this indirection is like breaking a fly on the wheel. CoderResult is a very small object, smaller than a WeakReference itself, so why holding WeakReference objects in the cache, which there self potentially hold the CoderResult.
I also propose to cache the CoderResult objects in an ArrayList by their length value, than in a HashMap.
JUSTIFICATION :
IMHO this indirection is like breaking a fly on the wheel. CoderResult is a very small object, smaller than a WeakReference itself, so why holding WeakReference objects in the cache, which there self potentially hold the CoderResult.
Caching the CoderResult objects in an ArrayList by their length value would result in faster access, than in a HashMap. To avoid large ArrayList, there could be a reasonable threshold for caching CoderResult objects, as length > 6 should rarely occur.
In class CoderResult there is a cache, where the cached CoderResult's are indirected via WeakReference.
IMHO this indirection is like breaking a fly on the wheel. CoderResult is a very small object, smaller than a WeakReference itself, so why holding WeakReference objects in the cache, which there self potentially hold the CoderResult.
I also propose to cache the CoderResult objects in an ArrayList by their length value, than in a HashMap.
JUSTIFICATION :
IMHO this indirection is like breaking a fly on the wheel. CoderResult is a very small object, smaller than a WeakReference itself, so why holding WeakReference objects in the cache, which there self potentially hold the CoderResult.
Caching the CoderResult objects in an ArrayList by their length value would result in faster access, than in a HashMap. To avoid large ArrayList, there could be a reasonable threshold for caching CoderResult objects, as length > 6 should rarely occur.
- relates to
-
JDK-8187653 Lock in CoderResult.Cache becomes performance bottleneck
-
- Resolved
-