Home

Awesome

What is it?

This repository contains the example code, data, and other materials for the JMH and jmh-clojure talk given at a London Clojurians online streaming event on 2020-07-28.

A capture is available on YouTube, and can be found here.

The org-mode presentation slides are available in the slides/ directory.

Run the comparison benchmarks

cd to the root directory and run:

bash run.sh $TOTAL_RUNS

This script will do 10 full runs by default and requires CLI tools (clj) in your $PATH. It usually will take hours to complete (depending on your hardware) and will generate quite a bit of output (edn data), so you may want to pipe it to a file.

The results of running this script on my machine are in results.edn. Samples of which were used in the talk.

Alternatively, you can also run the benchmark suite via Leiningen:

lein bench-all

Or a specific test like:

lein bench :criterium :interleaved

Run the example benchmarks

These require the lein-jmh plugin as described in the talk.

lein compile
lein jmh '{:file "xx-example.edn", #_...}'

Where xx-example.edn is one of the example benchmark data files. Replace #_... with your desired options.

Running the JFR external profiler example requires a recent JDK. I was using OpenJDK 14 on Ubuntu.

More information

Please see the jmh-clojure project for more.

License

Copyright © 2020 Justin Conklin

Distributed under the Eclipse Public License, the same as Clojure.