Skip to content

[Native Image] Bad performance of FFM API #12219

@scf37

Description

@scf37

Describe the Issue

I use FFM to interact with SDL in java game engine. Native version performs about 20 times slower than on the same JVM (400 -> 25 fps drop). I suspect inefficient implementation of native calls.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

java 25 2025-09-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 25+37.1 (build 25+37-LTS-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 25+37.1 (build 25+37-LTS-jvmci-b01, mixed mode, sharing)

Operating System and Version

Linux 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Troubleshooting Confirmation

Run Command

./app

Expected Behavior

runtime performance on par with JVM

Actual Behavior

20x slowdown

Steps to Reproduce

I'm using org.graalvm.buildtools.native Gradle plugin with default configuration and additional jvmArgs.add("--enable-preview")

Additional Context

No response

Run-Time Log Output and Error Messages

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions