Commit 8f6a060
committed
perf(datashader): collapse single-colour categorical to a count render
When every point resolves to the same colour — notably past scanpy's 102-colour
palette, where all categories become uniform grey — datashader's per-category
ds.by aggregate + composite is pure waste: the output is byte-identical to a
plain single-colour count render. Detect the uniform colour vector and route to
the cheap count path. 2M points x 3085 genes: 6.0s -> 0.86s (~7x), byte-identical
output, no spurious colorbar; low-cardinality categoricals are unaffected.1 parent 95e31c6 commit 8f6a060
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
339 | 348 | | |
340 | 349 | | |
341 | 350 | | |
| |||
365 | 374 | | |
366 | 375 | | |
367 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
368 | 385 | | |
369 | 386 | | |
370 | 387 | | |
| |||
0 commit comments