diff --git a/changes/3717.misc.md b/changes/3717.misc.md new file mode 100644 index 0000000000..5fed76b2b7 --- /dev/null +++ b/changes/3717.misc.md @@ -0,0 +1 @@ +Add benchmarks for Morton order computation with non-power-of-2 and near-miss shard shapes, covering both pure computation and end-to-end read/write performance. diff --git a/tests/benchmarks/test_indexing.py b/tests/benchmarks/test_indexing.py index d30d731f0f..385a85b5b5 100644 --- a/tests/benchmarks/test_indexing.py +++ b/tests/benchmarks/test_indexing.py @@ -106,7 +106,10 @@ def read_with_cache_clear() -> None: # Benchmark with larger chunks_per_shard to make Morton order impact more visible large_morton_shards = ( - (32,) * 3, # With 1x1x1 chunks: 32x32x32 = 32768 chunks per shard + (32,) * 3, # With 1x1x1 chunks: 32x32x32 = 32768 chunks per shard (power-of-2) + (30,) * 3, # With 1x1x1 chunks: 30x30x30 = 27000 chunks per shard (non-power-of-2) + (33,) + * 3, # With 1x1x1 chunks: 33x33x33 = 35937 chunks per shard (near-miss: just above power-of-2) ) @@ -197,9 +200,13 @@ def read_with_cache_clear() -> None: # Benchmark for morton_order_iter directly (no I/O) morton_iter_shapes = ( - (8, 8, 8), # 512 elements - (16, 16, 16), # 4096 elements - (32, 32, 32), # 32768 elements + (8, 8, 8), # 512 elements (power-of-2) + (10, 10, 10), # 1000 elements (non-power-of-2) + (16, 16, 16), # 4096 elements (power-of-2) + (20, 20, 20), # 8000 elements (non-power-of-2) + (32, 32, 32), # 32768 elements (power-of-2) + (30, 30, 30), # 27000 elements (non-power-of-2) + (33, 33, 33), # 35937 elements (near-miss: just above power-of-2, n_z=262144) )