1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-06 16:00:42 +00:00
OpenDiablo2/docs/profiling.md
2021-03-26 18:25:35 +01:00

17 lines
659 B
Markdown

## Profiling
There are many profiler options to debug performance issues.
These can be enabled by supplying the following command-line option and are saved in the `pprof` directory:
`go run . --profile=cpu`
Available profilers:\
`cpu` `mem` `block` `goroutine` `trace` `thread` `mutex`
You can export the profiler output with the following command:\
`go tool pprof --pdf ./OpenDiablo2 pprof/profiler.pprof > file.pdf`
In game you can create a heap dump by pressing `~` and typing `dumpheap`. A heap.pprof is written to the `pprof` directory.
You may need to install [Graphviz](http://www.graphviz.org/download/) in order to convert the profiler output.