scverse / scverse/napari-spatialdata

Speeding up napari-spatialdata

Open
#42 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
90
Forks
25
Avg merge
22m
Merged PRs (30d)
1

Description

Hey everyone! I just wanted to make an issue to discuss ways we can try to improve the performance of napari-spatial data
for large data. I've listed a few ideas/suggestions off the top of my head below to get things started.

  • [easy] Profiling loading of data. I think we need to do some profilng to figure out exactly where the bottlenecks are
  • [easy] The initial drawing of Shapes is slow because they need to be meshed (i.e., turned into triangles). Last year there was a fix that improved triangulation performance that requires the triangle library (see https://github.com/napari/napari/pull/3867 - ~100x speedup for large numbers of shapes). We can include triangle as a dependency and it should "just work".
  • [medium] I am guessing generating the colormaps for the points and shapes is somewhat slow because we have to loop over the values (e.g., cluster, expression) to set the color. We could try numba to speed that up.
  • [medium] switch back to using points for the circles Shapes: https://github.com/scverse/napari-spatialdata/issues/37 (We should reach out to Lorenzo Gaifas - he was working on points sizing recently)
  • [hard] async is coming along in napari. We can start transitioning to async and tiled rendering(e.g., for large 2D images), which should speed somethings up. Joel Lüthi is probably the best person to talk to about this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or concrete entry points are named. Start by profiling data loading and initial rendering for large datasets, then compare the proposed triangulation, colormap, points, and async-rendering directions. Done would require a selected approach with measured performance improvements and supporting tests or benchmarks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.