Back to docs

Performance Regression

Added in v6.4.0

Automatically detect performance regressions by comparing current metrics against saved baselines.

Quick Start

# 1. Save a baseline (run multiple times for stability)
cbrowser perf-baseline save "https://example.com" --name "homepage" --runs 5

# 2. Later, check for regressions
cbrowser perf-regression "https://example.com" homepage

Baseline Management

Save a Baseline

cbrowser perf-baseline save <url> [options]

Options:
  --name <name>    Human-readable name (required)
  --runs <n>       Number of runs to average (default: 3)

Example:

cbrowser perf-baseline save "https://myapp.com" --name "homepage-v2.1" --runs 5
cbrowser perf-baseline save "https://myapp.com/checkout" --name "checkout-flow"

List Baselines

cbrowser perf-baseline list

Output:

Performance Baselines:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Name             β”‚ URL                             β”‚ LCP    β”‚ CLS    β”‚ FCP    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ homepage-v2.1    β”‚ https://myapp.com               β”‚ 1850ms β”‚ 0.05   β”‚ 980ms  β”‚
β”‚ checkout-flow    β”‚ https://myapp.com/checkout      β”‚ 2100ms β”‚ 0.08   β”‚ 1200ms β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Show Baseline Details

cbrowser perf-baseline show <name>

Delete a Baseline

cbrowser perf-baseline delete <name>

Regression Detection

Basic Check

cbrowser perf-regression <url> <baseline-name>

Custom Thresholds

cbrowser perf-regression <url> <baseline> [options]

Options:
  --threshold-lcp <n>    Max LCP increase % (default: 20)
  --threshold-cls <n>    Max CLS increase (default: 0.1)
  --threshold-fcp <n>    Max FCP increase % (default: 20)
  --output <file>        Save JSON report to file

Example:

# Strict thresholds for critical pages
cbrowser perf-regression "https://myapp.com" homepage --threshold-lcp 10 --threshold-cls 0.05

# Save report for CI
cbrowser perf-regression "https://myapp.com" homepage --output regression-report.json

Metrics Tracked

Metric Description Default Threshold
LCP Largest Contentful Paint 20% increase
FID First Input Delay 50% increase
CLS Cumulative Layout Shift 0.1 absolute increase
FCP First Contentful Paint 20% increase
TTFB Time to First Byte 30% increase
TTI Time to Interactive 25% increase
TBT Total Blocking Time 50% increase
Transfer Size Total bytes transferred 25% increase

Example Output

╔══════════════════════════════════════════════════════════════════════════════╗
β•‘                     PERFORMANCE REGRESSION REPORT                            β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ“Š Comparing: https://myapp.com
πŸ“ˆ Baseline: homepage-v2.1 (captured 2026-01-15)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Metric   β”‚ Baseline β”‚ Current  β”‚ Change   β”‚ Status     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ LCP      β”‚ 1850ms   β”‚ 2450ms   β”‚ +32.4%   β”‚ ❌ REGRESS β”‚
β”‚ FCP      β”‚ 980ms    β”‚ 1020ms   β”‚ +4.1%    β”‚ βœ… OK      β”‚
β”‚ CLS      β”‚ 0.05     β”‚ 0.06     β”‚ +0.01    β”‚ βœ… OK      β”‚
β”‚ TTFB     β”‚ 180ms    β”‚ 165ms    β”‚ -8.3%    β”‚ βœ… IMPROVEDβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚠️ REGRESSION DETECTED: 1 metric exceeded threshold

Recommendations:
  - LCP regression: Check for new large images or slow-loading content
  - Consider lazy-loading below-fold images
  - Audit third-party scripts for blocking behavior

CI/CD Integration

GitHub Actions

- name: Performance Regression Check
  run: |
    npx cbrowser perf-regression "${{ env.PREVIEW_URL }}" production-baseline \
      --threshold-lcp 15 \
      --output perf-report.json

- name: Upload Report
  uses: actions/upload-artifact@v3
  with:
    name: performance-report
    path: perf-report.json

Fail on Regression

# Exit code 1 if regression detected
cbrowser perf-regression "https://staging.myapp.com" baseline || exit 1

Best Practices

  1. Multiple Runs: Use --runs 5 or higher for stable baselines
  2. Consistent Environment: Capture baselines in similar conditions (network, time of day)
  3. Version Baselines: Include version in name (e.g., homepage-v2.1)
  4. Regular Updates: Recapture baselines after intentional performance changes
  5. Realistic Thresholds: Start with defaults, adjust based on your SLOs

Programmatic API

import {
  capturePerformanceBaseline,
  detectPerformanceRegression,
  listPerformanceBaselines
} from 'cbrowser';

// Capture baseline
const baseline = await capturePerformanceBaseline(
  'https://example.com',
  { name: 'homepage', runs: 5 }
);

// Check for regression
const result = await detectPerformanceRegression(
  'https://example.com',
  'homepage',
  { thresholds: { lcp: 15, cls: 0.05 } }
);

if (!result.passed) {
  console.log('Regressions:', result.regressions);
}

Related


Copyright: (c) 2026 Alexa Eden.

License: MIT License

Contact: [email protected]

From the Blog