Skip to content

Graal AOT is 12x times slower then JVM doing trivial native calls #2873

@kirillp

Description

@kirillp

Assume we need to communicate with "C", and we dont need complex JNI like call a method
Assume the following code:
static native int call(int[] arr);

Testsource code:

JniTest.cpp
JniTest.java

Build commands
native-image.cmd --no-fallback -cp . test.JniTest
cl /I%JAVA_HOME%\include /I%JAVA_HOME%\include\win32 /LD /O1 /FAs JniTest.cpp /link /noentry

  • GraalVM version graalvm-ce-java11-20.2.0
  • JDK major version: 14
  • OS: windows
  • Architecture: AMD64

This is my results, numbers is time spent, lower better:
Graal:
min critical: 989800
min non critical: 984400
Jvm
min critical: 84200
min non critical: 558200

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions