• This repository has been archived on 22/May/2024
  • Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    Java
  • License
    Universal Permiss...
  • Created about 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An example project how to run Graal/JavaScript on JDK 11 with Graal as optimizing JIT compiler for best performance.

Running Graal.js on stock JDK11

This is a simple maven project that demonstrates how it's possible to run Graal.js on a stock JDK11. The application is a simple JavaScript benchmark embedded in a Java application which compares performance of Graal.js 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 Graal.js (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

The benchmark prints the time per iteration in milliseconds, so lower values are better.

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.

More Repositories

1

graalvm-ce-builds

GraalVM CE binaires built by the GraalVM community
1,552
star
2

sulong

Obsolete repository. Moved to oracle/graal.
Java
628
star
3

simplelanguage

A simple example language built using the Truffle API.
Java
597
star
4

graalvm-demos

This repository contains example applications to illustrate the different capabilities of GraalVM
Java
544
star
5

native-build-tools

Native-image plugins for various build tools
Java
367
star
6

graalvm-ten-things

Top 10 Things To Do With GraalVM
C
232
star
7

homebrew-tap

Ruby
207
star
8

setup-graalvm

GitHub Action for setting up GraalVM distributions.
TypeScript
190
star
9

mx

Command-line tool used for the development of Graal projects.
Python
179
star
10

container

GraalVM container images
166
star
11

graalvm-ce-dev-builds

GraalVM Dev Build Downloads
95
star
12

graal-jvmci-8

Fork of jdk8u/hotspot with support for JVMCI
C++
71
star
13

examples

Java
57
star
14

labs-openjdk-11

Based on jdk11u-dev with included support for libgraal and GraalVM CE.
Java
45
star
15

vscode-extensions

TypeScript
30
star
16

simpletool

A simple example tool built using the Truffle instrumentation API.
Java
28
star
17

openjdk8-jvmci-builder

Travis based builder for JVMCI JDK8 binaries based on OpenJDK8
26
star
18

graal-js-archetype

Java
24
star
19

workshops

A collection of workshops and live labs about GraalVM
Java
24
star
20

labs-openjdk-17

Based on JDK 17 with included support for libgraal and GraalVM CE.
Java
23
star
21

polyglot-embedding-demo

Demonstration repository showing polyglot embedding with GraalVM for JDK 21 using Maven and Gradle.
C
18
star
22

taming-build-time-initialization

Demos for the build-time initialization blog post
Java
17
star
23

mysql-mle-demos

Demos for the MySQL Multi-Lingual Environment
16
star
24

oracle-graalvm-ea-builds

Oracle GraalVM early access builds
Python
14
star
25

graalvm-jdk-downloader

Download the GraalVM JDK with ease.
Shell
13
star
26

graalvm-website

GraalVM: Run Programs Faster Anywhere πŸš€
HTML
8
star
27

graal-js-jdk11-gradle-demo

An example project how to run Graal/JavaScript on JDK 11 with Graal as optimizing JIT compiler for best performance.
Java
8
star
28

CLAMH

CLAMH (Cross-LAnguage Microbenchmark Harness) is a language-independent benchmark harness design and the implementation of that design for different languages.
C++
7
star
29

mandrel-packaging

Java
6
star
30

graalvm.github.io

6
star
31

labs-openjdk-20

JDK 20 fork for building GraalVM CE.
Java
4
star
32

labs-openjdk-15

Based on jdk15u-dev with included support for libgraal and GraalVM CE.
Java
4
star
33

labs-openjdk

JDK fork for building GraalVM CE.
Java
4
star
34

graal-languages-ea-builds

Python
2
star
35

labs-openjdk-16

Based on JDK 16 with included support for libgraal and GraalVM CE.
Java
2
star
36

labs-openjdk-22

JDK 22 fork for building GraalVM CE.
Java
2
star
37

labs-openjdk-19

Based on JDK 19 with included support for libgraal and GraalVM CE.
Java
1
star