bench/decimal_gda tutorial

This page shows how to run the General Decimal Arithmetic benchmarks and how to read their output. The suite compares implementation paths on identical inputs with paired measurements; see the bench tutorial for the toolkit and the artifact format.

I want toUse
run the suitejust bench decimal-gda
read the reported percentagesMAREMARK_HOTSPOT lines
check that the specifications still compilethe plan tests
change workloads or pathsthe *_test.mbt files
understand the statisticsbench design

Quick start

The suite runs from a checkout of the repository; it is not part of the published package, so there is nothing to moon add. From the repository root:

just bench decimal-gda

The runner executes the skipped performance tests of tooling/src/bench/decimal_gda on the native target in release mode and writes .tmp/bench/SUITE.jsonl (all observations) and .tmp/bench/SUITE.analysis.txt (the reduced lines), where SUITE is the name given to just bench.

Everyday tasks

Read the analysis lines

The analysis file contains MAREMARK_HOTSPOT=decimal-gda/OP/DATASET full_pct=…, where DATASET is the index 0 to 4 of the digit counts 1, 9, 18, 34 and 128. This suite has no kernel path, so there is no core_pct: full_pct is the median paired difference between the checked path and the core path, in percent of the core path’s median per-call time. Positive values mean the checked path is slower.

Check the plans without measuring

sh tools/run_moon_clean_exec.sh test tooling/src/bench/decimal_gda --target native

runs only the plan tests, which compile every specification.

Going further

  • Change datasets or implementations in the *_test.mbt files; keep the reference oracle so a faster but wrong path fails the run.
  • Compare two runs only when their recorded environments agree.
  • The performance audit and the performance/ pages summarize measured results.

Common pitfalls

  • Benchmarks are skipped in normal moon test runs; use just bench.
  • Results depend on the machine; percentages are more stable than absolute microseconds.

Next steps