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

Speed up printing of large permutations #3740

Merged
merged 3 commits into from
Nov 14, 2019

Conversation

ChrisJefferson
Copy link
Contributor

GAP is very slow at printing large permutations (say on the order of 2^20), it can take several minutes. This is because it uses a silly O(n^2) algorithm.

This improves the two places where we print permutations to instead use an O(n) algorithm.

@ChrisJefferson ChrisJefferson added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes topic: performance bugs or enhancements related to performance (improvements or regressions) labels Nov 12, 2019
src/permutat.cc Show resolved Hide resolved
@fingolfin
Copy link
Member

Oops, needs to be rebased now

Remove old O(n^2) algorithm with O(n) algorithm
Replace old O(n^2) algorithm with O(n) one, because unlike the
comment, we are no longer limited to 9600 baud and can produce some
large permutations
@ChrisJefferson
Copy link
Contributor Author

Hopefully all issues fixed (once the tests cycle)

@coveralls
Copy link

Coverage Status

Coverage remained the same at 84.513% when pulling b12bffe on ChrisJefferson:fast-perm-print into 79118b8 on gap-system:master.

@fingolfin fingolfin merged commit 012238d into gap-system:master Nov 14, 2019
@ChrisJefferson ChrisJefferson deleted the fast-perm-print branch December 2, 2019 14:30
@PaulaHaehndel PaulaHaehndel added release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: added PRs introducing changes that have since been mentioned in the release notes topic: performance bugs or enhancements related to performance (improvements or regressions)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants