RFR: 8287788: reuse intermediate segments allocated during FFM stub invocations [v3]
Matthias Ernst
duke at openjdk.org
Mon Jan 20 17:59:15 UTC 2025
On Mon, 20 Jan 2025 17:22:09 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Matthias Ernst has updated the pull request incrementally with three additional commits since the last revision:
>>
>> - shift api boundary
>> - move bench
>> - revert formatting
>
> test/micro/org/openjdk/bench/java/lang/foreign/CallOverheadByValue.java line 54:
>
>> 52: @State(org.openjdk.jmh.annotations.Scope.Thread)
>> 53: @OutputTimeUnit(TimeUnit.NANOSECONDS)
>> 54: @Fork(value = 1, jvmArgs = {"-Xlog:gc", "--enable-native-access=ALL-UNNAMED", "-Djava.library.path=micro/native"})
>
> FWIW, unfortunately there is no builtin support to run profilers through `make`. I personally have a separate script that runs the benchmarks.jar:
>
>
> ./build/$CONF/images/jdk/bin/java -jar ./build/$CONF/images/test/micro/benchmarks.jar -prof gc AllocTest.alloc_confined
>
>
> (where `$CONF` is your build configuration)
Removed.
> test/micro/org/openjdk/bench/java/lang/foreign/CallOverheadByValue.java line 98:
>
>> 96: (SegmentAllocator) (_, _) -> dest,
>> 97: phi);
>> 98: }
>
> Would it be viable to measure just a single invocation? That way we can remove other things like the `asSlice` call, which might introduce noise.
Done. Numbers are now:
Benchmark Mode Cnt Score Error Units
CallOverheadByValue.byPtr avgt 10 3.291 ? 0.031 ns/op
CallOverheadByValue.byValue avgt 10 5.464 ? 0.007 ns/op
> test/micro/org/openjdk/bench/java/lang/foreign/CallOverheadByValue.java line 99:
>
>> 97: phi);
>> 98: }
>> 99: return points;
>
> I don't think `points` needs to be returned here?
Removed. I wanted to be conservative and give the "blackhole" something to work with, but I guess it can't optimize away an FFM call.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23142#discussion_r1922727695
PR Review Comment: https://git.openjdk.org/jdk/pull/23142#discussion_r1922728050
PR Review Comment: https://git.openjdk.org/jdk/pull/23142#discussion_r1922727507
More information about the core-libs-dev
mailing list