# Benchmark results

The benchmark command exercises the public pipeline API with deterministic,
synthetic evidence records. It measures the complete assessment path:
batch construction, policy evaluation, deterministic snapshot generation,
Merkle sealing, validation, diagnostics, review prioritisation, and retention
classification. The input is generated by the benchmark itself; it is not
presented as a production evidence corpus.

## Reproduce

```bash
moon version --all
moon run cmd/benchmark --
```

The benchmark prints elapsed milliseconds and items per second from the local
runner. Timing varies by machine and build mode. Snapshot and Merkle prefixes
are deterministic for the same toolchain and input generator.

## Local run recorded on 2026-08-23

Environment:

- Toolchain: `moon 0.1.20260819 (fc2a4ee 2026-08-19)`
- Compiler: `moonc v0.10.9+6e6c44045 (2026-08-19)`
- Runner: `moonrun 0.1.20260819 (fc2a4ee 2026-08-19)`
- Host: Windows PowerShell workspace
- Command: `moon run cmd/benchmark --`

Observed output:

| Items | Elapsed (ms) | Items/s | Canonical bytes | Archive ready | Snapshot | Merkle |
| ---: | ---: | ---: | ---: | :---: | --- | --- |
| 100 | 47 | 2,127 | 29,027 | true | `2ceb691c` | `a44c8c2c` |
| 1,000 | 1,032 | 968 | 292,731 | true | `19455a83` | `b6eb0075` |
| 5,000 | 4,286 | 1,166 | 1,480,731 | true | `274db201` | `8403e554` |

The values above are a recorded local observation, not a performance promise.
Run the command again when comparing changes. A valid run must report
`archive_ready=true` for all three deterministic inputs and must keep the
snapshot/Merkle prefixes stable even when elapsed time changes.

## Interpretation

The pipeline uses hash-map-backed duplicate detection and avoids a quadratic
sort when input item numbers are already ordered. Unordered input is still
normalized deterministically; callers processing very large unordered batches
should measure their own workload before choosing a batch size.
