# Benchmarks

Benchmarks are informative rather than contractual. The deterministic fixture
contains a 1 MiB source, a mostly identical 1 MiB target, and 64-byte edited
blocks every 8 KiB. It is intended to exercise dictionary matches and small
literal/run regions, not represent every workload.

## Baseline result

Measured on 2026-08-24 on the Windows development host with stable MoonBit
0.1.20260819, native release mode, and five separate CLI processes per phase:

| Metric | Result |
| --- | ---: |
| Target bytes | 1,048,576 |
| Delta bytes | 2,182 |
| Delta/target | 0.21% |
| Encode throughput | 14.24 MiB/s |
| Decode throughput | 40.82 MiB/s |

Process startup is included, so the figures are conservative for an embedded
library loop. They should not be compared directly with a long-running C/C++
benchmark.

## Reproduce

```powershell
pwsh ./scripts/benchmark.ps1 -Iterations 5 -SizeMiB 1
```

The script generates its fixture in a fresh temporary directory, builds the
native release executable, performs a SHA-256 checked warm-up, measures encode
and decode phases, prints the result, and deletes the fixture.

