-
Notifications
You must be signed in to change notification settings - Fork 131
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
Properly handle the race condition #164
Conversation
Use synchronization primitives instead of sleeping. This eliminates the need for the timeout parameter. The affected class is effectively internal, so this "should" not affect regular users. Also fixed the tests: they didn't clean up after themselves. Added benchmarks. Fixes #152
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the new benchmark say? Did this PR affect performance much?
On MacOS, there is a significant difference. Before (note time is in seconds):
After (note time is in ms):
On Linux, there is no difference in performance, but I could not reproduce the problem, the benchmark times are about the same (~300ms). |
Oh wow, 30x slower now? We'll have to look into that, that's too much. I'll try to check too (I have a macbook). |
No, it's the other way around. Before it was 10s, now it's 338ms (0.338s). |
Oh yes, I missed the bracket with "note" of course :) Sorry. Great job! |
Use synchronization primitives instead of sleeping. This eliminates the need for the timeout parameter. The affected class is effectively internal, so this "should" not affect regular users.
Also fixed the tests: they didn't clean up after themselves.
Added benchmarks.
Fixes #152