From c15bd6051c656d5c0ad3e9bd3150928f1d900017 Mon Sep 17 00:00:00 2001 From: Alden Keefe Sampson Date: Mon, 19 Jan 2026 22:54:17 -0500 Subject: [PATCH] Add benchmarks for sharded + local store indexing Parameterize with shards and no shards. Parameterize with local + memory store to have an example of a store which has some modest latency. --- tests/benchmarks/test_indexing.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/benchmarks/test_indexing.py b/tests/benchmarks/test_indexing.py index 1ad4f4b575..120eca9517 100644 --- a/tests/benchmarks/test_indexing.py +++ b/tests/benchmarks/test_indexing.py @@ -22,18 +22,27 @@ (slice(None), slice(0, 3, 2), slice(0, 10)), ) +shards = ( + None, + (50,) * 3, +) + -@pytest.mark.parametrize("store", ["memory"], indirect=["store"]) +@pytest.mark.parametrize("store", ["memory", "local"], indirect=["store"]) @pytest.mark.parametrize("indexer", indexers, ids=str) +@pytest.mark.parametrize("shards", shards, ids=str) def test_slice_indexing( - store: Store, indexer: tuple[int | slice], benchmark: BenchmarkFixture + store: Store, + indexer: tuple[int | slice], + shards: tuple[int, ...] | None, + benchmark: BenchmarkFixture, ) -> None: data = create_array( store=store, shape=(105,) * 3, dtype="uint8", chunks=(10,) * 3, - shards=None, + shards=shards, compressors=None, filters=None, fill_value=0,