Argent React Native Profiler
Profile a React Native Hermes app to measure re-render and CPU performance using argent profiler tools. Use when optimizing for performance, measuring before/after a fix, spotting slow components, diagnosing re-renders, checking CPU hotspots, or producing a ranked issue report.
- Skill ID
- software-mansion/argent/argent-react-native-profiler
- Publisher
- software-mansion
- Repository
- argent
- Installs
- 284
- Files
- 2
- Synced
- Sep 16, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
software-mansion/argent/argent-react-native-profilerInstalls these files- SKILL.md
- references/diagnostic-tools.md
What this skill tells the agent
This skill is complementary to argent-react-native-optimization, not a replacement for it.
Physical iPhone: not supported; react-profiler-* reject kind: "device". Profile on a simulator.
2. Tool Overview
React Profiler (Hermes / React commits)
| Tool | Purpose | |||
|---|---|---|---|---|
react-profiler-start | Start CPU sampling + inject React commit-capture hook. Optional: sample_interval_us (default 100). | |||
react-profiler-stop | Stop recording; stores cpuProfile + commitTree in session. | |||
react-profiler-status | Call if you were interrupted in the middle of the flow, never in another scenario (debugger drop, Metro reload, pause, subagent handoff, any doubt). Returns `session_status: "active" \ | "taken_over" \ | "stopped" \ | "no_react_runtime"`. Side-effect free. |
react-profiler-analyze | Run pipeline -> report with CPU-enriched hot commits, sorted by totalRenderMs DESC. Saves raw data to disk. | |||
react-profiler-component-source | AST lookup: file, line, memoization status, 50 lines of source for a component. | |||
react-profiler-renders | Live fiber walk: render counts + durations per component (no profiling session required). | |||
react-profiler-fiber-tree | Live fiber walk: full component hierarchy as JSON. |
Drill-Down Query Tools (call after analyze)
| Tool | Purpose |
|---|---|
profiler-cpu-query | Targeted CPU investigation: top functions, time-windowed CPU, call trees, per-component CPU. |
profiler-commit-query | Targeted commit investigation: by component, time range, commit index, or cascade tree. |
profiler-stack-query | iOS Instruments drill-down: hang stacks, function callers, thread breakdown, leak details. |
profiler-combined-report | Cross-correlated report when both React Profiler and native profiler ran in parallel. |
profiler-load | List and reload previous profiling sessions from disk for re-investigation with query tools. |
For native profiling (CPU hotspots, UI hangs, memory leaks), see the argent-native-profiler skill.
3. Agent Behavior Guidelines
Follow these rules throughout the profiling workflow:
- Start
react-profiler-startandnative-profiler-startin parallel (two tool calls in one message). Both needdevice_id; use the same UDID for both so their data can be correlated later. This gives best coverage. - If the user only wants native profiling, use the
argent-native-profilerskill workflow. Only skipnative-profiler-startif the user has already explicitly said they don't want native profiling in this session
After analysis: ask about next steps
After presenting the analysis report, always ask the user what they want to do next. Present these options:
- Investigate further — drill down into specific findings using query tools (CPU call trees, commit cascades, hang stacks, etc.) to identify root causes with confidence before making changes.
- Implement fixes — apply changes based on the current findings, then re-profile to measure whether the metric changed (improved, regressed, or stayed flat).
- Done for now — accept the report as-is.
Do NOT silently move on after the report. The report is the starting point, not the end — query tools exist specifically to let you dig deeper into anything the report flags.
During investigation: use query tools proactively
When drilling down, chain query tool calls based on what you find:
- A hot commit ->
profiler-commit-querymode=by_indexto see all components ->profiler-cpu-querymode=component_cpufor the slowest one ->profiler-cpu-querymode=call_treefor the hot function -> read the source file -> propose a fix. - A memory leak ->
profiler-stack-querymode=leak_stacksto identify the responsible module -> read the native source if actionable. - A native hang ->
profiler-stack-querymode=hang_stacksto get the native call chain -> correlate with React commit timing.
After fixes: always re-profile
When you apply a fix, always re-profile the same scenario afterward. Compare before/after metrics (commit durations, CPU time, render counts) and report honestly: did the target metric improve, stay flat, or regress? Did any _other_ metric get worse? If you need to reference the original data, use profiler-load to reload the pre-fix session. If the fix showed no improvement or introduced a regression, say so explicitly and reconsider the approach.
Use flows for reproducible profiling
When profiling requires a specific interaction sequence (scroll a list, navigate screens, trigger an animation), record the interaction as a flow using the argent-create-flow skill before the first profiling run. Then replay the same flow for every subsequent run. This eliminates interaction variance as a confounder and makes before/after comparisons meaningful. Especially important when:
- You are about to re-profile after applying a fix (Step 8).
- The user asks you to compare multiple profiling sessions.
- The interaction path is more than 2-3 steps long.
4. Standard Profiling Workflow
Complete all steps in order — do not break mid-flow.
Step 1: Start profiling
Mind the react-native and ios-native profiler selection mentioned above when starting the session and start the tools. Save `startedAtEpochMs` from the response — you will need it for annotation offsets. Every subsequent profiler/query call in this session must use the same device_id. Before beginning, define lightweight success criteria with the user: which metric matters most (e.g., totalRenderMs, specific commit duration, render count for a component) and what threshold would be meaningful. This anchors later evaluation. On success:
- if user asked you to perform the profiling, determine how to profile yourself using tools described in
argent-device-interactskill. - if the user stated they wish to perform the interaction themselves — suggest what interaction to perform (e.g. "scroll the list", "switch tabs") and wait for their reply.
