Skip to content

entlicher/graal-js-jdk11-maven-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Running GraalJS on stock JDK11

This is a simple maven project that demonstrates how it's possible to run GraalJS on a stock JDK11. The application is a simple JavaScript benchmark embedded in a Java application which compares performance of GraalJS and Nashorn.

Pre requirements

Setup

  • Clone this repository
git clone https://github.com/graalvm/graal-js-jdk11-maven-demo
  • Move to the newly cloned directory
cd graal-js-jdk11-maven-demo
  • Make sure that JAVA_HOME is pointed at a JDK11
export JAVA_HOME=/path/to/jdk11
  • Package the project using Maven
mvn package

Execution

This project provides two execution setups (using the exec-maven-plugin). One uses the Graal compiler to JIT compile JavaScript for better performance, and the other does not and only interprets the JavaScript code. Both executions output benchmark results for GraalJS (via the GraalVM Polyglot API and the Java Scripting API) and Nashorn.

To Execute with Graal run

mvn exec:exec

To Execute without Graal run

mvn exec:exec@nograal

Running on GraalVM

This project is also setup to run on GraalVM. The setup is the same except that your JAVA_HOME should point to a directory contain GraalVM. In this case, execution without Graal is not supported.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%