Why is idle time in profiler too high?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By supper_raptor

I am profiling my game and for the first 15 minutes i am getting 60 fps. After that the fps drops to 45 -50 and after 5 minutes the fps drops to 30 and so on .

By using profiler everything seems OK except for idle time , its the reason for low frame rate, Its high.

My Memory usage and object count are constant .

What exactly is idle time and why is it increasing over time ?

Is your game/computer completely idle for those 15 minutes?

Zylann | 2020-04-09 20:51

no bots were fighting each other

supper_raptor | 2020-04-10 06:42

Do FPS come back up if you interact with the window? Check your graphics card power management state, sometimes it might decrease due to “inactivity” which causes slowdowns like this. Check also memory and GPU memory (not just from Godot’s debugger).

Another possibility is a bug in your game accumulating something, but not sure what it could be (it doesnt have to be objects, could be an array getting bigger and bigger, a draw call iterating more and more, or a GDNative library doing something wrong).

Otherwise, Godot bug, but it’s even harder to tell what. Maybe you can try making a simple project to see if anyone else can reproduce it.

FYI, in Godot 3.2.1 (still using 3.0?), idle time correspond to this section of the main loop: https://github.com/godotengine/godot/blob/02ed72c3733aa2290dec9ffca52a7bbbc96382c3/main/main.cpp#L2026-L2049

Zylann | 2020-04-10 09:55

Thanks i will check.

supper_raptor | 2020-04-10 10:36

Another possibility is a bug in your game accumulating something, 

Yes you are right, i fixed it. It was gdnative plugin , it was accumulating movement states without clearing used ones.
Thanks

supper_raptor | 2020-04-13 15:22

:bust_in_silhouette: Reply From: compassdevs

HI, i think i might have the same issue, my idle time is very high.

How did you figure out what was causing it?

Thanks

Use the Comment button to reply, not answers.

Calinou | 2020-10-07 11:54