react-profiler-analyze
Analyze stored React profiling data and return a markdown performance report identifying hot commits, root causes, and top components.
Instructions
Analyze stored profiling data and return a markdown performance report. Returns { report, reportFile, hotCommitsTotal, hotCommitsShown, sessionFiles }. The report is structured around hot React commits (≥16ms absolute floor) with per-commit render cascades, root cause identification, and a top components table. Raw profiling data is saved to disk with a unique session timestamp for later reload via profiler-load. After presenting the report, ask the user whether to investigate further (drill-down with profiler-cpu-query / profiler-commit-query) or implement fixes and re-profile for comparison. Requires react-profiler-stop to have been called first. Optional annotations param: provide Array<{offsetMs, label}> to annotate commits with the user action that preceded them. Compute offsetMs = tapTimestampMs - startedAtEpochMs where tapTimestampMs is the timestampMs returned by the tap/swipe tool and startedAtEpochMs is returned by react-profiler-start. Use when the profiling session is complete and you need to interpret the collected data. Fails if react-profiler-stop has not been called or no profiling data is stored.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Metro server port | |
| platform | No | Target platform | ios |
| device_id | Yes | Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId). | |
| rn_version | No | React Native version (e.g. "0.73.4") | unknown |
| annotations | No | Optional list of user actions with their time offset from profiling start. Compute offsetMs = tapTimestampMs - startedAtEpochMs, where tapTimestampMs comes from the tap/swipe tool return value and startedAtEpochMs comes from react-profiler-start return value. | |
| project_root | Yes | Absolute path to the RN project root for session context detection |