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

Constant CPU load #92

Open
IgitBuh opened this issue Mar 17, 2021 · 6 comments
Open

Constant CPU load #92

IgitBuh opened this issue Mar 17, 2021 · 6 comments

Comments

@IgitBuh
Copy link

IgitBuh commented Mar 17, 2021

This component creates a constant CPU load of 1-2% on one core, even if it isn't doing anything and even if it isn't visible at all (idle minimized application). Just run the demo together with Sysinternals Process Explorer and observe the CPU load. Note, that more cores result in a lowed value, because it represents the usage based on all available cores in total.

Apparently, the reason for this is the constantly running TThreadTimer in TTimerThread. Disabling the timer, stops this CPU load.

This timer seems to be used for animations, but if the application is in an idle state and there are no animations, then there should be no CPU load.

You might say that 1-2% CPU load on one core isn't much. Imagine, more components or other applications would do the same. Just 10 applications with this issue would cause 10-20% constant CPU load, draining a laptop battery and blowing fans.

Either the timer should be able to perform its idle tasks without any CPU load or the timer needs to be stopped and started when it is actually needed.

@landrix
Copy link
Collaborator

landrix commented Mar 18, 2021

I don't see any CPU load when the application is minimized. I think a good AnimationTimerInterval is 100ms. For all other things I have no idea at the moment.

@IgitBuh
Copy link
Author

IgitBuh commented Mar 18, 2021

Did you check with Process Explorer as described? (don't use the Task Manager as it might not be accurate enough if you have many powerful cores)
I made sure that it is not just a thing on a specific device. It was confirmed on multiple laptops and on two different VMs. The less cores, the higher the total CPU load, because it runs in a single thread.
The thing is, it performs all these animation tasks and checks all the time (10x per second), even if there is no interaction with the tabs or it isn't even visible at all. That doesn't seem right.

@landrix
Copy link
Collaborator

landrix commented Mar 18, 2021

I changed something, can you test it?

@landrix
Copy link
Collaborator

landrix commented Mar 22, 2021

I deactivated it again for now, too many side effects. Somebody has to take a closer look.

@IgitBuh
Copy link
Author

IgitBuh commented Mar 22, 2021

I wasn't able to test it yet, because I cannot install any "nightly" builds on the productive dev system. I was going to set up an additional test dev system for this, but apparently you have already found problems.

But you have been able to reproduce the constant CPU load that I described, right?

@landrix
Copy link
Collaborator

landrix commented Mar 22, 2021

yes i was able to reproduce it. But there are problems with my patch when the tab is on a panel.

you can check agains this commit

1c7215a

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