Benchmark

affaan-m/ECC/pi/core/skills/benchmark

作者 affaan-mef648e01899ba3e8dc6371642deaaf64b4477775MIT275K 个星标收录于 2026年10月9日更新于 2026年10月9日仓库4天前更新

Measure performance baselines and detect regressions across browser Core Web Vitals (LCP, INP, CLS, page weight), API endpoint latency percentiles, and build/test feedback times, with before/after comparison stored in git-tracked .ecc/benchmarks JSON. Use when checking page speed, responding to 'it feels slow' reports, verifying launch performance targets, or comparing stack alternatives.

仅含说明Data & Analytics
AI 生成的概览

测量网页、API 与构建的性能基线,并通过前后对比检测性能回退。

功能
该技能定义了四种测量模式:浏览器 Core Web Vitals 与页面体积、负载下 API 端点的延迟分位数、构建与测试反馈耗时,以及前后对比。它把基线以 JSON 形式记录在受 git 跟踪的 .ecc/benchmarks 目录中,便于团队共享。对比输出为包含指标、之前、之后、差值与结论的表格。
适用场景
适用于在拉取请求前后衡量性能影响、为项目建立性能基线、用户反馈“感觉很慢”、上线前确认是否达到性能目标,或比较不同技术栈的场景。
运行要求
页面测量需要浏览器 MCP,存储基线需要 git 仓库。该技能不包含脚本,仅为说明文档。

Benchmark — Performance Baseline & Regression Detection

When to Use

  • Before and after a PR to measure performance impact
  • Setting up performance baselines for a project
  • When users report "it feels slow"
  • Before a launch — ensure you meet performance targets
  • Comparing your stack against alternatives

How It Works

Mode 1: Page Performance

Measures real browser metrics via browser MCP:

1. Navigate to each target URL2. Measure Core Web Vitals:   - LCP (Largest Contentful Paint) — target < 2.5s   - CLS (Cumulative Layout Shift) — target < 0.1   - INP (Interaction to Next Paint) — target < 200ms   - FCP (First Contentful Paint) — target < 1.8s   - TTFB (Time to First Byte) — target < 800ms3. Measure resource sizes:   - Total page weight (target < 1MB)   - JS bundle size (target < 200KB gzipped)   - CSS size   - Image weight   - Third-party script weight4. Count network requests5. Check for render-blocking resources

Mode 2: API Performance

Benchmarks API endpoints:

1. Hit each endpoint 100 times2. Measure: p50, p95, p99 latency3. Track: response size, status codes4. Test under load: 10 concurrent requests5. Compare against SLA targets

Mode 3: Build Performance

Measures development feedback loop:

1. Cold build time2. Hot reload time (HMR)3. Test suite duration4. TypeScript check time5. Lint time6. Docker build time

Mode 4: Before/After Comparison

Run before and after a change to measure impact:

/benchmark baseline    # saves current metrics# ... make changes .../benchmark compare     # compares against baseline

Output:

| Metric | Before | After | Delta | Verdict ||--------|--------|-------|-------|---------|| LCP | 1.2s | 1.4s | +200ms | WARNING: WARN || Bundle | 180KB | 175KB | -5KB | ✓ BETTER || Build | 12s | 14s | +2s | WARNING: WARN |

Output

Stores baselines in .ecc/benchmarks/ as JSON. Git-tracked so the team shares baselines.

Integration

  • CI: run /benchmark compare on every PR
  • Pair with /canary-watch for post-deploy monitoring
  • Pair with /browser-qa for full pre-ship checklist

来源与署名

来源:affaan-m/ECC位于pi/core/skills/benchmark提交ef648e0

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架