Skip to content

Commit 8ead60c

Browse files
committed
Clean up write up
1 parent 70f1fe3 commit 8ead60c

1 file changed

Lines changed: 45 additions & 45 deletions

File tree

‎docs/index.md‎

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@ layout: default
44

55
# Zarr benchmarks
66

7-
## Introduction
7+
This page provides advice on how to set [Zarr](https://zarr.dev/) array
8+
configuration options. These options all have an impact on data compression,
9+
read times, and write times. The advice here is based on a series of benchmarks,
10+
which are presented below.
811

9-
This page contains benchmarks for the best options to use when creating Zarr
10-
arrays.
11-
12-
[Zarr](https://zarr.dev/) is a specification for storing array data. When
13-
creating a Zarr dataset there are several configuration options you can set,
14-
which all have an impact on data compression, read times, and write times. This
15-
project provides guidance on how array creation options affect data size and
16-
read/write performance.
17-
18-
These benchmarks are part of the
12+
These benchmarks are part of the wider
1913
[HEFTIE project](https://github.com/HEFTIEProject).
2014

2115
## Executive summary
@@ -24,57 +18,63 @@ These benchmarks are part of the
2418
than [_zarr-python_ version 3](https://zarr.readthedocs.io/en/stable/) is
2519
faster than [_zarr-python_ version 2](https://zarr.readthedocs.io/en/v2.18.5/)
2620
(for both reading and writing data).
27-
- **Compressor**: _blosc-zstd_ provides the best compression ratio for image and
28-
sparse segmentation data, whereas _zstd_ provides the best compression ratio
29-
for dense segmentation data.
30-
- **Compression level**: Setting compression levels beyond ~3 results in
31-
slightly better data compression but much longer write times. Compression
32-
level does not affect read time.
33-
- **Other compressor options**: Setting the _shuffle_ option has no adverse
34-
effect on read/write times, and for some types of data increases compression;
35-
for image data setting it to "shuffle" helps, and for sparse labels
36-
"bitshuffle" helps. For dense labels not setting shuffle gives the largest
37-
compression ratios.
21+
- **Compressor**:
22+
- `blosc-zstd` provides the best compression ratio for image and sparse
23+
segmentation data
24+
- `zstd` provides the best compression ratio for dense segmentation data.
25+
- **Compression level**: Values greater than ~3 result in slightly better data
26+
compression but much longer write times. Compression level does not affect
27+
read time.
28+
- **Other compressor options**: Setting the `shuffle` option has no adverse
29+
effect on read/write times, and for different data types different values
30+
increase compression ratio:
31+
- image data, setting it to `"shuffle"`
32+
- sparse labels, setting it to `"bitshuffle"`
33+
- dense labels not setting `shuffle` at all
3834

3935
## Configuration
4036

41-
Data used for benchmarking is available on
42-
[Zenodo](https://doi.org/10.5281/zenodo.15544055).
37+
The data used for benchmarking is available on Zenodo at
38+
[10.5281/zenodo.15544055](https://doi.org/10.5281/zenodo.15544055).
4339

4440
### Datasets
4541

46-
All datasets have shape: 806 x 629 x 629, with a data type of _uint16_.
42+
All datasets have shape: 806 x 629 x 629, with a 16-bit unsigned integer data
43+
type. Three different datasets were used:
4744

48-
- **Image data**: A HiP-CT scan of a human heart.
49-
- **Dense label data**: Segmented neurons from an electron microscopy volume of
50-
part of the human cerebral cortex.
51-
- **Sparse label data**: Selected proofread segmented neurons, from the same
52-
dataset as the dense label data.
45+
- **Image data**:
46+
[A Hierarchical Phase-Contrast Tomography (HiP-CT) scan of a human heart.](https://doi.org/10.15151/ESRF-DC-1773966241)
47+
- **Dense label data**: Segmented neurons from an
48+
[electron microscopy volume of part of the human cerebral cortex](https://h01-release.storage.googleapis.com/data.html).
49+
- **Sparse label data**: Selected proofread segmented neurons, from the
50+
[same dataset as the dense label data](https://h01-release.storage.googleapis.com/data.html).
5351

5452
### Default configuration
5553

56-
Unless stated as being varied, the default configuration used was:
54+
Unless stated as being varied below, the default Zarr array configuration used
55+
was:
5756

5857
- **Dataset** = heart image data
59-
- **Chunk size** = 128 x 128 x 128
60-
- **Compressor** = blosc-zstd
61-
- **Shuffle** = "shuffle"
62-
- **Compression level** = 3
63-
- **Zarr spec version** = 2
58+
- **Chunk shape** = `(128, 128, 128)`
59+
- **Compressor** = `"blosc-zstd"`
60+
- **Shuffle** = `"shuffle"`
61+
- **Compression level** = `3`
62+
- **Zarr specification version** = 2
6463

6564
All benchmarks were run 5 times, and the mean values from these runs are shown
6665
in the graphs below.
6766

6867
### Hardware
6968

7069
Reading and writing arrays was done to and from local SSD storage, to mimic real
71-
world usage when reading/writing to/from a disk. This means times given are the
72-
full time needed to read/write to/from disk.
70+
world usage when reading/writing to a disk. Times given are the full time needed
71+
to read/write to/from disk.
7372

74-
The data used to create this report is available in the repository under
75-
`/example_results`. To create the plots in this report locally (along with
76-
further plots we couldn't include in the report), see the README in that
77-
repository.
73+
Benchmarking result data used to create this report is available in the
74+
[HEFTIEProject/zarr-benchmarks](https://github.com/HEFTIEProject/zarr-benchmarks)
75+
repository in the `/example_results` directory. To reproduce the plots in this
76+
report locally (along with further plots we couldn't include in the report), see
77+
the README in that repository.
7878

7979
## Compressors
8080

@@ -89,9 +89,9 @@ The following graph shows write time for the Zarr-python 2 library, with write
8989
time on the x-axis and compression ratio on the y-axis. Each compressor is
9090
represented with a different colour/symbol, and larger markers represent higher
9191
compression levels. The compression ratio is the ratio of the data size when
92-
loaded into memory (e.g., for an array with data type `uint8` and 16 elements,
93-
the data size is 16 bytes), and the data size when compressed and stored. Higher
94-
compression ratios mean lower stored data sizes.
92+
loaded into memory (e.g., for an array with 16 bit unsigned integer data type
93+
and 16 elements, the data size is 32 bytes), and the data size when compressed
94+
and stored. Higher compression ratios mean lower stored data sizes.
9595

9696
![Write time vs compression ratio for different compressors and compression levels with the quickest compressors taking 1 to 2 seconds with compression ratios of ~1.5. Increasing the compression level does not increase the compression ratio by much while taking much longer](assets/write_single.png)
9797

0 commit comments

Comments
 (0)