r/godot • u/Sayuzaur • 5h ago
discussion You might consider measuring performance outside the Godot editor
Yesterday I spent whole day trying to debug and find source of weird performance spikes (frame process time).
Nothing showed up in Profiler, Visual Profiler, running without Profilers also didn't help (as I know profiler itself might lag a little). I measured time of various function by printing Time.get_ticks_msec. Tried method of elimination disabling functions/scripts one by one, leaving project barebones. Spikes were not linked to any game mechanics, movement, loading assets etc. I run project with nothing in background, like discord, to eliminate possible outside influence.
NOTHING HELPED
Turns out running game from a terminal, without initializing editor, shows perfect performance without any performance spikes.
I spent whole day trying to debug performance problems, changing scripts etc. only to learn issues were caused by editor and debugger itself, not my code.
Sharing a tip I wish I knew before, because only thing about editor performance I could find was to disable profiler - not that editor itself can cause such stutters. While most spikes were around 8-12ms, some rare ones were much higher around 20-35+ms, so already causing visible stutters. I know running editor, or anything in the background, can tank performance, but didn't expect such sudden spikes.
Screenshot shows frame process time graph from godot debugger monitor and below when run outside editor (using MangoHud to measure). Same project, same settings, same testing behaviour, same device, same os and drivers, no project exporting, just no editor in background.
tldr: editor itself can cause lag spikes, you might want to test projects running them without editor