CASOON Open Source
A budget for what your WebAssembly module costs.
peakmark measures a built .wasm module — its size on disk and on the wire, and the memory it holds after a scenario — and fails the check when it grows past a budget you set.
cargo install peakmark⚠ peakmark check: no baseline for engine Modules: 1 Over budget: 0 Grown: 0 ● engine (1) - No baseline accepted yet [baseline/missing] Next steps: • Accept the measured values as the new baseline $ peakmark accept engine --reason "..."
- values measured per module
- 5
- commands: check and accept
- 2
- files in the repository: budget, baseline, history
- 3
What it does
Memory from the instance
Linear memory only grows, so the peak is what counts. peakmark reads it from the module itself after a scenario, not from the process around it.
A limit and a last-accepted value
Over the budget, the check fails. Past the baseline, it warns and names the command that accepts the growth on purpose.
Growth with a reason
Accepting a baseline needs a reason, and the reason is logged next to it. Growth shows up in review as a decision, not as drift.
Releases you can verify
Binaries are built by the release workflow, with checksums and signed build provenance you can check yourself.
How a check runs
Build it your way, gate it with peakmark.
peakmark measures finished artifacts. Building the module stays in your own pipeline.
Build
engine_bg.wasmProduce the module
wasm-bindgen and wasm-opt as before.
Run
bench/pivot.mjsDrive it in Node
A scenario loads data and runs the operations a page would.
Compare
peakmark checkBudget and baseline
Exit code 1 over the budget, a warning past the baseline.
Accept
peakmark acceptGrowth on purpose
New baseline, with the reason in the history.
Generated at build time
All examples →✔ peakmark check: 1 module within budget and baseline Modules: 1 Over budget: 0 Grown: 0 ● Measured (1) - engine: raw size 463.8 kB, gzip size 195.8 kB, brotli size 159.2 kB, peak memory 23.6 MiB, memory growth per run 0 B
The engine module of opengrid, measured by peakmark. Recorded output, not a mock-up.
examples/check.ansiFrequently asked questions
Does peakmark build or optimise my module?
No. It measures the artifact you give it. Building and optimising stay in your own pipeline.
Do I need Node?
Only for scenarios, which run in Node. A configuration without scenarios measures sizes and needs no Node.
Why does the brotli size differ slightly from another tool?
peakmark uses a Rust brotli encoder, which lands about 0.1 % above the reference on the same settings. Set budgets from peakmark’s own numbers.