import pandas as pd
import hvplot.pandas
import holoviews as hv
= 'holoviews'
pd.options.plotting.backend import warnings
'ignore') warnings.filterwarnings(
Benchmarks 2: Tile Generation Benchmarks across Data Formats
Explanation
This page shared results from benchmarking the performance of tiling CMIP6 data stored as COG, NetCDF and Zarr.
The intention is to understand the performance tradeoff between these data formats. These results should not be considered conclusive as additional library and caching improvements may be made in the future.
In order to tile the NetCDF, we use a kerchunk reference file. You are able to use the ZarrReader with NetCDF files without a kerchunk reference file, however you cannot read more than file at once which makes it incomparable with the pgSTAC+COG and Zarr methods.
Dataset Generation
The test datasets produced and benchmarked are:
- Cloud-Optimized GeoTiffs (COGs): Tiles are produced using the publicly available CMIP6 COGs in the s3://nex-gddp-cmip6-cog/ bucket. The metadata generation is documented in 01-cmip6-cog-tile-server-benchmarks.ipynb.
- kerchunk + netCDF: Tiles are produced using a kerchunk reference file generated for the NetCDF files stored in the s3://nex-gddp-cmip6 bucket. The code to produce the kerchunk reference is in the tile-benchmarking repo: 01-generate-datasets/generate-cmip6-kerchunk.ipynb.
- Zarr: Tiles are produced using a zarr store with the same chunking configuration and the underlying NetCDFs. The code to produce the zarr store is in the tile-benchmarking repo: 01-generate-datasets/generate-cmip6-zarr.ipynb.
Tests
Tests were run via the tile-benchmarking/02-run-tests/02-cog-kerchunk-zarr.ipynb notebook.
= "https://raw.githubusercontent.com/developmentseed/tile-benchmarking/main/02-run-tests/results-csvs/"
git_url_path = pd.read_csv(f"{git_url_path}/02-cog-kerchunk-zarr-results.csv") df
= range(6)
zooms = ["#E1BE6A", "#40B0A6", "#0C7BDC"]
cmap = {"width": 300, "height": 250}
plt_opts
= []
plts
for zoom_level in zooms:
= df[df["zoom"] == zoom_level]
df_level
plts.append(
df_level.hvplot.box(="time",
y=["data_format"],
by="data_format",
c=cmap,
cmap="Time to render (ms)",
ylabel="Data Format",
xlabel=False,
legend=f"Zoom level {zoom_level}",
title**plt_opts)
).opts(
)
2) hv.Layout(plts).cols(
Interpretation of the Results
- Tiling COGs performs better than tiling Zarr or the kerchunk reference, at all zoom levels.
- The performance of the kerchunk reference is better than the Zarr store. It is important to consider this is because the NetCDF files’ chunks are the same. Even though 365 time steps (days) are stored in each NetCDF file, it is chunked by day.