-
Notifications
You must be signed in to change notification settings - Fork 26
Profiling Godot engine (native code) with dotTrace or JetBrains Rider
The following instruction is Windows-only. Native profiling in JetBrains dotTrace and Rider is currently Windows-only.
For this guide, I have in mind a case when there is some code, which is slowing down the main thread.
For the example I have put a heavy code inside the _input
method in GDScript. However it doesn't matter, which bindings were used GDScript, C#, Rust or any other. This guide is intended to cover a use-case when using the Godot GDScript profiler is not enough and you need to see what is happening in the native code of the engine.
-
Follow the Godot docs to compile the engine from source and generate sln file. Alternatively, you may use un-official builds with native symbols linked here
-
Open sln in Rider
-
Run the Game. It doesn't matter how. I was using the run-configuration in Rider. You may make a copy of auto-generated run-configuration and customize it to directly run the Game.
- Run -> Profile running process
- Type
godot
and select the game process
-
Open the snapshot
-
Select "Main Thread"
Expand the tree until realizing which operation took time.
In this case, there is some heavy code inside the _input method in GDScript
Please let me know, what you think about this instruction and the JetBrains native profiling in here.
Minor dotTrace requests which I filed, while preparing this doc:
- DTRC-31337 Navigation from the native profiling snapshot doesn't work
- DTRC-31338 Attempt to open snapshot in a Standalone dotTrace
- DTRC-31336 Change Standalone path automatically changes working dir
- DTRC-31341 Main thread should be the first one (Rider integration)
- DTRC-31342 DPA: enable per run-configuration
- DTRC-31343 DPA: Filterning doesn't work for native code
- DTRC-31344 Run->"Profile running process" usability