Liking cljdoc? Tell your friends :D

benchmarks.bench


benchclj

(bench f n)

bench receives a function f and an integer n. It runs f n times and reports the total elapsed time as well as the per-operation average time elapsed. It is intended to be called by a higher-level function that will pass in successively higher values of n until a time threshold is crossed.

bench receives a function `f` and an integer `n`.
It runs `f` `n` times and reports the total elapsed
time as well as the per-operation average time elapsed.
It is intended to be called by a higher-level function
that will pass in successively higher values of `n`
until a time threshold is crossed.
sourceraw docstring

benchmarkclj

(benchmark f)

benchmark passes the provided function f to bench with successively higher n values until it has either:

  1. exhausted a reasonable amount of time or
  2. measured enough executions to have an accurate per-operation average. It returns the low-level results of the last call to bench.
benchmark passes the provided function `f` to bench
with successively higher `n` values until it has either:
1. exhausted a reasonable amount of time or
2. measured enough executions to have an accurate
per-operation average.
It returns the low-level results of the last call to bench.
sourceraw docstring

format-durationclj

(format-duration ns)

format-duration turns nanosecond durations, such as those provided by bench and converts them to a microsecond, millisecond, or second value (ie. 32ns, 43.2µs, 54.7ms, 3.1s).

format-duration turns nanosecond durations, such as those provided
by bench and converts them to a microsecond, millisecond, or second
value (ie. 32ns, 43.2µs, 54.7ms, 3.1s).
sourceraw docstring

max-durationclj

source

max-opsclj

source

microsecondclj

source

millisecondclj

source

nanosecondclj

source

reportclj

(report f)

Translates the result of benchmark into more human-readable values. Can be passed to println for a decent report.

Translates the result of benchmark into more human-readable values.
Can be passed to println for a decent report.
sourceraw docstring

second_clj

source

time-itclj

(time-it f n)
source

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

× close