Merged
Conversation
Owner
|
I added a wait until the app is killed. This will be faster to react than a wait and even lighter. But on some system the OS may say that the app isn't responding. (If you can check for that it would be perfect). |
Contributor
Author
|
I've tested (this time by stashing the previous modifications before) and there was a simple error compilation on the if condition. I've rewritten it and tested it. As expected we obtain better results than before. I did not thought of implementing a mutex, thanks for that! |
Owner
|
Thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When updating ytermusic I saw a huge spike in cpu usage (from 0.2 % to 100 % CPU core usage).
I used samply for profiling and saw that most of it was because of the loop checking if the shutdown signal have been sent.
I wanted to return to an async function but I did not want to break the macOS
run_window_handlerand I assume that it is made that way for a reason.Instead of refactoring everything again, I just placed 100ms sleep into the loop, which I think is a reasonable time for a shutdown procedure.
This is not perfect, but with that we obtain a similar performance than before.
EDIT: I've just noticed that should close issue #132 .