RFR (S): JEP-142: Reduce Cache Contention on Specified Fields

Vitaly Davidovich vitalyd at gmail.com
Mon Nov 26 04:29:53 PST 2012

Completely agree with this and Doug's earlier reply - java must allow
low-level optimization techniques in order to stay relevant in the high
perf segment.

In this case, the problem (false sharing) is easy to understand (if
someone's willing to learn) and the contended flag has clear semantics on
what it does.  If a java dev has no interest in this technique, then they
simply don't care about @Contended.  If a library dev decided to do this,
then one hopes/expects that they've done the prerequisite investigation
that warrants its use.

I think expecting the JVM to do magic behind the scenes and thus leaving
low level tweaks out would be a mistake.  If anything, I'd welcome more
ability to hint the runtime/JIT if it means more performance can be
squeezed out.


Sent from my phone
On Nov 26, 2012 5:11 AM, "Aleksey Shipilev" <aleksey.shipilev at oracle.com>

> Well, yeah. Hardware specifics leaking into high-level application code,
> that's a fact of life for high-performance code, whatever language is
> concerned.
> -Aleksey.
> On 11/26/2012 02:01 PM, Kirk Pepperdine wrote:
> > I'm not arguing against the optimization, I clearly see the value. I'm
> just suggesting this is not a "Thinking in Java" solution, it's a "Thinking
> in C++" solution. Don't misunderstand, both are valid ways of thinking when
> done in the right context.  ;-)
> >
> > -- Kirk
> >
> > On 2012-11-26, at 9:55 AM, Aleksey Shipilev <aleksey.shipilev at oracle.com>
> wrote:
> >
> >> On 11/26/2012 01:22 AM, Kirk Pepperdine wrote:
> >>> My mantra has always been, measure, don't guess.
> >>
> >> ...said the guy before start guessing about the impact for this
> >> annotation :D
> >>
> >> We know exactly where this helps, and where library developers sorely
> >> need this functionality, so here we are. In a few years, having this
> >> annotation around would help us to understand if that is applicable on
> >> broader scope, and what are the preconditions to be granted while
> >> applying this optimization. Having all that on the table, we could
> >> finally rationalize the budget needed to research and bringing on the
> >> automatic field layout. Before that, it's preposterous to invest several
> >> man-years into developing the optimization now known to be needed in a
> >> handful of cases.
> >>
> >> -Aleksey.
> >

More information about the hotspot-dev mailing list