[foreign-jextract] [Rev 01] RFR: 8237573: Add a basic call overhead benchmark

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Mar 26 00:33:09 UTC 2020


On Wed, 25 Mar 2020 23:09:50 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Hi,
>> 
>> Per my earlier email [1], this PR adds some basic call overhead benchmarks.
>> 
>> 2 benchmarks are added:
>> - CallOverhead, which measures both an empty and an identity function call.
>> - PointsDistance, which extends the existing points benchmarks with one that measures the distance between 2 points doing
>>   the calculation is C (using a native call).
>> 
>> The latter also shows the difference between passing a pointer to a struct, vs passing a struct by value,
>> PointsDistance.panama_MemoryAddress and PointsDistance.panama_MemorySegment respectively.
>> This acts as a basis to test the coming performance improvements in this area.
>> 
>> Thanks,
>> Jorn
>> 
>> [1] : https://mail.openjdk.java.net/pipermail/panama-dev/2020-March/008007.html
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fixes to run on Linux

Just a minor nit

test/micro/org/openjdk/bench/jdk/incubator/foreign/points/support/PanamaPoint.java line 46:

> 45:     public static final MemoryLayout LAYOUT = MemoryLayout.ofStruct(
> 46:         MemoryLayouts.C_INT.withOrder(ByteOrder.nativeOrder()).withName("x"),
> 47:         MemoryLayouts.C_INT.withOrder(ByteOrder.nativeOrder()).withName("y")

Do we need the 'withOrder' call?

-------------

Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/65


More information about the panama-dev mailing list