Skip to content

Instantly share code, notes, and snippets.

@mfikes
Created April 28, 2018 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfikes/f38132afab68d82a9e415179e8101bcd to your computer and use it in GitHub Desktop.
Save mfikes/f38132afab68d82a9e415179e8101bcd to your computer and use it in GitHub Desktop.
ClojureScript unit tests running in the Graal JavaScript engine
$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
GraalVM 1.0.0-rc1 (build 25.71-b01-internal-jvmci-0.42, mixed mode)
$ time js /Users/mfikes/Projects/clojurescript/builds/out-adv/core-advanced-test.js
Testing cljs.apply-test
Testing cljs.primitives-test
Testing cljs.destructuring-test
Testing cljs.new-new-test
Testing cljs.printing-test
Testing cljs.seqs-test
Testing cljs.collections-test
Testing cljs.hashing-test
Testing cljs.core-test
{:result true, :num-tests 10, :seed 1524934709931, :test-var "boolean-test"}
Testing cljs.reader-test
Testing clojure.string-test
{:result true, :num-tests 100, :seed 1524934721150, :test-var "test-cljs-2300"}
Testing clojure.data-test
Testing clojure.walk-test
Testing cljs.letfn-test
Testing cljs.reducers-test
Testing cljs.binding-test
Testing cljs.macro-test
Testing cljs.top-level
Testing cljs.keyword-test
Testing cljs.ns-test
Testing cljs.ns-test.foo
Testing foo.ns-shadow-test
Testing cljs.import-test
Testing cljs.pprint
Testing cljs.spec-test
Testing cljs.spec.test-test
Testing cljs.clojure-alias-test
Testing cljs.hash-map-test
Testing cljs.map-entry-test
Testing cljs.npm-deps-test
Testing cljs.pprint-test
Testing cljs.predicates-test
Testing cljs.syntax-quote-test
Testing cljs.tagged-literals-test
Testing cljs.test-test
Testing static.core-test
Testing cljs.recur-test
Testing cljs.array-access-test
Testing cljs.extend-to-object-test
Ran 402 tests containing 19132 assertions.
0 failures, 0 errors.
real 0m37.416s
user 1m27.718s
sys 0m1.771s
@mfikes
Copy link
Author

mfikes commented Apr 28, 2018

For comparison of relative speed on the same box

JavaScriptCore:

real	0m1.812s
user	0m2.995s
sys	0m0.144s

V8:

real	0m2.174s
user	0m2.591s
sys	0m0.088s

SpiderMonkey:

real	0m7.650s
user	0m10.450s
sys	0m0.914s

ChakraCore:

real	0m4.339s
user	0m5.543s
sys	0m0.301s

Nashorn (1.8.0_172):

real	1m27.462s
user	3m47.466s
sys	0m2.877s

@mfikes
Copy link
Author

mfikes commented Apr 28, 2018

@gunar
Copy link

gunar commented Apr 28, 2018

If Graal offers Java support shouldn't you be able to use Clojure directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment