performance-profiler
Skill1 starsChanged 3 months agoMITView on GitHub
性能剖析。接口慢、页面卡、内存涨时,先建立可复现基线再用 profiler 取证,定位热点并给出可量化的优化建议。Use to find and fix performance bottlenecks with evidence, not guesses.
21 other projects use a version of this.
Adopted by
Most recently taken up by
- darkweb19/skillstheir own version, first seen Nov 8, 2026
- kazemcodes/skill-treetheir own version, first seen Nov 8, 2026
- Vinix24/vnx-orchestrationtheir own version, first seen Nov 6, 2026
- k1lgor/virtual-companytheir own version, first seen Nov 1, 2026
- jaskirat1616/grok-skillstheir own version, first seen Nov 1, 2026
- salmandev/everything-geminitheir own version, first seen Oct 17, 2026
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- OneWave-AI/claude-skills★ 378same name
- mar-antaya/my-claude-skills★ 148same name
- Vinix24/vnx-orchestration★ 63same name
- jaskirat1616/grok-skills★ 22same name
- Hassaan146/claude-skills★ 18same name
- JayRHa/agent-skills★ 12same name
- JayRHa/AgentSkills★ 12same name
- k1lgor/virtual-company★ 4same name
- DeRuiChen258/RL_Infra_skills-openAI★ 3same name
- csiddhant796-blip/claude-skills-collection★ 2same name
11 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- api-contract-designerSkill
- api-testerSkill
- bug-diagnoserSkill
- cache-governorSkill
- ci-cd-setupSkill
- code-migratorSkill
- code-reviewerSkill
- commit-message-writerSkill
- db-migration-reviewerSkill
- db-schema-designerSkill
- dev-env-troubleshooterSkill
- frontend-debugSkill
- git-workflowSkill
- log-analysisSkill
- meeting-minutesSkill
- natural-chinese-writerSkill
- release-note-writerSkill
- requirement-clarifierSkill
- requirements-reviewerSkill
- security-reviewerSkill
- skill-creator-cnSkill
- skill-style-guideSkill
- sql-reviewerSkill
- task-decomposerSkill
- tdd-workflowSkill
- tech-design-writerSkill
- tech-doc-writerSkill
- weekly-reportSkill
The file
Files
性能剖析
何时使用
- 用户说"这个接口好慢""页面卡""内存一直涨";
- 上线后性能变差,需要定位是哪个改动引起的;
- 优化前想先知道瓶颈在哪,不想瞎猜;
- 需要量化"优化到底有没有用"。
使用步骤
第 1 步:明确现象与目标
- 慢在哪里:接口、页面、构建、启动,还是内存;
- 现状指标:能不能给出数字(响应时间、CPU、内存);
- 目标:优化到什么程度算达标。
第 2 步:建立可复现基线
- 固定环境、固定请求、固定数据量;
- 跑 3-5 次取中位数,记录基线数字;
- 没有基线,优化前后就没法对比,不算完成。
第 3 步:取证定位
工具选择、指标含义、profiler 读法见 references/TOOLS_METRICS.md。
按场景选工具:
| 场景 | 工具 |
| CPU 热点 | cProfile、perf、Chrome DevTools CPU Profiler |
| 接口耗时 | 应用日志时间戳、APM、curl -w |
| 数据库慢查询 | 慢日志、EXPLAIN、pg_stat_statements |
| 内存 | tracemalloc、heap profile、内存监控 |
| 前端 | Performance 面板、Lighthouse |
定位时看三个层次:
- 时间花在哪(接口 → 函数 → 具体行);
- 瓶颈类型:CPU 密集、IO 等待、锁等待、还是网络;
- 是否和调用次数相关(N+1、循环内查询、重复计算)。
第 4 步:提出并实施优化
常见方向:
- 数据库:N+1 改批量查询、加索引(配合 EXPLAIN 验证)、缓存热点数据;
- 代码:循环外提计算、减少重复对象创建、并行化独立任务;
- 前端:懒加载、防抖、减少重渲染;
- 架构:缓存、异步、限流(最后考虑)。
一次只改一个点,改完立即重跑基线。
第 5 步:输出报告
# 性能剖析报告
## 基线
环境、请求、优化前指标
## 瓶颈
位置、证据(profiler 截图/日志)、原因
## 优化
改动点、为什么有效
## 结果
优化后指标、提升百分比输入与输出
- 输入:性能问题描述 + 可运行的环境;
- 输出:基线数据 + 瓶颈证据 + 优化结果。
示例
现象: 列表接口 2 秒,预期 <500ms。
取证: 慢日志显示同一条用户查询执行了 100 次(每行一次)。
根因: ORM 循环内逐行查询,典型 N+1。
优化: 改成一次批量查询,内存里做关联。
结果: 接口降到 120ms,提升 94%。
辅助脚本
scripts/benchmark.py 测量接口 p50/p95/p99 与成功率,建立可复现基线:
python scripts/benchmark.py <URL> [请求数] [并发]示例服务见 examples/slow-api。
注意事项
- 不猜:每个结论都要有 profiler、日志或基线数据支撑;
- 先量化再优化:没有基线的"优化"无法验收;
- 一次改一个变量,改多个就说不清是谁起的作用;
- 数据库优化先 EXPLAIN 再动索引,别凭感觉加;
- 优化要保住正确性,改完跑一遍原有测试。
不适用场景
- 用户只想要"感觉快了"的主观判断(要求量化);
- 没有可运行环境,只有代码片段;
- 问题是资源不足(加机器能解决),不属于代码优化。
验证方式
- 触发:"这个接口好慢""帮我查性能";
- 检查:报告含基线、瓶颈证据、优化前后数字;
- 复核:按报告步骤重跑,结果可复现。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

