跳到正文
Skillpedia
通用编程6.5k · #13875

loopx-performance-diagnosis

它能做什么

该技能帮助找出你所拥有的程序中,运行缓慢或占用资源过多的原因。适合发现明显变慢、并希望在修改代码前获得证据的开发者。

适用场景

  • ✓当某个命令、程序或进程明显比预期更慢或更占资源时。
  • ✓当你需要测量自己拥有的程序的 CPU、内存或文件输入输出时。
  • ✓当某次修改之后出现变慢,而你需要性能分析证据才能修复时。

技能链接

https://github.com/loopx-project/loopx/blob/main/skills/loopx-performance-diagnosis/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/loopx-project/loopx/blob/main/skills/loopx-performance-diagnosis/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的 Python 脚本启动需要 30 秒,请帮我找出原因。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能引导智能体定义真实的操作和预期结果,在安全副本上用合适的性能分析工具进行测量,并在总结证据时避免暴露私人路径或数据。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

LoopX performance diagnosis

First identify the question. For a LoopX-managed benchmark's outcome quality, score growth, useful progress per time/token, or agent trajectory, use loopx-benchmark. A flatter score curve, repeated reads or more tokens alone do not establish a process-performance regression. Keep that analysis with the benchmark owner; use this skill as a focused subtask only when evidence identifies a slow owned command or resource cost. Do not require a profiler before analyzing effectiveness or interaction overhead.

Read the current Goal/Todo contract and repository optimization evidence rules. State the real user operation, observed failure and owning acceptance. Preserve the exact source, runtime/interpreter, backend/history, inputs and concurrency. Use an owned disposable target for writes. Do not attach to a production process, elevate privileges, weaken OS policy, or start paid/remote workloads without the existing authorization. Raw stacks, paths, arguments and profiles stay ignored and local-private; public summaries contain only generalized evidence.

Read loopx/capabilities/performance_diagnosis/README.md for tool selection and blind spots. On installed copies use loopx capability show performance-diagnosis to locate its canonical documentation. Python waits/startup: Pyinstrument; Python threads/native on Linux: py-spy; allocations: Memray; Node/TS: V8 CPU/heap. Go/JVM/kernel costs need their native tools. Research official sources when the installed runtime or missing evidence makes the documented choice uncertain. Do not choose a tool from popularity or claim one profiler covers every layer.

  1. Run the uninstrumented target and record ordinary elapsed time. Use repeated controlled samples for comparisons; profiling time is not a baseline or p95.
  2. Verify the optional tool version locally. Preserve the selected interpreter; install optional tools in an isolated environment when authorized. Do not silently install them into product dependencies or fall back on permissions.
  3. Write the exact target argv to an ignored JSON array. Run loopx performance-diagnosis plan --tool TOOL --command-json FILE --output-directory FRESH_IGNORED_DIRECTORY --format json. Read the whole plan. A plan has not executed or verified tool readiness.
  4. Execute profile_argv through the Host executor as an argv array without shell interpolation. Capture only the owned process; record failures and coverage gaps. Profile a separate Node worker instead of inferring its CPU from Python transport waits. Do not collect locals or automatically profile unrelated children.
  5. Require actual successful target exit and nonempty artifact. Read Speedscope or V8 CPU using loopx performance-diagnosis inspect --profile-json FILE --format json; Memray/heap use their own reporters. Keep threads independent and self/inclusive time distinct. Never sum inclusive rows to obtain latency.
  6. Turn the hotspot into a falsifiable hypothesis. Use a controlled intervention to distinguish caller/transport, shared semantics and backend cost. Reuse the owning contract; do not skip freshness, authority checks or decision inputs.
  7. Repeat the original uninstrumented workload and semantic checks after a fix. Preserve passed, failed and untested results and update the existing checkpoint. Readback of a stack does not prove root cause, improvement or provider admission.

Do not add a new receipt/approval requirement or automatically mutate scheduling, Goal state or telemetry. Stop invoking the workflow to disable it; remove optional tools/captures from their owned local environment when no longer needed.

常见问题

它会衡量模型回答得好不好吗?

不会。基准质量和智能体效率由另一份基准测试技能负责。

它能分析正在运行的生产服务器吗?

不能。该技能指出,不应附加到生产进程上,也不应提升权限。

它使用哪些工具?

它会根据编程语言选择性能分析器,例如 Python 启动和等待的分析使用 Pyinstrument。

详情

作者的原始描述

Diagnose demonstrated CPU, command latency, allocation or IO regressions in an owned process with controlled measurements and language-appropriate profilers. Route benchmark effectiveness, score growth and trajectory efficiency to loopx-benchmark; profiling does not qualify a budget or grant execution authority.

repo: loopx-project/loopx

热度

GitHub 星标
6.5k
排名
#13875
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能