What problem does it solve?
Benchmarking Clojure code can be unreliable without accounting for JVM warmup, garbage collection, and measurement overhead. Criterium provides a principled approach to obtaining stable timing data and meaningful statistics.
Core Features & Use Cases
- Three-stage pipeline: Collection, Analysis, and View separate timing data gathering, processing, and presentation.
- JVM-aware measurement: Handles warmup and GC to reduce timing noise.
- Multiple bench plans and viewers: Supports distribution analysis, histograms, and various output formats for human or programmatic consumption.
- Domain benchmarking and argument generation: Enables parameterized benchmarks across ranges and test-check generators for robust testing.
- Real-world use: compare two implementations, analyze performance across input sizes, or tune code using measured results.
Quick Start
Install the library, load the bench namespace, and run a simple benchmark to observe timing results.