Proposal: Support for GraalVM Native #3958
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset proposes support for invocation of Closure Compiler on the command line, via a GraalVM Native Image binary.
Using the
rules_graal
package, there is now a target for the compiler in native binary form. Downstream, projects can load a bzl file to download a binary distribution for their platform, and run Closure in their own projects without needing to build the compiler.Included is a small benchmark tool which compares a fresh native vs. JVM copy on your own system. In preliminary tests (in
SIMPLE
mode only, for now), macOS M1 sees about 70% faster compile time versus execution through a JVM.Enclosed arch support:
Building and testing
Clone with:
Build with:
Benchmark with:
Impact & Benchmark results
Impact to the Bazel build: about 60s. About 3s if the non-native compiler is built directly. Running a
SIMPLE
-mode compilation againstreact
,lodash
, andjquery
, averaged over 50 iterations, is shown below:Test Environment (macOS)
5.1.1
Test Environment (Linux)
5.1.1
Using the binaries in downstream Bazel projects
In your
WORKSPACE
:Then, from inside your project: