giu icon indicating copy to clipboard operation
giu copied to clipboard

[Feature Request] Please make cpu usage lower

Open deoxyimran opened this issue 1 year ago • 3 comments

Related problem

OS: Linux CPU: intel x86_64

CPU usage constantly hitting 1% sometimes goes over 2.4% when the app is just sitting idle. I thought processing is only done when there is input event? Usage in the range 0.5 to 0.8% is completely acceptable but it's not at all stable, cause it frequently shoots way beyond the 1% mark and this is bugging me. The high usage also drains the battery; I am using a laptop and saving battery power is crucial! Please work on these issues. Other than that the toolkit is just excellent!

Your request

CPU should be used less when app is hidden or idle.

Alternative solution

No response

Additional context

No response

deoxyimran avatar Oct 16 '24 05:10 deoxyimran

Related to this, I've found the GUI is updated - the loop function is executed, thus the GUI is redrawn - even when there is no change to any state, i.e. the mouse is NOT moved, or clicked.

This is wasteful, is there a way to prevent this? BTW - this also occurs in cimgui-go

runrc avatar Feb 18 '25 21:02 runrc

I ran the demo with profiler. Interessting thing is that we have a cgo call that consumes quite a lot of cpu time. I'll have to take a closer look on that.

Here is what I mean:

Image

gucio321 avatar Apr 10 '25 09:04 gucio321

https://github.com/AllenDang/cimgui-go/pull/428 should make progress on this

gucio321 avatar May 28 '25 14:05 gucio321