-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX Speed up constrained layout #10658
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
FIX Speed up constrained layout #10658
Conversation
Still not quite linear in N, but a lot better than N*2 which it was before. |
This need not go out tomorrow (or whenever 2.2 goes out), but it would be nice to speed this up sooner rather than later. |
c7dde59
to
85215d9
Compare
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.
As essentially part of the original PR, this is a special case: it's new and independent functionality that is complicated enough to make it very hard to review in detail. But the tests pass, and it is making a big speedup, so I am inclined to trust it and get it in ASAP, so it can start getting a real-world workout.
colnummin = 0*np.zeros(len(axs), dtype=np.int8) | ||
colnummax = 0*np.zeros(len(axs), dtype=np.int8) | ||
width = 0*np.zeros(len(axs)) | ||
height = 0*np.zeros(len(axs)) |
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.
Why are you multiplying all these "zeros" arrays by zero?
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.
🐑 Because I was multiplying by the axs array first but that didn’t work and then forgot to remove. I’ll fix when I get home.
85215d9
to
4f69414
Compare
Backport PR #10658 on branch v2.2.x
PR Summary
As pointed out by @anntzer constrained layout gets slow for many subplots. Some slowdown is to be expected, but there were numerous redundant constraints being added, so this now has watchdogs to make sure only one constraint is added. Also some (probably insignificant) optimizations to reduce the number of calculations.
"closes" #10655
Still not quite linear in N, but a lot better than N*2 which it was before.
PR Checklist