'no assembly is recorded'
Сергей Цыпанов
sergei.tsypanov at yandex.ru
Tue Jan 15 20:52:37 UTC 2019
Thanks for explanation! And why there's no assembly print-out on C1 level as I see it on C2? Even if Array.newInstance is calling into VM right away there eventually should be assembly on the lowest level.
15.01.2019, 22:33, "Aleksey Shipilev" <shade at redhat.com>:
> On 1/15/19 9:19 PM, Сергей Цыпанов wrote:
>> @State(Scope.Thread)
>> @BenchmarkMode(Mode.AverageTime)
>> @OutputTimeUnit(TimeUnit.NANOSECONDS)
>> @Fork(jvmArgsAppend = {"-XX:+UseParallelGC", "-Xms2g", "-Xmx2g"})
>> public class ArrayInstantiationBenchmark {
>>
>> @Param({"10"})
>> private int length;
>>
>> @Benchmark
>> public Object newInstance() {
>> return Array.newInstance(Object.class, length);
>> }
>> }
>>
>> This file contains output for C1: https://yadi.sk/i/DGQuTsvRqdiTkg
>
> So there are entries for "c1, level 1" in there. What you are seeing is Array.newInstance calling
> into VM right away, and the hot spot is there. C2 has the intrinsic for
> java.lang.reflect.Array::newArray.
>
> -Aleksey
More information about the jmh-dev
mailing list