跳到正文
cccskills
免费在 GitHub 公开中文介绍

storybook-startup-benchmark

测量Storybook从进程启动到首个故事显示的时间,分别统计服务器响应与浏览器渲染耗时,汇总重复运行结果,用于比较版本或功能开关。

原文查看原文说明

Measure Storybook startup time from spawning `storybook dev` until the first story renders in the browser. Use when the user asks about Storybook boot time, server-ready timing, first story render timing, startup regressions, benchmarking with repeat runs, or comparing Storybook versions or feature flags.

实测评分 未实测

查看安装方法

适用场景

  • 测量首个故事显示前的启动耗时
  • 比较版本或功能开关
  • 重复测量并汇总启动时间
  • 排查服务器与渲染环节的耗时

中文介绍

功能

通过可重复的步骤,测量Storybook从启动到首个故事显示的时间。结果分为三项:server是进程启动到服务器响应的耗时,browser是服务器响应到渲染完成的耗时,total是全程耗时。重复运行时,会汇总平均值、最小值、最大值和p95,便于了解通常的等待时间及较慢运行的表现。

适用场景

适合比较Storybook版本更新前后,或更改功能开关前后的启动时间。分开统计的结果也能提供线索,帮助判断增加的耗时来自服务器端还是浏览器端。

使用示例

  • “测量从启动storybook dev到首个故事显示的时间。”
  • “分别在开启和关闭功能开关时测量20次,比较平均值和p95。”

注意事项

此流程需要Storybook、Node脚本及可控制的浏览器。从常规的/页面打开,在首次挂载后等待一次requestAnimationFrame(),再结束计时。需要留意残留的服务器进程和已被占用的端口。预热状态下的重复测量结果不能作为冷启动数据。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好明确要求端口被占用时停止,并在清理时结束测量所启动的进程组。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足需要Node和浏览器控制能力,但未提供浏览器控制环境的配置步骤。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月21日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(1)

  • SKILL.md5.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Storybook Startup Benchmark

Purpose

Use this skill to build or explain a repeatable benchmark for Storybook startup:

  • server: process spawn -> Storybook server responds
  • browser: server responds -> first story rendered
  • total: process spawn -> first story rendered

Quick Start

When asked to benchmark Storybook startup:

  1. Confirm the boundary:
    • Start timing immediately before spawning storybook dev
    • Open Storybook at /, not iframe.html
    • Stop timing on first story mount plus one requestAnimationFrame()
  2. Check whether the repo already has a benchmark script. Reuse it if possible.
  3. If not, create a Node script that:
    • starts Storybook without opening a browser
    • waits for the server to respond
    • launches a browser it controls
    • waits for a preview-side render signal
    • prints JSON results
  4. Add --repeat <count> support with grouped summary stats.

Measurement Rules

Use these defaults unless the user asks otherwise:

  • Start URL: /
  • Browser path: normal manager page, let Storybook load the preview iframe itself
  • Render signal: first preview story mount + one requestAnimationFrame()
  • Browser launch: external harness launches the browser, not Storybook
  • Auto-open: keep Storybook from opening a browser. Storybook 11 opens one only with --open; Storybook 10 and older need --no-open

Do not measure only CLI output. Server listening is not the same as first story rendered.

Recommended Implementation

1. Preview-side signal

Add a small global preview decorator or component that runs once on the first story mount:

  • wait one requestAnimationFrame()
  • set a global value like window.__sbStartupBenchmark
  • also mirror that value to window.top when same-origin
  • optionally call performance.mark('sb:first-story-rendered')

Preferred payload:

{
  firstStoryRenderedAt: performance.now(),
  storyId: id
}

2. Harness behavior

The benchmark script should:

  1. Fail fast if the target Storybook port is already in use
  2. Spawn Storybook without opening a browser
  3. Start timing immediately before spawn
  4. Wait for HTTP readiness on the Storybook URL
  5. Launch a controlled browser to /
  6. Wait for the preview-side signal
  7. Print JSON results
  8. Kill the full spawned process group during cleanup

3. Repeated runs

For --repeat N, print:

  • per-run results
  • summary stats grouped by server, browser, and total
  • human-readable durations like 5.2s or 2m15s, not raw millisecond field names

Recommended summary fields:

