埃内佩尔夫

人工智能 社区

技能解读

当前原文的自动摘译,尚未人工审校。

1. 渲染性能(FPS)

使用 React DevTools Profiler 检查不必要的重新渲染 识别在不更改 prop 的情况下重新渲染的组件 查找丢失的 React.memo、useCallback、useMemo 检测渲染中的内联函数/对象创建

2. 交互时间(TTI)

分析应用程序启动顺序 检查挂载上的重型useEffect链 识别主线程上的阻塞操作 验证 Hermes 字节码编译

3. 捆绑尺寸

运行npx react-native-bundle-visualizer 识别大型依赖项 检查未使用的导入和死代码 验证树摇动是否正常工作

4. 记忆

检查useEffect中的侦听器/订阅清理情况识别闭包中保留的大对象查找图像缓存问题检测循环引用

5. 动画

验证所有动画均使用 Reanimated(而非 Animated API) 检查动画回调中的 JS 线程瓶颈 识别动画期间的布局抖动 测量动画期间的实际 FPS

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
人工智能
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
94 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@JubaKitiashvili · MIT
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
macOS · Linux · Windows
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
  • 命令执行
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# /erne-perf — Performance Profiling

You are executing the `/erne-perf` command. Use the **performance-profiler** agent to diagnose and fix performance issues.

## Diagnostic Areas

### 1. Rendering Performance (FPS)
- Check for unnecessary re-renders with React DevTools Profiler
- Identify components re-rendering without prop changes
- Look for missing `React.memo`, `useCallback`, `useMemo`
- Detect inline function/object creation in render

### 2. Time to Interactive (TTI)
- Analyze app startup sequence
- Check for heavy `useEffect` chains on mount
- Identify blocking operations on main thread
- Verify Hermes bytecode compilation

### 3. Bundle Size
- Run `npx react-native-bundle-visualizer`
- Identify large dependencies
- Check for unused imports and dead code
- Verify tree-shaking is working

### 4. Memory
- Check for listener/subscription cleanup in `useEffect`
- Identify large objects retained in closures
- Look for image caching issues
- Detect circular references

### 5. Animations
- Verify all animations use Reanimated (not Animated API)
- Check for JS thread bottlenecks in animation callbacks
- Identify layout thrashing during animations
- Measure actual FPS during animations

### 6. Hermes Engine
- Verify Hermes is enabled
- Check for unsupported JS features
- Profile with Hermes sampling profiler
- Analyze bytecode compilation output

## Output Format
```
## Performance Metrics
| Metric | Current | Target | Status |
|--------|---------|--------|--------|
| JS FPS | 45 | 60 | ⚠️ |
| UI FPS | 58 | 60 | ✅ |
| TTI | 3.2s | <2s | ❌ |
| Bundle | 8.2MB | <5MB | ❌ |

## Critical Issues
[Issues that must be fixed]

## Optimization Opportunities
[Improvements ranked by impact]
```

## Notes
- If agent-device is available, measure actual FPS on device
- Reference `rules/common/performance.md` for optimization patterns
- Profile on real devices, not simulator/emulator

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。