| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -1336,9 +1336,8 @@ def read_events(self): | |
| Events are consumed from the internal event queue as they are | ||
| retrieved from the iterator. | ||
| """ | ||
| events = self._events_queue | ||
| while events: | ||
| event = events.popleft() | ||
| for event in iter(self._events_queue.popleft, | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis is also slower because it raises an exception on every call and the old loop never raised.
Sorry, something went wrong.
All reactions
|
||
| stop_exception=IndexError): | ||
| if isinstance(event, Exception): | ||
| raise event | ||
| else: | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
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.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityNot worth putting here. Most WeakSet.pop() calls return at the first live ref, which is almost always the first call. The old code raised and allocated nothing on that path. The new code sets up the iter(), binds the method, checks for the exception type, etc. etc.
I measured and that's 40% slower.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.