harrand / Topaz

C++20 Game Engine
https://harrand.github.io/Topaz/
MIT License
35 stars 3 forks source link

Dbgui is extremely slow #59

Closed harrand closed 1 year ago

harrand commented 2 years ago

Existence of dbgui at all grinds us down to maximum triple digits fps, even if theres basically nothing going on.

Because it's debug-only, profiling it will require local changes which is likely the only way to figure out whats being so slow in the imgui backend. Not a trivial task

harrand commented 2 years ago

Note: Unimpressive performance on debug builds is rarely worth bringing up, although dbgui slowdown is so extreme and noticeable that it could lead to non-realtime fps yields on debug builds in actual games. This defeats the point of debug so is worth the analysis and fixing time.

harrand commented 1 year ago

Looking at the dbgui imgui impl render function profiling... It's not as bad as I thought.

On tz_terrain_demo it seems to average about 1ms per frame. This means dbgui alone seems to run at about 1000fps. While the perf could definitely be improved, I'm not convinced this is a real perf issue at all - I was probably just too used to seeing 7000fps ish, which is not gonna be maintained as soon as theres any real cpu load (such as a game). That being said though, will commit the dbgui profiling instrumentation I have, because it might come in useful again in the future