Skip to main content
QUICK REVIEW

[论文解读] A Comparison of HDF5, Zarr, and netCDF4 in Performing Common I/O Operations

Sriniket Ambatipudi, Suren Byna|arXiv (Cornell University)|Jul 19, 2022
Advanced Data Storage Technologies被引用 4
一句话总结

本研究针对常见 I/O 操作(创建、打开、写入、读取和关闭)对 HDF5、netCDF4 和 Zarr 进行基准测试,使用 Python 中的合成数据集。结果表明,HDF5 在读写操作中速度最快,netCDF4 在创建/打开时间上表现最佳,Zarr 在大多数操作中略逊于 HDF5,其性能受 API 开销和小数据场景下缓存影响显著。

ABSTRACT

Scientific data is often stored in files because of the simplicity they provide in managing, transferring, and sharing data. These files are typically structured in a specific arrangement and contain metadata to understand the structure the data is stored in. There are numerous file formats in use in various scientific domains that provide abstractions for storing and retrieving data. With the abundance of file formats aiming to store large amounts of scientific data quickly and easily, a question that arises is, "Which scientific file format is best suited for a general use case?" In this study, we compiled a set of benchmarks for common file operations, i.e., create, open, read, write, and close, and used the results of these benchmarks to compare three popular formats: HDF5, netCDF4, and Zarr.

研究动机与目标

  • 客观比较三种通用科学文件格式(HDF5、netCDF4 和 Zarr)在常见操作中的 I/O 性能。
  • 识别在涉及数据集创建、写入、打开和读取的典型科学数据工作流中,哪种格式提供最佳性能。
  • 评估在代表多数科学应用的小到中等规模数据集中,文件格式选择对性能的影响。
  • 为研究人员提供一个可复现的基准框架,以便在受控条件下比较不同文件格式。
  • 探讨 Python API 开销和缓存对观测到的性能差异的影响。

提出的方法

  • 在 Python 中实现了一个标准化的基准测试套件,用于测量在合成数据集上执行创建、打开、写入、读取和关闭操作的时间。
  • 使用 Python 原生命名接口(h5py 用于 HDF5,netCDF4-python 用于 netCDF4,zarr-python 用于 Zarr)生成随机数据并存储到文件中。
  • 通过改变数据集数量(1,024 至 8,192)和数组维度(1D 至 3D)来评估可扩展性和负载影响。
  • 每项操作均多次运行并取平均值,以减少系统级波动带来的噪声。
  • 通过柱状图可视化结果,比较不同格式在各项操作中的相对性能。
  • 该基准测试为开源项目,托管于 GitHub,可供社区使用、扩展和贡献。

实验结果

研究问题

  • RQ1在创建新数据集时,HDF5、netCDF4 和 Zarr 中哪种文件格式性能最快?
  • RQ2在向数据集写入数据时,三种格式的写入性能如何比较?
  • RQ3在打开一个已关闭的数据集时,各格式的相对性能如何?
  • RQ4在从数据集读取值时,哪种格式的读取性能最快?
  • RQ5增加数据集数量如何影响每种文件格式的性能?

主要发现

  • HDF5 展现出最快的写入性能,其数据写入耗时显著短于 netCDF4 和 Zarr。
  • netCDF4 在创建新数据集方面最快,其次是 HDF5,Zarr 最慢。
  • 在打开数据集方面,netCDF4 平均耗时最低,其次是 Zarr,HDF5 最慢。
  • 在将数据集值读取到标准输出时,HDF5 速度最快,Zarr 紧随其后,而 netCDF4 明显更慢。
  • 将数据集数量从 1,024 增加到 8,192 对各项操作的平均耗时影响极小,表明在此工作负载下可扩展性并非主要瓶颈。
  • 性能差异可能受 Python API 开销和缓存效应影响,这些影响在数据量达到千兆字节级别时可能减弱。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。