Skip to content

A simple library for benchmarking bits of clojure code.

License

Notifications You must be signed in to change notification settings

mdw-cc/clojure-benchmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clojure-benchmarks

cljdoc badge Clojars Project

A simple library for benchmarking bits of clojure code.

Examples

(require '[benchmarks.bench :as bench])

(println "- big reduce:        " (bench/report #(reduce * (range 10000000))))
(println "- int/float division:" (bench/report #(int (/ 101 10))))
(println "- float division:    " (bench/report #(/ 101 10)))
(println "- integer division:  " (bench/report #(quot 101 10)))

Output:

- big reduce:         {:total-ops 10**1, :total-time 3.1s, :per-op-time 314.1ms}
- int/float division: {:total-ops 10**7, :total-time 1.7s, :per-op-time 173ns}
- float division:     {:total-ops 10**7, :total-time 865.0ms, :per-op-time 86ns}
- integer division:   {:total-ops 10**7, :total-time 74.7ms, :per-op-time 7ns}

Dev Utilities

Generate HTML documentation:

$ make docs

Run tests (once):

$ make test

Run Tests (auto-run on-save):

$ make test-auto

Publish to Clojars (runs tests, generates docs, and requires username, deploy token, and GPG key):

$ make publish

About

A simple library for benchmarking bits of clojure code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published