Skip to content

feat: Extends performance domain with measurement skills - #144

Closed
MajorLift wants to merge 5 commits into
MetaMask:mainfrom
MajorLift:add/performance-metrics
Closed

MajorLift wants to merge 5 commits into
MetaMask:mainfrom
MajorLift:add/performance-metrics

Conversation

@MajorLift

@MajorLift MajorLift commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Motivation

The performance domain's extension skills (perf-rendering, perf-hooks-effects, perf-react-compiler, perf-state-management) say what to change for React rendering, and none of them gives a method for measuring whether a change worked. A useMemo that recomputes on every render still looks correct in review, and only a re-render count separates it from one that works.

Overview

Extends the performance domain with three measurement skills and one knowledge file.

  • extension-profiling compares metamask-extension performance between branches using why-did-you-render, the React DevTools Profiler and E2E benchmarks.
  • react-render-delta tests whether a rendering or memoization change reduced work, from re-render counts and reselect's .recomputations(), and aborts any arm whose change did not reach the built bundle.
  • data-analysis attributes metric movements to the code changes in a release, and rates each attribution High, Medium or Low confidence.
  • domains/performance/knowledge/web-vitals-attribution-import.md: web-vitals/attribution, an import path within the web-vitals package, reports which script or element caused each metric, and the file says not to skip it for bundle size.

`extension-profiling`, `react-render-delta`, `data-analysis` and
`benchmark-design`, split from #43 so the audit half reviews separately.

The existing `performance` skill is mobile-scoped and advisory — it says what
to change. Nothing in the repo says how to prove a change worked, and the
extension has no profiling skill at all.
@MajorLift MajorLift changed the title feat(performance): add measurement skills — profiling, render deltas, benchmark design feat: Extends performance domain with measurement skills Sep 1, 2026
@MajorLift MajorLift changed the title feat: Extends performance domain with measurement skills feat: Extends performance domain - /extension-profiling, /react-render-delta, /data-analysis, /benchmark-design skills Sep 1, 2026
@MajorLift MajorLift changed the title feat: Extends performance domain - /extension-profiling, /react-render-delta, /data-analysis, /benchmark-design skills feat: Extends performance domain with profiling, render-delta, benchmarking skills Sep 1, 2026
@MajorLift
MajorLift marked this pull request as ready for review September 1, 2026 14:25
@MajorLift MajorLift changed the title feat: Extends performance domain with profiling, render-delta, benchmarking skills feat: Extends performance domain with measurement skills Sep 1, 2026
`yarn build:test` runs webpack with `--mode production`, which sets
`NODE_ENV=production`, and React's production build records no profiling
data. The statistics example labeled two non-significant results "no
effect", which an underpowered run and a true null cannot tell apart.
`benchmark-design`, `benchmark-statistical-hygiene`,
`metrics-pipeline-design` and the two benchmark-facing Web Vitals files
now ship in #162 (add E2E benchmark design and statistics
skills). This PR keeps profiling, render-delta proof and data analysis.
…nits

Choosing the round with the cleanest signal after seeing the data is
cherry-picking a time range, so per-round results are sensitivity. A
Cohen's d cutoff sets meaningfulness from the benchmark's own spread, so
the difference worth acting on is fixed from product impact instead.
A percentile is not a cohort, and an outcome read without the fraction of
users on a build that contains the change is not valid. Each change is
confirmed in the release whose traffic is read, with pre- and post-change
clients kept apart. A PR's baseline is its merge-base, and a profiling
run names the wallet state it ran on.
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.

1 participant