Skip to content

Conversation

BrodyHughes
Copy link
Member

@BrodyHughes BrodyHughes commented Aug 29, 2025

Fixes BX-1876

Overview

Adds comprehensive performance testing infrastructure to track and monitor extension
performance metrics across builds.

Key Features

  • Performance Metrics Collection: Tracks DOM load times, React render times, memory
    usage, and user flow durations
  • Baseline Comparison System: Compares metrics against established baselines with
    configurable warning (20%) and critical (50%) thresholds
  • CI Integration: Automated performance tests run on PRs with results displayed in
    GitHub Actions summary
  • Visual Status Indicators: Clear ✅/⚠️/❌ emoji indicators for quick performance
    assessment

What's Measured

  • domContentLoaded - Time to DOM ready
  • firstMeaningfulPaint - Time to first visual content
  • loadScripts - Script loading duration
  • firstReactRender - React initial render time
  • uiStartup - Total UI initialization time
  • flowDuration - Complete user flow timing (e.g., wallet import)
  • memoryUsage - JS heap memory consumption

Implementation Details

  • Passive performance collection only when IS_TESTING=true to avoid interfering with
    extension initialization
  • Consolidated metrics table for easy scanning
  • Automatic baseline generation from actual test runs via yarn
    perf:generate-baseline
  • Tests for cold start, warm reload, and wallet import flows

Scripts Added

  • yarn perf:test - Run performance tests locally
  • yarn perf:generate-baseline - Generate baseline from current metrics
  • yarn perf:update-baseline - Update baseline after performance improvements

PR-Codex overview

This PR introduces performance testing for the extension, adding metrics collection and reporting capabilities to monitor the startup and user flow performance, along with baseline generation for future comparisons.

Detailed summary

  • Added performance testing configuration in vitest.config.ts.
  • Created performance test scripts in e2e-performance-tests.sh.
  • Introduced performance metrics interfaces in types.ts.
  • Implemented performance metrics collection in index.ts and popup/index.ts.
  • Added baseline JSON structure in baseline.json.
  • Developed performance test cases in initialLoad.test.ts and walletFlowPerformance.test.ts.
  • Created scripts for generating and updating performance baselines.
  • Integrated performance reporting in GitHub Actions workflows.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@rainbow-me rainbow-me deleted a comment from github-actions bot Sep 5, 2025
@BrodyHughes BrodyHughes changed the title WIP: perf test e2e: performance metrics reporting Sep 11, 2025
@rainbow-me rainbow-me deleted a comment from github-actions bot Sep 11, 2025
@BrodyHughes BrodyHughes marked this pull request as ready for review September 11, 2025 17:37
Copy link

linear bot commented Oct 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants