This repository was archived by the owner on May 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ # Running GraalJS on stock JDK11
2+
3+ This is a simple maven project that demonstrates how it's possible to run
4+ [ GraalJS] ( http://www.graalvm.org/docs/reference-manual/languages/js/ ) on a
5+ stock JDK11. The application is a simple JavaScript benchmark embedded in a
6+ Java application which compares performance of GraalJS and Nashorn.
7+
8+ ## Pre requirements
9+
10+ - Linux or Mac OS
11+ - [ Maven] ( https://maven.apache.org )
12+ - [ JDK11] ( https://jdk.java.net/11/ )
13+
14+ ## Setup
15+
16+ - Clone this repository
17+ ```
18+ git clone https://github.com/graalvm/graal-js-jdk11-maven-demo
19+ ```
20+
21+ - Move to the newly cloned directory
22+ ```
23+ cd graal-js-jdk11-maven-demo
24+ ```
25+
26+ - Make sure that JAVA_HOME is pointed at a JDK11
27+ ```
28+ export JAVA_HOME=/path/to/jdk11
29+ ```
30+
31+ - Package the project using Maven
32+ ```
33+ mvn package
34+ ```
35+
36+ ## Execution
37+
38+ This project provides two execution setups (using the
39+ [ exec-maven-plugin] ( https://www.mojohaus.org/exec-maven-plugin/ ) ). One uses the
40+ Graal compiler to JIT compile JavaScript for better performance, and the other
41+ does not and only interprets the JavaScript code. Both executions output
42+ benchmark results for GraalJS (via the [ GraalVM Polyglot
43+ API] ( https://www.graalvm.org/truffle/javadoc/index.html?com/oracle/truffle/api/instrumentation/EventContext.html )
44+ and the [ Java Scripting
45+ API] ( https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/prog_guide/api.html ) ) and Nashorn.
46+
47+
48+
49+ To Execute with Graal run
50+ ```
51+ mvn exec:exec@graal
52+ ```
53+
54+ To Execute without Graal run
55+ ```
56+ mvn exec:exec@nograal
57+ ```
You can’t perform that action at this time.
0 commit comments