Hm… Perhaps this is not enough - do we need the entire get/put check to be under one synchronization?
On 29 Sep 2014, at 11:45, Marcus Lagergren <[email protected]> wrote: > OK. New webrev here http://cr.openjdk.java.net/~lagergren/8059321.2/webrev/ > > I experimented a bit with synchronization methods, and this seems to be the > one that gives the least overhead - there is actually very little difference > and 95% of the original performance increase is preserved. > > (I also experimented with your ‘one extra recompile’ in CompiledFunction, and > applied that diff - this brings us down another ~600 ms, which is nice > indeed). > > Let me know if this is semantically sound. From reading the OpenJDK code, I > think it is. > > /M > > > On 29 Sep 2014, at 11:22, Aleksey Shipilev <[email protected]> > wrote: > >> Yes, that's a simple adapter: >> http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#newSetFromMap(java.util.Map) >> >> See the example there. >> >> -Aleksey. >> >> On 09/29/2014 10:10 PM, Marcus Lagergren wrote: >>> Aleksey - I still need the weak semantics, because I don’t want to hold on >>> to the strings. Would that work for the WeakHashMap and preserve semantics? >>> #iamnotajavaprogrammer. >>> >>>> >>>> The entire shenanigan would go away if you turn the Map into Set with >>>> Collections.newSetFromMap(...), and then do add(). >>>> >>>> -Aleksey. >>>> >>>> >>> >> >> >
