-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profiler missing most of my functions. #40251
Comments
Do you have a minimal reproduction project you could provide us? It would help pinpoint the part of your scripts that cause the spikes and then figure out if that could be added to the profiling data. |
Related to #23715 (but not identical, according to your description). |
@Calinou Yes it's the same problem but in a different area it seems. I don't know if it's already part of the plan for profiling improvements, but both cases show we need to start adding more details into profiling information (and I'm sure there's more). We could have some extra sub-categories to get more details about the main loop, physics and possibly rendering (if some areas can be clearly identified). Maybe that could be just for debug, or disabled in release by default and based on some project settings. |
I have this issue that though idle time might be over 100 millis, script functions are only shown close to 5-10ms. What's interesting is that when i comment some of my code, lowering frame time for about two times, the rest of script functions start to show up in profiler. This thing really messed up my profiling... |
Please open a proposal for that 🙂 |
@Zoomulator I had a similar issue - then I noticed that there is an option in editor "Profiler Frame Max Functions" that's defaulting to 64 - and I had 2000-5000 calls per frame. See if raising that helps your case. |
Are there any negative side effects to increasing this value? Maybe we should increase its default value. |
I personally never saw a side effect, but I imagine it can allow the editor to allocate much more memory and will probably introduce higher load when profiling - but then when I'm profiling I'm expecting to have bad performance. I would assume value like 8192 would be enough for my use-case; I'd personally opt for unlimited - because there is absolutely no use-case I can see myself doing that would benefit from hiding some function calls from me. But the easy way is to increase that by default. |
@lekoder I actually mentioned trying to increase that value in the bug report. It made no difference in my case. |
Oh, sorry, I searched through for the full name. |
I just noticed Profiler Frame Max Functions is silently clamped between 16 and 512 in godot/editor/debugger/script_editor_debugger.cpp Lines 940 to 943 in c9bd11a
This is also the case in the godot/editor/script_editor_debugger.cpp Lines 1676 to 1680 in 3a8e1f3
|
Oh, that's great... I probably just copy pasted it in |
@Faless What do you think would be a good default value for |
In current Considering that we have a 8 MiB buffer, I think for In |
This should decrease the number of instances in which functions don't appear in the profiler. This partially addresses godotengine#40251.
@lekoder Oh I'm mistaken, I though you meant Setting |
@Zoomulator this is not an upper limit, but merely a default. As you can see from screenshot I have absurdly high value there, on grounds that I'd actually prefer the engine to work sluggish or crash with out-of-memory error when profiling to missing a function in profiler output. |
Oh, I missed that, sorry. Luckily I'm running a custom-built editor, so I can just raise that myself. |
This should decrease the number of instances in which functions don't appear in the profiler. This partially addresses godotengine#40251.
This isn't the case as servers (physics, rendering, …) don't count as script functions: #23715 |
Worded differently, I ran into a problem making it difficult to see where I lost time and wondered if a new ticket was needed. So it's not this ticket but there was already a relevant created then. Sadly, neither have a milestone planned yet. I'll have to try and track it differently. I use really big textures (3000*3000) for my Polygon2D's that a lot of the time I zoom out to (giving a scale of 0.1). I'm thinking this might be problematic (despite earlier tests not giving problems, far as I could tell). |
Fixes the issue by adding a mechanism by which the functions that were previously disappearing can be profiled too. This is optional with an editor setting, since collecting more information naturally slows the engine further while profiling. Fixes godotengine#23715, godotengine#40251, godotengine#29049
Fixes the issue by adding a mechanism by which the functions that were previously disappearing can be profiled too. This is optional with an editor setting, since collecting more information naturally slows the engine further while profiling. Fixes godotengine#23715, godotengine#40251, godotengine#29049
Fixes the issue by adding a mechanism by which the functions that were previously disappearing can be profiled too. This is optional with an editor setting, since collecting more information naturally slows the engine further while profiling. Fixes godotengine#23715, godotengine#40251, godotengine#29049
Godot version:
3.2.2
OS/device including version:
Windows 10
Version 1903
Build 18362.900
Issue description:
The profiler fails to detect a large portion of my functions and shows a suspiciously low Script Function time.
Using
Measure: Frame Time (sec)
andTime: Inclusive
.Here's a screenshot of the profiler on one of the spikes I'm investigating:
It states that the frame takes 34ms in Idle time, but the Script Function total is only 0.19ms!
Further more, the time for Script Function seemingly drops when the load spike occurs. (Pink: Idle, Yellow: Script)
The spike occurs at the start of a turn in my game. It's spread out since each enemy character's turn takes at least one frame, ends its turn and then moves on to next until its the players turn. All of this is triggered by signals and some use of
yield(get_tree(), "idle_frame")
I've checked and doubled checked, by using
OS.get_ticks_usec()
andEngine.get_idle_frames()
, that one of the missing functions actually runs during these frames and is a time hog, but it won't show up in the profiler (and I double checked the neighboring frames too)!In fact most of the functions that I'd expect to show in the profiler for that frame are missing.
I managed to optimize the function, so I'm convinced its my own code and not any server or file loading that occurs during these frames.
I've tried twiddling the Max Functions setting, but no change. Made a grep for func definitions and only got ~750, so it seems hardly an issue with the default setting of 16k, but I've tried 32k and 64k to make sure.
The drop in Script Function time as the load increases suggests to me that there's some silent overflow besides the Max Function setting.
Steps to reproduce:
Unfortunately I've failed to pinpoint what causes it. Hope this report is informative enough anyway! I'll make another attempt at reproducing it at a small scale.
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: