Speed up Collection.set_paths#29398
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. |
_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