Reading continuation chunks from a queue (7e5e920,a69c5be) allocated a queue Vec and a BTreeSet of chunk starts for every header, and inlined the per-chunk message loop into the generic parser: ObjectHeader::parse over 401 version-1 headers went from 24.8 to 45.7 us. ChunkSpans now keeps the first 8 chunks in an inline array (cycle check by scan) and is also the read queue; only a header of more chunks allocates (a boxed spill list and start set). The message loop of one version-1 chunk is its own non-generic function. Same checks as before: any number of chunks up to 65,536, cycles refused, chunks bounded by the file size, one chunk buffer alive at a time, libhdf5 message order, overlap allowed. The cycle test now also covers spilled chunk lists. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
clawhdf5-format
Pure-Rust HDF5 binary format parsing and writing — no C dependencies.
Features
- Zero-copy superblock, object header, and B-tree parsing
- Chunked dataset read/write with filter pipelines
no_stdsupport (disablestdfeature)- Optional parallel reads via Rayon
- SHA-256 provenance tracking
Usage
use clawhdf5_format::Superblock;
let data = std::fs::read("data.h5").unwrap();
let sb = Superblock::from_bytes(&data).unwrap();
println!("HDF5 version {}.{}", sb.version_major(), sb.version_minor());
License
MIT