Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Aggregation benchmark measurements

The suite measures prepare (including aggregate snapshots and grounding) and reason (preparation plus final reasoning) separately. Parsing, fixture creation, and expected-result assertions run outside the timed loops. These are pipeline measurements, not isolated reducer timings; allocation and result destruction are included. Each fixture checks the complete set of positive aggregate outputs through both entry points.

Coverage includes these fixture families:

DimensionValues
Rows, for each of the four named reducers0, 100, 500, 1,000
Groups sharing 500 rows1, 10, 100
Unrelated facts alongside 100 matching rows0–1,000
Aggregate stages with 100 rows and 10 groups1, 2, 4

Unique row IDs preserve repeated equal contributions. Chained stages consume derived results.

Sampling and output

Defaults use 10 samples, 0.5 seconds of warmup, and a 1-second measurement target per case. Expensive cases take longer when their iterations exceed that target. Criterion reports and local baselines reside under target/criterion/.

Initial local baseline

The initial run used an Apple M2, rustc 1.95.0, and the optimized bench profile on 2026-09-13. It used the defaults above with --save-baseline initial. All 50 timed cases passed their output checks. Selected Criterion mean estimates (milliseconds):

FixturePrepareFull reasoning
Sum, 100 rows, 1 group4.377.35
Sum, 1,000 rows, 1 group207.51360.25
Sum, 500 rows, 1 group59.40102.28
Sum, 500 rows, 100 groups164.36236.20
Sum, 100 rows, 1 group, 1,000 unrelated facts192.71343.89
Sum, 100 rows, 10 groups, 1 stage6.179.88
Sum, 100 rows, 10 groups, 4 stages20.3325.23

These short local measurements are a starting point, not portable performance thresholds. Row and unrelated-fact scaling warrant profiling. The measurements include grounding and reasoning costs, so they do not establish that fold scans alone cause the growth. Increasing group count also adds group facts and outputs; increasing stage count adds rules and intermediate outputs.

Benchmarking aggregation describes fixture checks, baseline comparisons, and longer measurements.