+2 votes

So, sometimes when i use debug in godot i noticed that when the current function body ends without return or pass debugger in rare occasions continues to work on next empty rows after current function body. Debugger continues to do it until it finds new function body, after which it returns to whatever it was doing.
Of course, it doesnt wreck program logic or generate error but i was wondering if these extra debugger steps somehow add extra unnessary steps to program execution, so my question is: if i will add return statement at the end of the functions will it optimize the program?

asked Jun 26 in Engine by crablord (16 points)

You could try running diagnostics yourself to check this by comparing elapsed time values on similar functions. OS.get_time() is available everywhere.

For accurate microbenchmarking, you'll want to use OS.get_ticks_usec() which returns a value in microseconds instead of OS.get_time().

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.