You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to profile Godot ECMAScript code? Either in the editor, or by some other means?
From a quick read of the source I don't think the profiling methods have been implemented, but is there some way to attach a different debugger than the Godot one? Or maybe even by running a build of the engine source and attaching a C++ debugger to that. Has anyone had any success?
FWIW, I tried Valgrind but couldn't get much useful information out of it down to the level of individual JS functions.
I've instead just made a simple decorator for now that allows you to add @measure to functions in your TS project, and if you add the Performance.jsx script as autoload in your project, it will print microsecond-accurate timing info (in ms) to the Godot output.
You can also call the time and endTime functions directly to collect and record the timing information.
Activity
lewiji commentedon Feb 15, 2021
FWIW, I tried Valgrind but couldn't get much useful information out of it down to the level of individual JS functions.
I've instead just made a simple decorator for now that allows you to add
@measureto functions in your TS project, and if you add thePerformance.jsxscript as autoload in your project, it will print microsecond-accurate timing info (in ms) to the Godot output.You can also call the
timeandendTimefunctions directly to collect and record the timing information.https://github.com/lewispollard/godot-ecma-perftools
It would be nice to support in-editor profiling but unsure what steps would need to be taken, for now this will do for my simple purposes.