peakmarkv0.1.1

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
MITfor wasm-bindgen modules
peakmark check
⚠ 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

How a check runs

Build it your way, gate it with peakmark.

peakmark measures finished artifacts. Building the module stays in your own pipeline.

  1. Build

    engine_bg.wasm

    Produce the module

    wasm-bindgen and wasm-opt as before.

  2. Run

    bench/pivot.mjs

    Drive it in Node

    A scenario loads data and runs the operations a page would.

  3. Compare

    peakmark check

    Budget and baseline

    Exit code 1 over the budget, a warning past the baseline.

  4. Accept

    peakmark accept

    Growth 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.ansi

Frequently 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.

Gate your first module in a few minutes.

Read the quickstart