Skip to content

perf: add fast path for local hdf5#1038

Draft
ianhi wants to merge 1 commit into
zarr-developers:mainfrom
ianhi:hdf-local-native-walk
Draft

perf: add fast path for local hdf5#1038
ianhi wants to merge 1 commit into
zarr-developers:mainfrom
ianhi:hdf-local-native-walk

Conversation

@ianhi

@ianhi ianhi commented Jul 13, 2026

Copy link
Copy Markdown

What I did

Added a fast path for parsing HDF files that are local. For these the Blockreader can cause massive perforamnce hits. Especially for a larger files (40 GB), you can actually end up reading more data than the file size! especially for b-trees where you end up revisting nodes.

draft for now - this is AI code I have not yet personally carefully reviewd.

attn @ilan-gold curious if this helps with the performance issues here: https://annbatch.readthedocs.io/en/stable/preshuffling.html

Acceptance criteria:

  • Closes #xxxx
  • Tests added
  • Tests passing
  • No test coverage regression
  • Full type hint coverage
  • Changes are documented in docs/about/releases.md
  • New functions/methods are listed in an appropriate *.md file under docs/api
  • New functionality has documentation

@ianhi
ianhi temporarily deployed to test-release July 13, 2026 16:52 — with GitHub Actions Inactive
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.87%. Comparing base (e1ebb4b) to head (a40b4a1).

Files with missing lines Patch % Lines
virtualizarr/parsers/hdf/hdf.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1038   +/-   ##
=======================================
  Coverage   89.87%   89.87%           
=======================================
  Files          36       36           
  Lines        2202     2212   +10     
=======================================
+ Hits         1979     1988    +9     
- Misses        223      224    +1     
Files with missing lines Coverage Δ
virtualizarr/parsers/hdf/hdf.py 96.42% <91.66%> (-0.64%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TomNicholas

Copy link
Copy Markdown
Member

@maxrjones does this seems sensible to you?

Comment thread docs/api/parsers/hdf5.md
Comment on lines +5 to +10
Local files are walked with HDF5's own index-aware driver, so building a
manifest reads only the chunk index. For **remote** chunk-dense files (many
small chunks — e.g. sparse single-cell `.h5ad`), the default block reader
can instead fetch a large fraction of the whole file just to recover that
index.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant here @ianhi but this is exactly what I was saying should be a target for doing in rust, especially over many files simultaneously

@ilan-gold

Copy link
Copy Markdown
Contributor

This fix seems reasonable!

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.

3 participants