Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/3717.misc.md
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 11 additions & 4 deletions tests/benchmarks/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)


Expand Down Expand Up @@ -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)
)


Expand Down