AI 编程 4.0 · 优秀 2026-11-06 · 文章

GoLand's Profiler Now Works with AI Agents

GoLand 2026.3 把内置 Go profiler 交给 AI agent 使用:用户只描述症状(如 POST /reindex 索引重建慢得离谱,帮我 profile),agent 负责带 profiler 启动应用挑选匹配问题的 profile读结果并定位到具体代码,用户无需懂 mutex profile 或 pprof 参数通过捆绑的 goland-profiler skill 加一组 MCP 工具,Claude CodeCodexJunie 都能接入;skill 明确禁止注入 net/http/pprof 或临时插桩代码,保持源码不动JetBrains 称 agent 能用约一半 token 找到相同瓶颈

打开原文回到归档

GoLand's Profiler Now Works with AI Agents

中文导读

GoLand 2026.3 把内置 Go profiler 交给 AI agent 使用:用户只描述症状(如 POST /reindex 索引重建慢得离谱,帮我 profile),agent 负责带 profiler 启动应用挑选匹配问题的 profile读结果并定位到具体代码,用户无需懂 mutex profile 或 pprof 参数通过捆绑的 goland-profiler skill 加一组 MCP 工具,Claude CodeCodexJunie 都能接入;skill 明确禁止注入 net/http/pprof 或临时插桩代码,保持源码不动JetBrains 称 agent 能用约一半 token 找到相同瓶颈

为什么值得关注

GoLand 2026.3 让 Claude Code/Codex/Junie 通过 skill+MCP 直接驱动 Go profiler,同一瓶颈只用一半 token

Relevance: a production IDE exposes its profiler to agents as a bundled skill plus MCP tools (run, capture, read), letting Claude Code/Codex/Junie find the same bottlenecks with half the tokens - a concrete tool-layer pattern for performance work beyond chat-only advice.

关键信息

English Excerpts

GoLand 2026.1.2 made the collecting part easier with a built-in profiler. In GoLand 2026.3, we are taking it a step further – your AI agent can now use that profiler too. You describe the symptom, for example, “reindexing through POST /reindex takes much longer than it should, profile it”, and the agent runs your app with the profiler, picks the profiles that fit the problem, reads the results, and points you to the code that is responsible. You do not need to know what a mutex profile is or which pprof flags to pass.
This works with Claude Code, Codex, and Junie through the bundled goland-profiler skill and a set of MCP tools. Below, we take a closer look at what the agent does and how you can split the work with it.
take_profile Captures a profile (a snapshot, or a CPU profile for a set duration) and returns it with a summary.
profile_summary Returns totals and the top 5 functions with their hot lines and call paths, for any saved profile.
run_with_profiler Launches a run configuration with the profiler enabled.
GoLand-started app: GoLand’s profiler modifies the executable during compilation to expose the profiling API, so it cannot be attached to an already running process. The agent either starts the app through a run configuration with the profiler or works with a session you started yourself.
Tested agents: We have tested the workflow with Claude Code, Codex, and Junie. Other agents that can connect to GoLand’s MCP server may work too, but we have not verified them yet.
Short-lived programs: The profiler samples a running process, so a CLI tool that finishes in a fraction of a second does not leave enough time to capture anything useful. The skill works best for servers, workers, and other long-running services.
Three ways to split the work with the agent

English Summary

GoLand 2026.3 lets your AI agent drive the built-in Go profiler: you describe the symptom (for example, reindexing through POST /reindex takes much longer than it should, profile it), and the agent runs your app with the profiler, picks the profiles that fit the problem, reads the results, and points you to the responsible code, without needing to know mutex profiles or pprof flags. It works with Claude Code, Codex, and Junie through a bundled goland-profiler skill plus MCP tools; the skill tells the agent when to reach for the profiler (slow execution, high CPU, excessive allocations, memory growth, lock contention, goroutine leaks) and explicitly forbids adding net/http/pprof or temporary profiling code, so sources stay untouched. JetBrains reports the agents found the same bottlenecks with about half the tokens.

Obsidian Notes

  • 内容由 opencli web read(curl 回退)拉取博客原文生成。
  • 中文导读锚定在条目已有摘要与博客原文;未补充原文之外的实验细节。