godotengine / godotengine/godot

Visual Profiler displays incorrect CPU times

Open
#97,473 2 comments 1 reaction 0 assignees View on GitHub
needs testing topic:core topic:editor topic:rendering
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.

![image](https://github.com/user-attachments/assets/6c725198-b32f-45d9-88ee-507f01aa6677)

![image](https://github.com/user-attachments/assets/1d29d93b-b765-404a-b00b-f2dfe5f52fbd)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.