Skip to content

Comments

Faster imports#373

Merged
LucaMarconato merged 9 commits intomainfrom
faster-imports
Feb 24, 2026
Merged

Faster imports#373
LucaMarconato merged 9 commits intomainfrom
faster-imports

Conversation

@LucaMarconato
Copy link
Member

@LucaMarconato LucaMarconato commented Feb 17, 2026

Replaces #372
To be merged after #370

Significantly faster import time: 25%-30% faster for specific readers and now lazy-loading when doing import spatialdata-io.

Results from asv (benchmark script also included):

| Change   | Before [7eb2e61a] <main>   | After [e7de0877] <faster-imports>   |   Ratio | Benchmark (Parameter)                                                      |
|----------|----------------------------|-------------------------------------|---------|----------------------------------------------------------------------------|
| -        | 2.34±0.06s                 | 1.70±0.03s                          |    0.73 | benchmark_imports.ImportBenchmark.time_from_spatialdata_io_import_visium   |
| -        | 2.39±0.07s                 | 1.64±0s                             |    0.69 | benchmark_imports.ImportBenchmark.time_from_spatialdata_io_import_xenium   |
| -        | 2.49±0.04s                 | 1.69±0.04s                          |    0.68 | benchmark_imports.ImportBenchmark.time_from_spatialdata_io_import_cosmx    |
| -        | 2.38±0.03s                 | 1.58±0.04s                          |    0.66 | benchmark_imports.ImportBenchmark.time_from_spatialdata_io_import_merscope |
| -        | 2.49±0.05s                 | 56.8±2ms                            |    0.02 | benchmark_imports.ImportBenchmark.time_import_spatialdata_io               |
image

Result from profimp below (maybe we could improve still a bit in a follow up PR):
image

@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 58.92857% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.80%. Comparing base (6cc3afc) to head (0dd816a).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata_io/__main__.py 24.13% 22 Missing ⚠️
src/spatialdata_io/readers/_utils/_utils.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #373      +/-   ##
==========================================
- Coverage   62.86%   61.80%   -1.06%     
==========================================
  Files          27       27              
  Lines        3156     3155       -1     
==========================================
- Hits         1984     1950      -34     
- Misses       1172     1205      +33     
Files with missing lines Coverage Δ
src/spatialdata_io/__init__.py 100.00% <100.00%> (ø)
src/spatialdata_io/readers/_utils/_image.py 100.00% <100.00%> (ø)
src/spatialdata_io/readers/generic.py 88.73% <100.00%> (-0.46%) ⬇️
src/spatialdata_io/readers/xenium.py 72.47% <100.00%> (ø)
src/spatialdata_io/readers/_utils/_utils.py 48.42% <66.66%> (-0.52%) ⬇️
src/spatialdata_io/__main__.py 81.42% <24.13%> (-5.81%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaMarconato LucaMarconato merged commit 9011cfd into main Feb 24, 2026
4 of 5 checks passed
@LucaMarconato LucaMarconato deleted the faster-imports branch February 24, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants