In our sensible information to profiling in Go, we talked about that among the Go builders we talked to keep away from pprof if they’ll. For a lot of of them, typical Go providers carry out effectively sufficient with out optimizations, so once they do must profile, it may really feel like a “rescue mission” with a software they aren’t actually skilled with. They’ve to recollect which profile to take and how you can acquire it, after which make sense of lots of low-level knowledge.
GoLand 2026.1.2 made the amassing half simpler with a built-in profiler. In GoLand 2026.3, we’re taking it a step additional – your AI agent can now use that profiler too. You describe the symptom, for instance, “reindexing via POST /reindex takes for much longer than it ought to, profile it”, and the agent runs your app with the profiler, picks the profiles that match the issue, reads the outcomes, and factors you to the code that’s accountable. You don’t want to know what a mutex profile is or which pprof flags to move.
This works with Claude Code, Codex, and Junie via the bundled goland-profiler talent and a set of MCP instruments. Under, we take a better have a look at what the agent does and how one can cut up the work with it.
What occurs whenever you ask the agent to profile your app?
The goland-profiler talent tells the agent when to achieve for the profiler, for instance, for sluggish execution, excessive CPU utilization, extreme allocations, reminiscence development, blocking, lock competition, or goroutine leaks. It additionally explains how you can work with the MCP instruments that give the agent entry to GoLand’s profiler. A typical run goes like this:
- Run with the profiler: When you’ve got already began the app with the profiler, the agent reuses that run. In any other case, it begins the app with the profiler utilizing your run configuration, simply as you’d with the Run with Profiler button. The talent explicitly tells the agent to not add
web/http/pprofor any short-term profiling code, so your supply code stays untouched. Whether it is unclear whether or not the app is doing what it ought to, the agent also can learn its output. - Choose the profile: The talent instructs the agent to take the narrowest seize that solutions the query. For CPU points, which means recording whereas it runs a workload, corresponding to a load generator, or taking a timed profile if the load is regular. For different issues, it takes a block profile for synchronization waits, a mutex profile for lock competition, or two heap profiles to check when reminiscence retains rising. Allocs, goroutine, and goroutine leak profiles can be found too.
- Learn the outcomes: Every seize comes again with a abstract of as much as 5 of the most well liked capabilities in your code, exhibiting the place their price goes, which strains are the most costly, and the way they’re reached. The agent begins from this abstract and solely asks for extra element – the highest capabilities beneath a given root, the decision paths to a operate, or the most costly strains in a operate – when the abstract just isn’t sufficient.
- Report the findings: The agent tells you what the primary bottleneck is and the way a lot it prices, which name path in your code results in it, the place the recent strains are, and whether or not it’s CPU work, allocations, blocking, competition, or goroutine development. It additionally suggests a repair or an additional measurement, and it’s instructed to separate what the profile reveals from its personal hypotheses. When you ask, it may make the change too.
Each profile the agent captures results in the profiler session and in Latest profiles within the Go Optimization software window, identical to those you seize your self. If you wish to double-check the agent’s conclusion, you possibly can open the identical profile and have a look at the flame graph.
MCP instruments
What the agent can do with GoLand’s profiler
|
Run the app with the profiler Begins and stops your app with the profiler, the identical means the Run with Profiler button does. Your supply code just isn’t modified. run_with_profiler
Launches a run configuration with the profiler enabled. list_profiled_runs
Lists lively and just lately stopped profiled runs, together with those you began from the IDE. get_profiled_run_output
Returns this system output of a profiled run, such because the app’s logs. stop_profiled_run
Stops the profiled software. |
Seize profiles Saves captured profiles to the session and to Latest profiles, so you possibly can open them in GoLand later. take_profile
Captures a profile (a snapshot, or a CPU profile for a set period) and returns it with a abstract. start_cpu_recording
Begins a CPU recording. stop_cpu_recording
Stops the recording, saves the CPU profile, and returns a abstract. |
Learn profiles Works with any profile – one the agent captured, one you captured, or the one presently open within the editor. list_profiles
Lists session, latest, and presently open profiles. profile_summary
Returns totals and the highest 5 capabilities with their scorching strains and name paths, for any saved profile. profile_top_frames
Ranks capabilities by self or cumulative price, much like profile_call_paths
Exhibits the decision paths that result in a given operate. profile_source_lines
Ranks the supply strains of a operate by price, much like |
How you can cut up the work with the agent
How a lot of the method you hand over is as much as you. These are the three setups we now have discovered most helpful:
- The agent does the whole lot: You describe the issue, and the agent handles the remainder, from launching the app to explaining the outcomes. It is a good possibility whenever you have no idea the place to start out.
- You profile, the agent analyzes: You run the profiler your self, open a profile, and ask the agent what it sees. The agent can learn the profile that’s presently open, so there may be nothing to export or describe.
- You run the app, the agent captures: You begin the app with the profiler and get it into the state you care about, for instance, after a warm-up or with a production-like dataset loaded, after which ask the agent to take the profiles.
Workflows
3 ways to separate the work with the agent
|
The agent does the whole lot Helpful when you already know one thing is sluggish however don’t know the place to start out. 1 You “Reindexing via 2 Agent Hundreds
goland-profiler, picks a run configuration, and calls run_with_profiler.
Your code stays as it’s. 3 Agent Sends some load to the app, data CPU with
start_cpu_recording and stop_cpu_recording, and takes a heap or allocs profile if the symptom factors to reminiscence.
Every seize returns a abstract with the most well liked capabilities and name paths. 4 Agent If the abstract just isn’t sufficient, digs deeper with 5 Agent Explains what’s sluggish and why, and might repair it in case you ask.
The profiles keep in GoLand, so you possibly can open them and examine. |
You profile, the agent analyzes You keep accountable for the run, and the agent helps you make sense of the profile you have already got open. 1 You Run the app with the profiler, reproduce the sluggish request, and seize a profile the same old means. 2 You Open the profile. One thing within the flame graph appears off, however you aren’t positive what. 3 You “Take a look at the open profile. Why are we allocating a lot?” 4 Agent Finds the open profile via
list_profiles, reads it with profile_summary, and goes deeper with profile_top_frames, profile_call_paths, or profile_source_lines if the abstract just isn’t sufficient.
It reads the identical profile you’re looking at. 5 Agent Explains the recent path by way of your code and suggests a repair. |
You run the app, the agent captures You begin the app with the profiler and get it into the state you care about, and the agent takes it from there. 1 You Begin the app with the profiler and get it into the correct state, for instance, after a warm-up or with a production-like dataset loaded. 2 You “It’s working with the profiler now. Seize goroutine and mutex profiles and inform me the place the competition is.” 3 Agent Finds your run with 4 Agent Reads the profiles, checks them in opposition to the supply code, and studies again.
The app retains working till you cease it. |
Present limitations
- GoLand-started app: GoLand’s profiler modifies the executable throughout compilation to reveal the profiling API, so it can’t be connected to an already working course of. The agent both begins the app via a run configuration with the profiler or works with a session you began your self.
- Quick-lived packages: The profiler samples a working course of, so a CLI software that finishes in a fraction of a second doesn’t depart sufficient time to seize something helpful. The talent works greatest for servers, staff, and different long-running providers.
- Examined brokers: We now have examined the workflow with Claude Code, Codex, and Junie. Different brokers that may connect with GoLand’s MCP server may match too, however we now have not verified them but.
How you can strive it
- Replace to GoLand 2026.3 and open your challenge.
- Be certain that
goland-profileris enabled in Settings | AI | Expertise. It’s also possible to prohibit it to particular tasks or flip it off there. - Ask your agent to profile your app, or open a profile you might have captured and ask the agent what it sees.
Inform us what you suppose
We hope this makes profiling one thing you are able to do as a part of your on a regular basis work, and never solely when a service is already in bother. When you’ve got been avoiding the profiler, this is perhaps a very good time to provide it a strive.
We might love to listen to the way it works for you – which setup you find yourself utilizing, whether or not the agent’s summaries are sufficient otherwise you nonetheless open the flame graph, and which tasks it doesn’t work for. Be happy to tag us on X, drop into the #goland-gophers Slack channel, or create a ticket in our YouTrack concern tracker..
Completely satisfied coding,
The GoLand workforce
Subscribe to GoLang Weblog updates

