-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Speed up Collection.set_paths #29398
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
Conversation
3831f2e
to
1b256c2
Compare
How much of the speed up is coming from slots? I would have anticipated that attribute lookups on paths are negligible compared to other operations, and thus the speed up is small. In that case, I would not go for slots as the impose certain restrictions that could become obstacles. |
Not too much is attributable to |
To not have a third round, the test that is dropped is not testing anything because |
I would not expect to see |
7726a34
to
ac0614a
Compare
Rebased to main, this is good to go. |
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.
Minor suggestions
_to_unmasked_float_array updates Linting and tweaks mean zsort small perf gain linting Fix tests Linting and tweaks mean zsort small perf gain linting Fix tests Update lib/matplotlib/collections.py Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com> remove Path __slots__ Code review suggestions
7c85954
to
c6b9214
Compare
PR summary
This builds on #16793 to implement
__slots__
on Path objects, and to improve a lighter weight creation path. Relative to that MR, it does not modify the garbage collection on Paths, and adds a smattering of minor 3D rendering improvements. For a 200x200 plot_surface test case, I am seeing a 1.3x speedup after averaging over a few profiler runs, though note that this gives better performance over a much wider scope as well.Relevant issue which this won't fully close: #16659
PR checklist