Commit 6cc0950
committed
perf(render_points): scalar color for uniform-colour matplotlib scatter
When every marker resolves to the same colour (no color / single colour /
collapsed grey), _scatter_points handed ax.scatter a per-point colour array,
forcing matplotlib's per-point colour-mapping machinery — the dominant cost at
scale. Detect a uniform fixed-width-string colour vector (cheap vectorised
compare) and pass a scalar color= instead. Visually identical (sub-tolerance
edge antialiasing); numeric/continuous vectors keep the c=/cmap/norm path.
10M no-color matplotlib render: ~3.5s -> ~2.4s. Mirrors the datashader
single-colour collapse.1 parent 8f6a060 commit 6cc0950
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1051 | 1051 | | |
1052 | 1052 | | |
1053 | 1053 | | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
1054 | 1072 | | |
1055 | 1073 | | |
1056 | 1074 | | |
| |||
0 commit comments