@storybook/bench

A benchmark for Storybook. Usage:

Usage no npm install needed!

<script type="module">
  import storybookBench from 'https://cdn.skypack.dev/@storybook/bench';
</script>

README

Storybook Bench

A benchmark for Storybook. Usage:

sb-bench 'npx sb init'

This will:

  • Install storybook using sb init (or whatever command is provided)
    • Measure install time and size
  • Start
    • Measure build time
    • Measure page load time
  • Build
    • Measure build time
  • Browse
    • Measure page load time
    • Measure bundle sizes

It outputs all results to the files bench.csv and bench.json.

Flags

It also accepts the following flags:

option description
--label Save as

Environment variables

And consumes the following environment variables:

variable description
SB_BENCH_UPLOAD Upload results to GCP if set to tue
GCP_CREDENTIALS For upload, the GCP credentials to use as stringified JSON
CIRCLE_BRANCH For upload, the branch if running in Circle CI
CIRCLE_SHA1 For upload, the commit hash if running in Circle CI