[foreign-memaccess+abi] RFR: Benchmark Java to/from C string conversions

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Aug 23 15:19:14 UTC 2023


On Wed, 23 Aug 2023 15:11:39 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This PR adds two benchmark to test performance of Java <-> C string conversions.
> The benchmark is not 100% fair, given that JNI has also to transition from Java to native code, but the trend in the benchmark is nevertheless interesting, showing that JNI string conversion scales very poorly with growing string size.
> 
> Thanks to recent optimizations, FFM string conversion is now competitive even for smaller string sizes.

Here are the numbers I get on my machine.

![image](https://github.com/openjdk/panama-foreign/assets/54672762/2b83e326-0b1b-4685-874f-6950a3bdb9de)

![image](https://github.com/openjdk/panama-foreign/assets/54672762/2b3209d5-ba81-4afc-8017-f6f8226e906a)

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

PR Comment: https://git.openjdk.org/panama-foreign/pull/874#issuecomment-1690146985


More information about the panama-dev mailing list