Commit 7d6c12a
committed
Make slowness warning for legend(loc="best") more accurate.
... by actually timing the call duration. Locally I can best-locate
legends even with plots with hundreds of thousands of points basically
instantly, so the old warning was spurious.
The new test is obviously a bit brittle because it depends on how fast
the machine running it is. It's also slower than the test before
(intentionally, because now you *actually* need a slow-to-place legend
to trigger the warning).
The warning is only emitted after the legend has been placed, but that
seems fine -- if the best-placement is so slow that you ctrl-c the
process, you'll have a traceback anyways. Also, spawning a separate
thread to always emit the warning after exactly 5s will likely just make
things worse performance-wise on average.1 parent 43e7d3b commit 7d6c12a
2 files changed
Lines changed: 22 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
1112 | 1113 | | |
1113 | 1114 | | |
1114 | 1115 | | |
| 1116 | + | |
| 1117 | + | |
1115 | 1118 | | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | 1119 | | |
1123 | 1120 | | |
1124 | 1121 | | |
| |||
1145 | 1142 | | |
1146 | 1143 | | |
1147 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1148 | 1151 | | |
1149 | 1152 | | |
1150 | 1153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
554 | 558 | | |
555 | | - | |
556 | | - | |
557 | | - | |
| 559 | + | |
558 | 560 | | |
559 | 561 | | |
560 | 562 | | |
561 | 563 | | |
562 | 564 | | |
563 | | - | |
564 | | - | |
| 565 | + | |
| 566 | + | |
565 | 567 | | |
566 | 568 | | |
567 | 569 | | |
568 | 570 | | |
569 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
570 | 575 | | |
571 | | - | |
572 | | - | |
| 576 | + | |
573 | 577 | | |
0 commit comments