Commit e039008
committed
perf(shapes): adaptive circle-buffer resolution for the datashader path
Circles (Point+radius) were buffered to polygons at shapely's default resolution=16
(65 vertices/circle) before datashader rasterization. For large circle sets this
coordinate explosion dominates the render (buffer + per-vertex transform + polygon
aggregation), e.g. ~5.9M coords for 91k circles.
Choose the buffer resolution from the largest disc's on-screen pixel radius
(_circle_buffer_quad_segs / _circle_quad_segs): 4 segments/quadrant for small discs
(<=8px, where extra vertices are sub-pixel), 8 (<=32px), and shapely's full 16 once
discs are large enough to show facets. Faithful (IoU >=0.98 vs the 65-vertex circle)
and handles per-circle varying radii.
End-to-end on Visium HD (single coordinate system): 91k circles 2.0s->1.5s,
352k circles 8.3s->4.9s.
Note: shifts the datashader-circle visual baselines (17- vs 65-vertex circles);
regenerate those from CI artifacts.1 parent 480d9f0 commit e039008
3 files changed
Lines changed: 74 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
724 | 766 | | |
725 | 767 | | |
726 | 768 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
770 | 771 | | |
771 | 772 | | |
772 | 773 | | |
| 774 | + | |
773 | 775 | | |
774 | 776 | | |
775 | 777 | | |
776 | | - | |
777 | 778 | | |
778 | | - | |
779 | | - | |
780 | | - | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
781 | 787 | | |
782 | 788 | | |
783 | 789 | | |
| |||
789 | 795 | | |
790 | 796 | | |
791 | 797 | | |
792 | | - | |
793 | 798 | | |
794 | 799 | | |
795 | 800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1839 | 1839 | | |
1840 | 1840 | | |
1841 | 1841 | | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
0 commit comments