-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Reduce notifications for a minor speedup #704
Conversation
In fact, false positive cases (the number of waiters is higher than it actually is) are possible, since the thread must enter the finally block to decrement. But access to the waiting queue requires access to the undocumented Condition attribute ( |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #704 +/- ##
==========================================
- Coverage 94.44% 94.42% -0.02%
==========================================
Files 5 5
Lines 1369 1472 +103
Branches 109 127 +18
==========================================
+ Hits 1293 1390 +97
- Misses 52 55 +3
- Partials 24 27 +3 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #704 will improve performances by 78.94%Comparing Summary
Benchmarks breakdown
|
Thanks, the speedup looks very impressive! |
@x42005e1f thank you for adding more tests! I'm out of my laptop right now, I'll review the PR again when I come back. |
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.
Looks good, thanks!
## What do these changes do? This PR fixes hang in `AsyncQueue.join()` by replacing `asyncio.Event` with `asyncio.Condition`. It also: 1. Makes the names of primitives the same style. 2. Reduces notifications in #704 style. 3. Ensures that counters are changed exclusively. ## Are there changes in behavior for the user? There are no behavior changes for users. ## Related issue number Fixes #715
Avoids calling slow notification methods when there are no waiters.