RFR: 8153334: Replace BufferedInputStreams use of AtomicReferenceFieldUpdater with Unsafe
vitalyd at gmail.com
Wed Apr 6 14:52:31 UTC 2016
So are there any bootstrap issues with VH that would preclude using it in
BufferedInputStream? Is that even known at this point? You mentioned that
VH was designed to minimize bootstrapping issues, but where's the
"minimized" line drawn?
On Wed, Apr 6, 2016 at 10:09 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
> > On 6 Apr 2016, at 15:28, forax at univ-mlv.fr wrote:
> > > > While i fully agree in the general case, in disagree for this
> > > > case,
> > > > there are few uses of ARFU inside the JDK (or outside) but currently
> > > > because BufferedInputStream uses an ARFU, each time someone starts a
> > > > application, the VM loads ARFU and its implementation with a high
> > > > probability to no need it at all after
> > > >
> > >
> > > Does that really contribute sufficiently to slow down in start time? It
> > > really seems like a micro-optimisation.
> > small streams become big rivers (i don't know the idiomatic sentence in
> English, so it's a rough translation from a French idiom),
> > "Death by a thousand cuts" is one of my favorites :). A "flat profile"
> is another description of a similar thing.
> I still remain unconvinced in this case that such changes warrant an
> increase in unsafe usage (temporary or otherwise).
> > In general, I agree that easy/cheap/maintainable/etc wins should be done
> even if individually they don't matter much (if that were the requirement,
> there would be no progress whatsoever).
> > In this case, using Unsafe for now seems trivial; when VH is ready,
> someone is going to sweep the code anyway and this will be just one more
> place to mechanically update. Is VH definitely going to be part of Java 9?
> If so, then perhaps no point in making this change unless it's going to be
> backported to Java 8.
> > Also don't forget that releasing VarHandle API as a public API for 9 is
> vastly different from replacing all usages of Unsafe by some VarHandle
> methods inside the JDK, see Paul's answser about the bootstrap issues.
> VHs are now in jdk9/dev. I dunno when it will rise up to the master and
> the next EA build.
More information about the core-libs-dev