-
Notifications
You must be signed in to change notification settings - Fork 158
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
CPU usage on standby time #280
Comments
This might help: #275 |
Thanks for your reply. I understand the reasons why the Quill library uses the sleep/unsleep algorithm, but in my case, it makes logging functionality too expensive for my app. Is it possible to switch the logging approach to a more simple async mode (without sleeping)? just async tasks. I just use a few messages per 1 ms. |
hey, the library is designed to offer low latency to the hot threads that are logging. |
Thanks for the explanation. Yes, maybe this approach is mostly correct, but I think |
waking up the logging thread on demand is simpler to implement than waking up automatically by itself when there are remaining messages to process. I did that in #281 Can you check if this example is good enough for your use case and then i can merge it to master |
Hello. I am ashamed a little. Just I still think this function is a usefull function. I think it's important to develop the library. And this library has its own architectural design: first, for apps with multithreading; but in my case, I use the CPU in 95% of cases as a conveyer for tasks to the GPU. I began to make my own multithreaded task manager to mostly optimize it for my case. So then I will add logging functionality. |
No worries, I also think it is a useful function to be able to wake up the logging thread on demand if you want to use long sleep durations so I added it. Just the user needs to be aware of the extra costs when calling the I also noticed that there are false positives with This ticket will close when i merge the existing PR. For waking up automatically when the queues are not empty it is much more complicated as we are using one SPSC queue per hot thread and not a common queue for all hot threads so i will just leave it for later for now |
Hello.
I get +5–15% CPU usage. I have the same issue on my laptop (AMD Ryzen 5 5600H) and my PC (AMD Ryzen 5 2600X). The problem even exists when my app doesn't log any data.
The most poor function in my app (by Intel VTune Profiller) reaches 95.282 ms.
Callstack for this operation when my app is minimized (I have 10–12% CPU usage):
I also tried to disable all quill calls, and then I got 0% CPU usage when my app was minimized.
The text was updated successfully, but these errors were encountered: