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

Make render thread sleep when not rendering to reduce cpu load. #1285

Merged
merged 1 commit into from Sep 18, 2023
Merged

Make render thread sleep when not rendering to reduce cpu load. #1285

merged 1 commit into from Sep 18, 2023

Conversation

Ernovation
Copy link

When an AndroidViewFilter is used, the application uses all the cpu cycles it can, because it renders in a busy loop.
This commit introduces a short sleep when the view does not need to be rendered.
It would be better to communicate between the main thread and the view rendering thread: to make the view rendering thread wait until it gets notified by the main thread when it is done drawing the frame, and needs another frame. However, this works well enough and requires only a very minor change.

@pedroSG94 pedroSG94 merged commit a76e75a into pedroSG94:master Sep 18, 2023
1 check passed
@pedroSG94
Copy link
Owner

Thank you for the PR.
I will try optimize it as you suggested on nexts commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants