Fix Agg clipping#5023
Conversation
Addresses the slowness mentioned in matplotlib#5016
|
I also wonder whether this addresses some of the other "extreme" slowness issues we've seen reported elsewhere. |
|
This didn't fix it completely for me either But made way better so merged. [edited as my first benchmark attempt included re-building the font cache] |
|
I think that is the best one can expect; the patch fixed the regression completely. The user time is longer for the reversed case because it is not getting the benefit of subslicing. The sys time variation is random. |
Addresses the slowness mentioned in #5016.
In the epic C++ refactor in ba40160, the line that determines whether to perform clipping of paths to the figure size in the Agg backend changed from:
to
Spot the problem? It means we were only clipping when there was a hatch, rather than when there wasn't a hatch -- effectively disabling it for most things.
This should have a major impact on panning and zooming performance of large time series.
I'm not exactly sure how to write a test for this -- the result, by its nature, isn't visible, and this is pretty deep into the C++ code to make a "unit test" out of it. I'll think on that some more, but in the meantime I thought it better to just address this very serious regression.