2021-03-24 23:37:53 -04:00
|
|
|
## Profiling
|
|
|
|
|
|
|
|
There are many profiler options to debug performance issues.
|
2021-03-26 13:25:35 -04:00
|
|
|
These can be enabled by supplying the following command-line option and are saved in the `pprof` directory:
|
2021-03-24 23:37:53 -04:00
|
|
|
|
|
|
|
`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`
|
|
|
|
|
2021-03-26 13:25:35 -04:00
|
|
|
In game you can create a heap dump by pressing `~` and typing `dumpheap`. A heap.pprof is written to the `pprof` directory.
|
2021-03-24 23:37:53 -04:00
|
|
|
|
|
|
|
You may need to install [Graphviz](http://www.graphviz.org/download/) in order to convert the profiler output.
|