Add methods to accurately return the time spent in _process()
or _physics_process()
for the last frame
#6809
Labels
_process()
or _physics_process()
for the last frame
#6809
Describe the project you are working on
Official benchmarks repository for Godot, which will be used for performance testing.
Describe the problem or limitation you are having in your project
godot-benchmarks measures 5 different types of performance metrics:
As I noted in godotengine/godot-benchmarks#32 description, we currently lack a method that accurately reports the time spent processing idle or physics in real-time. While we have
Performance.get_monitor(Performance.TIME_PROCESS)
andPerformance.get_monitor(Performance.TIME_PHYSICS_PROCESS)
, these are only updated once per second, which is insufficient for godot-benchmarks' needs.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add methods to accurately return the time spent in
_process()
or_physics_process()
for the last frame, rather than an average value over the last second.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Right now, the values reported by the Performance singleton are set here: https://github.com/godotengine/godot/blob/8c729f0f34a92b92a1a8204e1d56b6ad05cfd27b/main/main.cpp#L3289-L3291
I suggest adding methods and properties in the Engine singleton to store the values, but do so every frame instead of once per second. The current mechanism can be kept to keep the monitors' behavior intact.
If this enhancement will not be used often, can it be worked around with a few lines of script?
For godot-benchmarks' use cases, the workaround I use is:
This is much less accurate though, as it will only keep the "worst" measurement reported during the benchmark's runtime. Each benchmark runs for 5 seconds, and the previous/next benchmarks may "bleed" over the measurement, causing it to be even less accurate.
Is there a reason why this should be core and not an add-on in the asset library?
This is about improving the built-in performance measurement tools, which gives developers more ways to optimize their projects.
The text was updated successfully, but these errors were encountered: