docs+fix: add h5bench benchmark results and repair libhdf5-compare feature

Add h5bench-equivalent Criterion benchmark results to BENCHMARKS.md
(sequential read/write, chunked read/write, metadata throughput).

Fix libhdf5-compare feature for HDF5 1.14.x:
- Switch to hdf5-metno 0.12 (aliased as 'hdf5') in clawhdf5-bench
- Fix h5bench_meta.rs: AttributeBuilderEmpty::create takes &str not &String;
  shape=[1] dataset uses write(&[val]) not write_scalar
- Fix h5bench_read.rs: libhdf5-compare variant now writes its own reference
  file via hdf5-metno instead of dumping clawhdf5 bytes (avoids float
  datatype message incompatibility)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
Omar Sobh
2026-06-30 16:39:52 +00:00
co-authored by Claude Sonnet 4.6
parent cb0b0e9df2
commit bf197b70e3
4 changed files with 66 additions and 5 deletions
+11 -2
View File
@@ -68,10 +68,19 @@ fn bench_read_sequential(c: &mut Criterion) {
});
#[cfg(feature = "libhdf5-compare")]
group.bench_with_input(BenchmarkId::new("libhdf5", n), &bytes, |b, raw| {
group.bench_with_input(BenchmarkId::new("libhdf5", n), &n, |b, &nn| {
let tmp = TempDir::new().unwrap();
let path = tmp.path().join("seq_libhdf5.h5");
std::fs::write(&path, raw).unwrap();
let data: Vec<f32> = (0..nn).map(|i| i as f32 * 0.001).collect();
{
let lf = hdf5::File::create(&path).unwrap();
let lds = lf
.new_dataset::<f32>()
.shape([nn])
.create("data")
.unwrap();
lds.write(data.as_slice()).unwrap();
}
b.iter(|| {
let file = hdf5::File::open(&path).unwrap();
let ds = file.dataset("data").unwrap();