peakmarkv0.1.1

Showcase

Each example shows real output produced by peakmark itself, from files in the project repository. Input on the left, output on the right.

Within budget and baseline

examples/check.ansiDetail: Within budget and baseline →
\x1b[1;92m✔\x1b[0m peakmark check: 1 module within budget and baseline

  \x1b[2mModules: \x1b[0m\x1b[36m1\x1b[0m   \x1b[2mOver budget: \x1b[0m\x1b[36m0\x1b[0m   \x1b[2mGrown: \x1b[0m\x1b[36m0\x1b[0m

● \x1b[1;96mMeasured\x1b[0m \x1b[2m(1)\x1b[0m
  - \x1b[36mengine: 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\x1b[0m
✔ 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
  • check
  • size
  • memory

Over the budget

examples/fail.ansiDetail: Over the budget →
\x1b[1;91m✖\x1b[0m peakmark check: over budget: engine

  \x1b[2mModules: \x1b[0m\x1b[36m1\x1b[0m   \x1b[2mOver budget: \x1b[0m\x1b[1;91m1\x1b[0m   \x1b[2mGrown: \x1b[0m\x1b[36m0\x1b[0m

● \x1b[1;96mengine\x1b[0m \x1b[2m(1)\x1b[0m
  - \x1b[1;91mPeak memory 23.6 MiB, budget 20.0 MiB\x1b[0m \x1b[2m[mem/peak]\x1b[0m at \x1b[2mbench/pivot.mjs\x1b[0m

\x1b[1;96mNext steps:\x1b[0m
  • Shrink the module, or raise its budget in the configuration on purpose
✖ peakmark check: over budget: engine

  Modules: 1   Over budget: 1   Grown: 0

● engine (1)
  - Peak memory 23.6 MiB, budget 20.0 MiB [mem/peak] at bench/pivot.mjs

Next steps:
  • Shrink the module, or raise its budget in the configuration on purpose
  • check
  • memory
  • exit 1

No baseline yet

examples/no-baseline.ansiDetail: No baseline yet →
\x1b[1;93m⚠\x1b[0m peakmark check: no baseline for engine

  \x1b[2mModules: \x1b[0m\x1b[36m1\x1b[0m   \x1b[2mOver budget: \x1b[0m\x1b[36m0\x1b[0m   \x1b[2mGrown: \x1b[0m\x1b[36m0\x1b[0m

● \x1b[1;96mengine\x1b[0m \x1b[2m(1)\x1b[0m
  - \x1b[1;93mNo baseline accepted yet\x1b[0m \x1b[2m[baseline/missing]\x1b[0m

\x1b[1;96mNext steps:\x1b[0m
  • Accept the measured values as the new baseline
    \x1b[36m$ peakmark accept engine --reason "..."\x1b[0m
⚠ 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 "..."
  • check
  • baseline

Accepting a baseline

examples/accept.ansiDetail: Accepting a baseline →
\x1b[1;92m✔\x1b[0m Baseline accepted for engine
  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
✔ Baseline accepted for engine
  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
  • accept