Skip to content

Comments

Faster imports#373

Open
LucaMarconato wants to merge 13 commits intomainfrom
faster-imports
Open

Faster imports#373
LucaMarconato wants to merge 13 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 77.39130% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.81%. Comparing base (7eb2e61) to head (609e40b).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/spatialdata_io/__main__.py 24.13% 22 Missing ⚠️
src/spatialdata_io/readers/xenium.py 95.08% 3 Missing ⚠️
src/spatialdata_io/readers/_utils/_utils.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #373      +/-   ##
==========================================
- Coverage   62.70%   61.81%   -0.90%     
==========================================
  Files          27       27              
  Lines        3140     3153      +13     
==========================================
- Hits         1969     1949      -20     
- Misses       1171     1204      +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/_utils/_utils.py 48.42% <66.66%> (-0.52%) ⬇️
src/spatialdata_io/readers/xenium.py 72.60% <95.08%> (+1.09%) ⬆️
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.

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