Power savings & hardware usage #7556

Open
opened 2024-05-04 15:04:34 +00:00 by HDAKFD · 4 comments
HDAKFD commented 2024-05-04 15:04:34 +00:00 (Migrated from github.com)

Back-ends:

imgui_impl_SDL.cpp + imgui_impl_SDL2_RENDERER_cpp

Compiler, OS:

Windows 11

Full config/build information:

Hello, i am working on web application that should be able to run on all devices, the issue im having is related to hardware usage (CPU, GPU) most browsers has GPU acceleration and the performance is just fine. But the issue is that some users might not have external GPU at all which makes things harder. The CPU (without GPU acceleration) performance with quite new intel is around 50% of the CPU.

I found few powersaving concepts, but none of them really solved the issue since once i didn't idle the performance was similar to default imgui. Is there any powersaving concept that caches drawn objects of the drawlist and updates only the objects where changes has happened so every object doesn't have to be rendered again once one needs update.

### Back-ends: imgui_impl_SDL.cpp + imgui_impl_SDL2_RENDERER_cpp ### Compiler, OS: Windows 11 ### Full config/build information: Hello, i am working on web application that should be able to run on all devices, the issue im having is related to hardware usage (CPU, GPU) most browsers has GPU acceleration and the performance is just fine. But the issue is that some users might not have external GPU at all which makes things harder. The CPU (without GPU acceleration) performance with quite new intel is around 50% of the CPU. I found few powersaving concepts, but none of them really solved the issue since once i didn't idle the performance was similar to default imgui. Is there any powersaving concept that caches drawn objects of the drawlist and updates only the objects where changes has happened so every object doesn't have to be rendered again once one needs update.
ocornut commented 2024-05-04 15:44:45 +00:00 (Migrated from github.com)

There’s none yet but I would be surprised if dear imgui ever took 50% of CPU on a several-years old Intel card. Assuming the measurement are right, you may have a bug or bottleneck somewhere else and imho this is what you could investigate.

There’s none yet but I would be surprised if dear imgui ever took 50% of CPU on a several-years old Intel card. Assuming the measurement are right, you may have a bug or bottleneck somewhere else and imho this is what you could investigate.
HDAKFD commented 2024-05-04 15:56:34 +00:00 (Migrated from github.com)

There’s none yet but I would be surprised if dear imgui ever took 50% of CPU on a several-years old Intel card. Assuming the measurement are right, you may have a bug or bottleneck somewhere else and imho this is what you could investigate.

I never meant to blame imgui for the 50%, im using my experimental bind of SDL emscripten with browser canvas drawing. The 50% was the result of rendering with only CPU. With GPU acceleration the result is round about 2-5% CPU 10% GPU

> There’s none yet but I would be surprised if dear imgui ever took 50% of CPU on a several-years old Intel card. Assuming the measurement are right, you may have a bug or bottleneck somewhere else and imho this is what you could investigate. I never meant to blame imgui for the 50%, im using my experimental bind of SDL emscripten with browser canvas drawing. The 50% was the result of rendering with only CPU. With GPU acceleration the result is round about 2-5% CPU 10% GPU
ocornut commented 2024-05-04 21:00:39 +00:00 (Migrated from github.com)

I don’t think any recent intel card can’t render triangles with GPU acceleration so the question is to investigate what’s the rendering process used in that situation.

I don’t think any recent intel card can’t render triangles with GPU acceleration so the question is to investigate what’s the rendering process used in that situation.
sonoro1234 commented 2025-03-14 06:41:08 +00:00 (Migrated from github.com)

What I have found, at least on my laptop, is that vsync reduces GPU usage as expected but not CPU usage unless I set sdl_Delay in the loop (with the time nedded for the desired frame rate). This reduces dramatically my CPU usage. (from 10% to 0.5 %)

It happens not only in SDL but also in GLFW so that I think that is related to how the GPU driver implements vsync (not only openGL but Vulkan also)

Perhaps this should be alerted so that people can try that before start blaming imgui?

What I have found, at least on my laptop, is that vsync reduces GPU usage as expected but not CPU usage unless I set sdl_Delay in the loop (with the time nedded for the desired frame rate). This reduces dramatically my CPU usage. (from 10% to 0.5 %) It happens not only in SDL but also in GLFW so that I think that is related to how the GPU driver implements vsync (not only openGL but Vulkan also) Perhaps this should be alerted so that people can try that before start blaming imgui?
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#7556
No description provided.