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

Remove event loop spamming when new event arrives #167

Merged

Conversation

DavidHusicka
Copy link
Contributor

new_event method is called when a new event arrives on an event loop. Putting new event (in this case BlitzEvent::Poll) on the same event loop from this method causes this method to be called again. This ends up spamming event loop, 100% CPU utilization on some operating systems, and makes the poll "spin".

Copy link
Collaborator

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense. Which platform(s) are you seeing the high CPU usage on?

@DavidHusicka
Copy link
Contributor Author

This makes sense. Which platform(s) are you seeing the high CPU usage on?

I have 100% CPU usage on a single core on Linux wayland. I already brought that up on Discord before.

https://discord.com/channels/899851952891002890/954257659597553664/1272540988057063525
https://discord.com/channels/899851952891002890/954257659597553664/1272824155674251357

`new_event` method is called when a new event arrives on an event loop. Putting new event (in this case `BlitzEvent::Poll`) on the same event loop from this method causes this method to be called again. This ends up spamming event loop, 100% CPU utilization on some operating systems, and makes the `poll` "spin".
@DavidHusicka DavidHusicka force-pushed the remove-spinning-on-new-event branch from ffd38ef to 3660bb5 Compare November 30, 2024 22:07
@nicoburns nicoburns merged commit 19c28be into DioxusLabs:main Nov 30, 2024
8 checks passed
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.

2 participants