{
  "server": {
    "average": "5.2s",
    "min": "4.8s",
    "max": "6.1s",
    "p95": "6.0s"
  },
  "browser": {
    "average": "1.9s",
    "min": "1.6s",
    "max": "2.4s",
    "p95": "2.3s"
  },
  "total": {
    "average": "7.1s",
    "min": "6.6s",
    "max": "8.2s",
    "p95": "8.1s"
  }
}

Interpretation Guidance

Use these heuristics when explaining results:

  • If server grows, the regression is likely on the server/build side.
  • If browser grows, the regression is likely in manager boot, preview boot, or first-story render.
  • If averages are close but p95 grows a lot, the feature likely increases variability or tail latency.
  • If newer Storybook without a feature is much faster than older Storybook, but enabling the feature returns timings to older levels, the feature likely erases the newer startup gains.

Common Pitfalls

  • Existing Storybook already running on the benchmark port
  • Storybook auto-opening a separate browser window
  • Measuring direct iframe.html loads instead of normal /
  • Leaving child Storybook processes alive between runs
  • Treating warm repeated runs as cold-start data

If a repeated benchmark reports unrealistically low server.average, first check for a stale Storybook server on the same port.

Tooling Notes

  • Prefer a plain Node script for portability.
  • For Chrome-family browsers, remote debugging is a practical control path.
  • If Storybook CLI flags or behavior are in question, fetch current Storybook docs first.

Output Style

When reporting results:

  • clearly separate server, browser, and total
  • call out averages and p95 first, with min/max as supporting bounds
  • highlight whether the regression affects common-case latency, tail latency, or both
  • avoid claiming root cause unless the benchmark isolates server vs render behavior

Example Triggers

Use this skill when the user says things like:

  • "How can I test Storybook startup time?"
  • "Measure from storybook dev to first story render"
  • "Compare Storybook startup with and without this feature flag"
  • "Run 20 startup measurements and summarize averages"
  • "Is this startup regression server-side or render-side?"

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

canary

免费有简介

查找Storybook指定分支的试验版软件包,必要时执行发布流程,跟踪发布状态,并提供用于新建项目或更新现有项目的命令。

  • 查找指定分支的试验版
  • 发布来自派生仓库的拉取请求试验版
  • 确认发布状态与安装命令
storybookjs/storybook9.1万2026年10月24日 更新

component-docs

免费有简介

通过Storybook查询项目现有界面组件、配置参数和使用示例,用于回答组件用法问题,并在重复实现前判断能否复用现有组件。

  • 查找现有界面组件
  • 查看组件配置参数和使用示例
  • 询问组件用法
storybookjs/storybook9.1万2026年10月24日 更新

docs-review

免费有简介

根据读者和页面目的,审核、改进或新写Storybook的/docs文档。既可调整结构和示例、统一格式,也可讨论页面定位与文档规划。

  • 改进说明页面的结构和示例
  • 起草新功能文档
  • 讨论页面类型和目录
storybookjs/storybook9.1万2026年10月24日 更新

检出GitHub的PR,修复lint代码规范问题和TypeScript类型错误,完成提交与推送。支持来自分支仓库的PR,并通过重复类型检查验证修复。

  • 修复PR中的lint错误
  • 修复PR中的TypeScript错误
  • 修复来自分支仓库的PR
storybookjs/storybook9.1万2026年10月24日 更新

github-qa-labels

免费有简介

为QA测试发现的GitHub Issue和PR添加发布版本追踪标签,并按影响程度与变通方案为漏洞分类。支持批量添加标签,严重程度标签仅用于程序缺陷。

  • 按发布版本整理QA发现的问题
  • 划分程序缺陷的严重程度
  • 批量为Issue和PR添加标签
storybookjs/storybook9.1万2026年10月24日 更新

handle-pr-comments

免费有简介

逐条整理 GitHub 拉取请求中尚未解决的审查意见,说明问题并提出修改方案,再按用户选择修改代码、回复或跳过,处理提交及将讨论标为已解决。

  • 处理 PR 中未解决的审查意见
  • 选择修改、回复或跳过
  • 合并处理重复审查意见
storybookjs/storybook9.1万2026年10月24日 更新

查看 storybookjs 的全部技能

报告此技能的问题