Skip to content

Reading the results

Read down a column to compare implementations on the same input. Start with the metric and baseline, then check the spread before acting on a small lead.

Join 1000 words Rate
StringBuffer 49.32K ops/s
join 109.51K ops/s [best] (2.22x faster)
+ operator 3.62K ops/s (13.63x slower)
  • Top-left is the group name: the name you gave group (or compare).
  • The column header is the metric (here Rate), or for matrix, the input of that column.
  • The first row is the default baseline. Other rows show how much faster or slower they are than it, in the same column.
  • [best] marks the best score in a column (lowest time for runtime).
You see Metric Meaning Better is
109.51K ops/s Rate runs per second higher
4.2 Gbps Throughput bits processed per second, from the size you give higher
8.58M chars/s Metric.perSecond('chars') your unit per second higher
9.13 us Runtime time of one run lower

Suffixes: K is thousand, M million, G billion. Times use ns (nanoseconds), us (microseconds), ms (milliseconds) and s; one microsecond is a millionth of a second.

benchmark, compare and matrix show Rate unless you give a size, which switches to Throughput.

Same work twice Rate
first 109.51K ops/s
second 109.66K ops/s [best] (≈ same)

The second row has the higher measured rate. The sample comparison did not detect a significant difference at the configured level (0.05 by default). The mark alone cannot establish that the implementations perform equally. If the difference matters, repeat the run on representative inputs. Markdown and HTML display the same result with a trailing ≈.

With --format=md (or html), cells get a bar and marks:

| Benchmark | Variant | Rate |
| --------------- | ------------ | ------------------------------------------------- |
| Join 1000 words | StringBuffer | `███████░░░░░░░░░` <br> 49.58K ops/s |
| | join | `████████████████` <br> **109.49K ops/s** 🔺2.21x |
| | + operator | `█░░░░░░░░░░░░░░░` <br> 3.61K ops/s 🔻13.72x |
  • The bar shows each value next to the best one; a full bar is the best.
  • Bold is the best value in the column.
  • 🔺2.21x: that many times faster than the baseline row; 🔻: slower.
  • 🌟 marks the best cell when no ratio is shown next to it.

All of these can be changed or turned off with CellStyle.

Sometimes a table ends with a warning:

Warning: "g / fast" takes 0.5 ns per run in "x": its work may have been
optimized away. Return the result from run().
  • Under 1 ns per run. Check that the function returns its result and that the compiler has work to do on each call.
  • Time barely changes as input grows. Check how much of each input the function should visit. Constant time can be expected for an indexed lookup.

measureRate on a benchmark class prints a single line:

+ operator: 8.51M chars/s | 117.55 us/run ±0.4% (2580 runs, 60 samples)
  • 8.51M chars/s: the metric.
  • 117.55 us/run: the representative time of one run, the low end of the batch samples.
  • ±0.4%: the typical batch’s distance from the median, as a fraction of that low end. Under about 2% is steady; above 5%, close other programs and run again.
  • 2580 runs, 60 samples: runs are grouped into samples, and each sample is timed as a whole.

--baseline=FILE adds a table of changes:

Benchmark Before After Change Verdict
Join 1000 words / StringBuffer / Rate 20.27 us 20.38 us +0.5% unchanged
Join 1000 words / join / Rate 9.14 us 9.13 us -0.1% unchanged
Join 1000 words / + operator / Rate 278.56 us 275.28 us -1.2% unchanged
3 unchanged
  • Before / After are times per run, so lower is better and + means slower.
  • Verdict is regression (slower), improvement (faster) or unchanged. A change counts only if it is bigger than the threshold (5% unless you pass --threshold) and passes the significance check when both runs have enough samples. added and removed mark benchmarks found in only one of the runs.
  • Any regression makes the program exit with code 1, which fails a CI job.
OutputMismatchError: "join with spaces" returned word0 word1 word2 ...,
but "join" returned word0word1word2 ...

You ran with --verify and two benchmarks in a group returned different results. Fix the one that is wrong, or leave out --verify if the results are meant to differ.

All guides · Reports and regression checks