perf-profiler

Featured

基于可复现基线和 profiler 证据分析性能问题。用于用户要求定位慢接口、慢任务、慢查询、内存或网络瓶颈,制定优化方案,或验证优化收益时;区分实测结论与静态推断,不虚构耗时和提升比例,生产环境操作需明确授权。

Data & Documents 835 stars 88 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 90/100

Stars 20%
97
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
69
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 性能分析助手 ## 工作流程 ### 1. 明确目标与边界 先确认或从项目中核实: - 目标指标,如延迟、吞吐量、CPU、内存、查询次数或包体积。 - 可复现的场景、数据规模、运行环境、版本和关键配置。 - 用户允许分析和修改的范围,以及是否可以运行负载或 profiler。 没有明确目标时,先用现有监控、benchmark 或用户现象缩小范围,不把“代码看起来慢”当成瓶颈结论。 ### 2. 建立基线 优先复用项目已有的启动、benchmark、trace 和 profiling 配置。在相同环境、数据和负载下记录: - 预热方式、并发度、重复次数和统计口径。 - 代码版本、依赖版本及影响结果的配置。 - 原始测量值和波动范围;条件允许时保留机器可读结果。 无法运行项目时,只能进行静态分析,并把发现标为“待验证候选”。 ### 3. 收集证据 按技术栈选择 profiler、trace、火焰图、查询计划、网络时序或内存快照,定位时间或资源实际消耗的位置。常见维度包括: - 代码:算法复杂度、重复计算、分配热点、同步阻塞和并发争用。 - 数据库:N+1 查询、扫描量、索引使用、锁等待和连接池状态。 - 网络:请求瀑布、有效载荷、压缩、缓存命中和外部服务延迟。 复杂度分析和代码审查只能证明风险,不能单独证明运行时影响。 ### 4. 提出最小改动 - 将建议绑定到具体证据、文件或调用链。 - 说明正确性、内存、吞吐量、维护成本和兼容性方面的权衡。 - 优先处理证据最强、影响最大的热点;不同时改动多个无法独立归因的因素。 - 为代码、配置和数据结构变更准备验证与回滚方式。 ### 5. 同条件复测 修改后使用与基线一致的环境、数据、负载、预热和统计口径复测,并运行受影响功能的正确性测试。报告原始结果、波动、差异和尚未控制的变量。 只有真实完成同条件测量后,才能写耗时、百分比或“已改善”等确定性结论。 ## 证据等级 - **已测量**:有可复现基线、profiling 证据和实际结果。 - **静态推断**:由复杂度、调用关系或配置推导出的候选问题,尚未实测。 - **待验证**:缺少环境、数据或权限,当前无法判断影响。 ## 安全与授权边界 - 默认只在本地或用户明确指定的测试环境进行只读分析。 - 生产环境 profiling、压测、`EXPLAIN ANALYZE` 及索引、缓存、连接池、CDN 或外部服务配置变更必须获得明确授权。 - 不在报告中暴露生产数据、凭据或含敏感信息的 profiling 产物。 - 不为得到漂亮数字而删除正确性检查、降低数据规模或改变统计口径。 - Windows 与 Linux 优先使用项目已有工具;平台特定命令需说明适用范围或提供等价方法。 ## 输出 ```markdown ## 性能分析结果 - 目标指标与场景: - 环境、版本与数据规模: - 基线与测量方法: ## 发现 | 证据等级 | 位置 | 证据 | 影响与限制 | |----------|------|------|------------| ## 改动与权衡 ## 同条件复测 - 正确性验证: - 性能结果: - 未控制变量与待验证项: - 回滚方式: ```

Details

Author
laolaoshiren
Repository
laolaoshiren/claude-code-skills-zh
Created
5 months ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Listed

profiling

性能分析:time 三值、资源监控(htop/btop/iotop/free/lsof/ss)、tidy 数据与绘图、 CPU profiler(perf/火焰图/callgrind)、内存 profiler(massif)、hyperfine 基准。Use when the user asks to profile performance, find bottlenecks, benchmark tools, or investigate resource usage. 触发于「帮我分析性能/找瓶颈/benchmark/查内存占用」。

1 Updated 1 weeks ago
AntheaLaffy
AI & Automation Listed

forge-perf

Use when measuring performance baselines, benchmarking latency/throughput, profiling memory leaks, or running performance optimization loops.

1 Updated 3 weeks ago
gldu
AI & Automation Solid

mini-program-debugging-skill

Diagnose and fix mini-program failures through reproducible, evidence-driven root-cause analysis across source, state, asynchronous timing, caches, mock data, build versions, platform behavior, devices, cloud calls, and external services. Use when users report white screens, crashes, stale or jumping values, missing data, intermittent behavior, permission failures, performance stalls, device-only defects, API or cloud-function errors, source-versus-build mismatches, or regressions whose cause is not yet established. Freezes the observation environment, ranks competing hypotheses, runs discriminating checks, creates a failing regression test before repair, covers analogous states, and never hides a known failure with longer waits, swallowed errors, forced success, or cosmetic patches.

59 Updated 3 days ago
NocodeMrLi