Skip to content
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

Power savings & hardware usage #7556

Open
HDAKFD opened this issue May 4, 2024 · 3 comments
Open

Power savings & hardware usage #7556

HDAKFD opened this issue May 4, 2024 · 3 comments

Comments

@HDAKFD
Copy link

HDAKFD commented May 4, 2024

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
Copy link
Owner

ocornut commented May 4, 2024

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.

@ocornut ocornut changed the title Hardware usage Power savings & hardware usage May 4, 2024
@HDAKFD
Copy link
Author

HDAKFD commented May 4, 2024

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
Copy link
Owner

ocornut commented May 4, 2024

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.

ocornut added a commit that referenced this issue May 7, 2024
…#7556, #5116 , #4076, #2749, #2268)

currently: ImGui::SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags_TryToAvoidRefresh);
- This is NOT meant to replace frame-wide/app-wide idle mode.
- This is another tool: the idea that a given window could avoid refresh and reuse last frame contents.
- I think it needs to be backed by a careful and smart design overall (refresh policy, load balancing, making it easy and obvious to user).
- It's not there yet, this is currently a toy for experimenting.
My other issues with this:
- It appears to be very simple, but skipping most of Begin() logic will inevitably lead to tricky/confusing bugs. Let's see how it goes.
- I don't like very much that this opens a door to varying inconsistencies
- I don't like very much that it can lead us to situation where the lazy refresh gets disabled in bulk due to some reason (e.g. resizing a dock space) and we get sucked in the temptation to update for idle rather than update for dynamism.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants