前端开发

argent-react-native-profiler

software-mansion/argent

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.

  • 2.7万 次安装
  • 3100 星标
  • 收录于

安装命令

npx skills add https://github.com/software-mansion/argent --skill argent-react-native-profiler

SKILL.md

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)