cpu-profiling by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill cpu-profilingCPU 性能分析用于识别哪些函数消耗了最多的 CPU 时间,从而能够有针对性地优化高开销的代码路径。
最小工作示例:
浏览器性能分析:
Chrome DevTools:
步骤:
1. DevTools → Performance
2. 点击记录
3. 执行操作
4. 停止记录
5. 分析火焰图
指标:
- 函数调用时长
- 调用频率
- 总时间 vs 自身时间
Firefox Profiler:
- 内置性能分析器
- 火焰图
- 时间线视图
- 导出与分享
React Profiler:
- DevTools → Profiler
- 组件渲染时间
- 阶段:渲染 vs 提交
- 组件重新渲染的原因
// ... (完整实现请参阅参考指南)
references/ 目录下的详细实现:
| 指南 | 内容 |
|---|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 性能分析工具 |
| 分析与解读 | 分析与解读 |
| 优化流程 | 优化流程 |
| 监控与最佳实践 | 监控与最佳实践 |
每周安装量
105
代码仓库
GitHub 星标数
116
首次出现
Jan 21, 2026
安全审计
已安装于
opencode88
claude-code86
gemini-cli86
codex83
cursor80
github-copilot70
CPU profiling identifies which functions consume most CPU time, enabling targeted optimization of expensive code paths.
Minimal working example:
Browser Profiling:
Chrome DevTools:
Steps:
1. DevTools → Performance
2. Click record
3. Perform action
4. Stop recording
5. Analyze flame chart
Metrics:
- Function call duration
- Call frequency
- Total time vs self time
Firefox Profiler:
- Built-in performance profiler
- Flame graphs
- Timeline view
- Export and share
React Profiler:
- DevTools → Profiler
- Component render times
- Phase: render vs commit
- Why component re-rendered
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Profiling Tools | Profiling Tools |
| Analysis & Interpretation | Analysis & Interpretation |
| Optimization Process | Optimization Process |
| Monitoring & Best Practices | Monitoring & Best Practices |
Weekly Installs
105
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode88
claude-code86
gemini-cli86
codex83
cursor80
github-copilot70
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
120,000 周安装