godotengine / godotengine/godot
Visual Profiler displays incorrect CPU times
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
4.3
### System information
Windows 10, Vulkan forward +, Nvidia 3070
### Issue description
I've been doing a lot of profiling lately to try to find performance issues and added in Tracy support. I've noticed the values profiled in the same area are VASTLY different. I'm getting sub-100 fps, but the render time displayed by the built-in Visual Profiler is only showing around 2ms to render a viewport while Tracy shows ~8ms.


I shifted some of the RENDER_TIMESTAMP macros around as they didn't catch all the code in the function, but they still seem to be falling way short.
### Steps to reproduce
Start the visual profiler and note that the time for rendering does not match the time necessary to render the game at the current framerate. Optionally get the tracy godot addon and add profile points where around things like RENDER_TIMESTAMP("> Render Viewports"); to compare values.
### Minimal reproduction project (MRP)
I don't think it's project specific, but you could use https://github.com/user-attachments/files/17140515/test_light_performance.zip
Contributor guide
Research direction
Start by reproducing the mismatch with the attached minimal reproduction project, the Visual Profiler, and the Tracy Godot addon on the reported Vulkan setup. Compare the Visual Profiler's rendering measurements with the RENDER_TIMESTAMP locations and Tracy timings; done means the profiler reports the rendering time consistently with the observed frame rate and comparison measurements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100