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

Assume ordered mapping to avoid unnecessary sorting (breaks backwards compat.) #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

InnovativeInventor
Copy link
Member

GerryChain's retworkx branch is now fast enough to warrant profiling/optimizing pcompress (the Python part of it, that is).

With this change, https://github.com/mggg/GerryChain/pull/381/files#diff-da8db0188ac13cf96790b0e942fbcf3fab038487158df62d9910e450c506adbdL32-R37, we can remove the sort operation in pcompress and rely on GerryChain to maintain this as an invariant. This PR WILL break backwards compatibility, so great care must be taken to ensure that newer versions of pcompress are not mixed with older versions of GerryChain.

@InnovativeInventor
Copy link
Member Author

This results in a nice speedup (80 it/s -> 120 it/s on my computer, for PA congressional recom runs).

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.

1 participant