RFR (S) CR 7177472: JSR292: MethodType interning penalizes scalability
aleksey.shipilev at oracle.com
Sat Jun 8 11:21:28 UTC 2013
(copying hotspot-dev@ back, the patch is theirs)
On 06/08/2013 02:21 PM, Remi Forax wrote:
> in add, the do/while does something a little weird, if putIfAbsent
> returns null, interned is equals to elem, there is no need to do a
> e.get() in that case,
Oh yes, that a nice micro-optimization, relying on the fact $elem is
still strongly reachable.
> The cast to WeakEntry in expungeStaleElements is not needed.
> In WeakEntry.equals, the null check is not needed because null
> instanceof WeakEntry returns false, and you don't need to cast
> obj.get() to a WeakEntry<T> given you only to call equals on
Yup, thanks for the nit-picking this.
> Otherwise, it looks good.
I had also renamed the class to ConcurrentWeakInternSet, to emphasize it
should do interning, not only the caching. The new webrev is here:
- Linux x86_64 builds OK
- Linux x86_64 java/lang/invoke/ jtreg passes OK
- The microbenchmark scores in the original note are still in effect.
More information about the core-libs-dev