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

constrainedlayout is very slow for large number of subplots #10655

Closed
anntzer opened this issue Mar 3, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@anntzer
Copy link
Contributor

commented Mar 3, 2018

Not sure anything can be done about this, but just leaving a note in case @jklymak (or someone else) in interested in working on the performance: with figure.constrained_layout.use set (mpl2.2.0rc1), on my machine,

  • subplots(4, 4) takes 4s,
  • subplots(5, 5) takes 28s,
  • subplots(6, 6) takes 48s.

@anntzer anntzer added this to the unassigned milestone Mar 3, 2018

@jklymak

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2018

Yeah, I get 4, 12 and 30 s for the same thing.

Cheap, fast, or good: choose two!

Seriously, the slow down is in _constrained_layout.do_constrained_layout. It does a NlogN loop on the axes (i.e. all possible pairs are compared), and I'm not sure how I can get away from that. Its not in the constraint solver, it is in my code, so I'll try and think how it could go faster.

@jklymak

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2018

Ok, down to 1.8, 3.3s, 6.3s. 7,7 = 19s. Thanks for pointing out this is so pokey...

@jklymak jklymak referenced this issue Mar 3, 2018

Merged

FIX Speed up constrained layout #10658

0 of 6 tasks complete
@jklymak

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2018

Closed by #10658

@jklymak jklymak closed this Mar 5, 2018

@QuLogic QuLogic modified the milestones: unassigned, v2.2.0 Mar 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.