Skip to content
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

Refactored Synchroniser to use simpler self._futures construct #49

Merged

Conversation

TarasLevelUp
Copy link

Will ease work on #34, as it remembers the exception, the synchroniser was killed with to raise them later.

# (spec.BasicGetOK, spec.BasicGetEmpty)
for other_method in bound_methods:
if other_method != method:
self._futures[other_method].remove((fut, bound_methods))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is potentially expensive. deque.remove has to search through the deque for the item it's looking for, and removing it means copying a potentially large number of other items into place. In other words remove is O(n), whereas the OrderedDict version was amortised O(1).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think I know how to fix this right away.

@tvoinarovskyi
Copy link
Contributor

Fixed

@benjamin-hodgson
Copy link
Owner

GH won't let me merge it because there are conflicts. Please could you resolve them?

@TarasLevelUp
Copy link
Author

done

@TarasLevelUp
Copy link
Author

bump, if no more problems, merge this one pls.

benjamin-hodgson pushed a commit that referenced this pull request Oct 16, 2015
Refactored Synchroniser to use simpler self._futures construct
@benjamin-hodgson benjamin-hodgson merged commit 1e99adf into benjamin-hodgson:master Oct 16, 2015
@tvoinarovskyi tvoinarovskyi deleted the refactor_syncronizer branch October 17, 2015 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants