5

I press Run button to start my program work then I press button Start CPU Usage Profiling. At the end I get a file like GO-version_username_time.zip.

What should I do next? How can I get a list of most expensive functions?

Kenenbek Arzymatov
  • 8,439
  • 19
  • 58
  • 109

1 Answers1

8

Update:

As of GoLand 2019.1, it is possible to profile Go applications or Go tests. See this article for more information on how to do this.

Old post:

Currently, the IDE does not have any Go profiling support. You can watch/vote for this issue for when profiling will be integrated into the IDE.

The functionality you've mentioned, Start CPU Usage Profiling, relates to profiling the IDE itself, in case performance problems occur and need to be reported to the developers.

dlsniper
  • 7,188
  • 1
  • 35
  • 44
  • If you have written benchmarks, it might be possible to configure the test command to generate a profile that you could then read use pprof. Haven't figured it out yet, I'll update if I do. If anyone has had luck with this, any input would be appreciated. – Jaxon Pickett Sep 26 '18 at 18:14
  • 1
    You can follow the instructions here to use the profiling tools, https://blog.golang.org/profiling-go-programs However, the IDE currently does not have any special support for this. – dlsniper Sep 27 '18 at 06:01
  • I've found that if you want your benchmarks to automatically generate profiles, you can add `-test.cpuprofile cpu.pprof` to the "Program Arguments" field in the test command configuration modal. – Jaxon Pickett Sep 28 '18 at 12:41