Liking cljdoc? Tell your friends :D


A tool to perform benchmarks.


The benchmark is defined using a map, e.g.

(def project (merge
              {::bj/root "benchmarks/fibonacci"
               ::bj/max-duration-seconds 3.0

               ;;::bj/problem-indices [0]
               ;;::bj/try-count 1
               {"clojure" {::bj/name "Clojure"
                           (bj/wrap-fn fibonacci)}
                "cpp" {::bj/name "C++"
                       (bj/wrap-executable "cpp/fibonacci")}}}))

This map defines where the data should be stored, in the ::bj/root key.

Then list the candidate implementations that you want to test in the ::bj/candidates map.

Start by building the C++ code:

cd cpp
make fibonacci

Then load example.core in the REPL and evaluate

;; (generate-problem)

to generate a new problem.

To run the benchmarks, call

(bj/run-benchmark project)

There is also some Python3 code under python/ for producing bar and line plots.

To produce plots for this example, do

cd python/

which will result in a bunch of PDF files with prefix tmpfib.


  • Leiningen
  • Python3
  • Matplotlib
  • Pyrsistent


Copyright © 2019 Jonas Östlund

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close