Measuring performance changes from applying 4837946 patch
Brian Burkhalter
brian.burkhalter at oracle.com
Wed Jun 5 16:16:18 UTC 2013
On Jun 5, 2013, at 8:26 AM, Aleksey Shipilev wrote:
> Aleksey :
Sorry: I had not finished my first coffee yet.
>
>>> b) the annotations you are using on each method, can flow up to
>>> class-level annotation, and will be inherited by all the @GMB methods;
>>
>> I was not aware of this.
>
> Yes, and with the daizy-fresh JMH, it is even possible to move the
> remaining data upwards to the class level:
> http://mail.openjdk.java.net/pipermail/jmh-dev/2013-June/000074.html
>
>>> c) it is a good idea to initialize the State fields within the @Setup
>>> method, because we guarantee correct initialization JMM-wise (try to run
>>> your benchmark on non-x86 hardware, and you can occasionally see the
>>> NPEs, because genericFactor1/2 might be null; you can also make the same
>>> effect with "final" on fields, but that wouldn't be the generic case).
>>
>> That is good to know also. I read about State Fixtures but did not know
>> of this behavior.
>
> I take that back, the JMH samples are correct. JMH will initialize the
> states with the worker threads, and publish it properly for you. You can
> keep the init the way you have it now. The only culprit is that if State
> is getting reused between the benchmark runs, it is a good idea to
> re-initialize it with @Setup. But, since BigIntegers are "immutable",
> you don't actually care.
Thanks for the further clarifications.
Brian
More information about the core-libs-dev
mailing list