-
Notifications
You must be signed in to change notification settings - Fork 55
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
Better waitEvents implementation for *nix-like systems #78
Conversation
Thanks!
|
I put back |
This still seems to have modified the permissions, which shouldn't be needed. |
Sorry about that, fixed. |
The changes in #90 adjusted "readBytes", but this PR was about adding polling in "waitEvents". I hoped to see a reduction of CPU usage of the LinuxEventThread (which consumes up to 10% CPU on a Laptop for me) with this PR, but #90 does not seem to help there. Would it be useful to apply the changes to waitEvents in this PR as well so the main event loop polls for events instead of busy-looping and sleeping? |
@centic9 sorry for the late response on this, had to do quite a bit of background research. Could you give us a little more information on your test environment and what you are using to profile the cpu spikes you are seeing? We still appear to be having some issues with opening the serial port in blocking mode (at least this appears to be the case) |
@graynk are you seeing performance issues with the most recent release version? How is your test environment configured? |
Sorry, actually I haven't been using this library for a long time now, I've moved on from that project and changed my employer since then. |
No problem, I have the following sample-application and the following impact on CPU (Intel(R) Core(TM) i7-8650U, Linux reports 8 entries in /proc/cpuinfo) when I run this locally:
For sampling CPU I simply use JVisualVM, it shows that the "EventThread" is using up the CPU in the first two cases and "LinuxEventThread.run()" is the method which consumes almost all the CPU. Sample application:
Patch to add "poll" and adjust sleep in inner loop:
|
Should close #53