Skip to content

Commit 7cd02c1

Browse files
timtreisclaude
andcommitted
Add rendering performance example notebook
Port the `speed_up_illustration` notebook from spatialdata-notebooks into the gallery as examples/performance.ipynb, adapted to repo conventions: - Uses the cached `squidpy` visium_hne_sdata loader (its multiscale `hne` image drives the image sections) instead of a manually-downloaded zarr. - Sections: automatic rasterization (single-scale images), automatic scale selection (multi-scale images), and the datashader backend for shapes/points. - Slims the synthetic-data helper to build only the benchmarked element, and adds an untimed warmup so numba JIT / datashader setup isn't measured. - Keeps the shape crossovers (~250 polygons/circles, ~225 multi-polygons) and shows that points are comparable across backends (no clean crossover). Points benchmark starts at n=10: a single point has zero extent and crashes the datashader backend (scverse/spatialdata-plot#724). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7af5200 commit 7cd02c1

3 files changed

Lines changed: 947 additions & 0 deletions

File tree

_static/img/performance.png

22.9 KB
Loading

examples/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ Draw regions of interest directly on a `spatialdata-plot` canvas with
2323
`sdata.pl.annotate(...)` and persist them as a `ShapesModel` element.
2424
:::
2525

26+
:::{grid-item-card} Speeding up rendering
27+
:link: performance
28+
:link-type: doc
29+
:img-top: ../_static/img/performance.png
30+
31+
Keep rendering fast on large data: automatic rasterization and scale
32+
selection for images, and the `datashader` backend for many shapes.
33+
:::
34+
2635
::::
2736

2837
```{toctree}
@@ -31,4 +40,5 @@ Draw regions of interest directly on a `spatialdata-plot` canvas with
3140
3241
visium_mouse_brain
3342
interactive_annotate
43+
performance
3444
```

examples/performance.ipynb

Lines changed: 937 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)