GraalVM does not seem to have any effect on the start up time


I am trying to get my Clojure program run on GraalVM. The start up time does not seem to improve even when running on GraalVM. It is almost the same as running on JVM which is ~2.38 seconds. I am not sure why this is happening. I have raised an issue here for the same.

I ran it on GraalVM only after creating a native-image.


Generating the native image

Timing on JVM - 1.059

Timing on GraalVM - 1.015


I understand if you want to run Clojure JVM, but an effective way to improve startup speed would be to use CLJS. :slight_smile:


Agreed. I am just wondering why it doesn’t seem to work with GraalVM


GraalVM is “just” a JVM if you use it normally.

Creating a GraalVM native-image is what makes things start faster so you need to create that.

1 Like

Yes,I did that!. I created the binary and ran


Could you elaborate on exactly what you did, and how you checked the start-up time (as opposed to the full execution time of your code)?
If you managed to compile with native-image, and ran the resulting binary, the start-up time should be at least a couple of orders of magnitude faster than firing up a JVM.


Sure! I have edited the post to reflect my exact steps with screen shots.


The problem is that you are getting a fallback image, which falls back to a normal JVM. This means GraalVM could not turn your code into a binary because of some problem and then falls back to a non-native mode. You are running into this issue:
That can be fixed with a workaround:
But hopefully the patch for CLJ-1472 will make it into the next Clojure 1.10.1 release (@alexmiller?).


oh okay :ok_hand:

But the talk about ART(android run time).


the solution for that problem also applies to GraalVM

1 Like

cool, thanks :slight_smile:


Not going to do anything in 1.10.1 - too “big” for the .1, but will consider in 1.11.


Hey, thanks! The workaround worked:)

1 Like