Skip to content

consolidate_metadata does not scale well #3313

Description

@bluppfisk

Zarr version

2.18.7

Numcodecs version

0.15.1

Python Version

3.12

Operating System

Linux

Installation

pip

Description

consolidate_metadata() iterates over all keys in the store, only to access the ones that end in .zattrs, .zarray and .zgroup. For zarr stores that contain multiple millions of chunk files, this will start to become slow as the zarr grows, no matter how fast os.scandir is.

Perhaps it is my bad for storing additional metadata in the metadata files (although I am just following xarray's example of storing _ARRAY_DIMENSIONS etc), but it feels this could be made a lot faster by targeting the files directly (after all they are known to exist in each variable).

I'd be happy to submit a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions