Skip to content

[do not merge] benchmarks + tests for phased codecpipeline#3891

Open
d-v-b wants to merge 20 commits intozarr-developers:mainfrom
d-v-b:perf/prepared-write-v2-bench
Open

[do not merge] benchmarks + tests for phased codecpipeline#3891
d-v-b wants to merge 20 commits intozarr-developers:mainfrom
d-v-b:perf/prepared-write-v2-bench

Conversation

@d-v-b
Copy link
Copy Markdown
Contributor

@d-v-b d-v-b commented Apr 9, 2026

This PR should not be merged. It contains changes necessary to make the codec pipeline developed in #3885 the default, which allows us to run our full test suite + benchmarks against that codec pipeline class.

d-v-b added 9 commits April 7, 2026 10:38
`PreparedWrite` models a set of per-chunk changes that would be applied to a stored chunk. `SupportsChunkPacking`
is a protocol for array -> bytes codecs that can use `PreparedWrite` objects to update an existing chunk.
@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Apr 9, 2026
@d-v-b d-v-b added the benchmark Code will be benchmarked in a CI job. label Apr 9, 2026
@d-v-b d-v-b force-pushed the perf/prepared-write-v2-bench branch from 8db7399 to e82da5b Compare April 9, 2026 14:16
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 86.62207% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.09%. Comparing base (9391f43) to head (f3a4bbb).

Files with missing lines Patch % Lines
src/zarr/core/codec_pipeline.py 86.18% 63 Missing ⚠️
src/zarr/codecs/numcodecs/_codecs.py 66.66% 8 Missing ⚠️
src/zarr/codecs/sharding.py 92.30% 7 Missing ⚠️
src/zarr/codecs/_v2.py 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3891      +/-   ##
==========================================
- Coverage   93.06%   92.09%   -0.98%     
==========================================
  Files          85       87       +2     
  Lines       11236    11809     +573     
==========================================
+ Hits        10457    10875     +418     
- Misses        779      934     +155     
Files with missing lines Coverage Δ
src/zarr/abc/codec.py 98.86% <100.00%> (+0.09%) ⬆️
src/zarr/core/array.py 97.65% <100.00%> (+0.01%) ⬆️
src/zarr/core/config.py 100.00% <ø> (ø)
src/zarr/codecs/_v2.py 90.19% <80.00%> (-3.43%) ⬇️
src/zarr/codecs/sharding.py 75.42% <92.30%> (-13.99%) ⬇️
src/zarr/codecs/numcodecs/_codecs.py 93.18% <66.66%> (-3.21%) ⬇️
src/zarr/core/codec_pipeline.py 87.62% <86.18%> (-6.57%) ⬇️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@d-v-b d-v-b added benchmark Code will be benchmarked in a CI job. and removed benchmark Code will be benchmarked in a CI job. labels Apr 13, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 13, 2026

Merging this PR will degrade performance by 99.6%

⚡ 32 improved benchmarks
❌ 29 regressed benchmarks
✅ 5 untouched benchmarks
⏩ 6 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_write_array[memory-Layout(shape=(1000000,), chunks=(1000,), shards=(1000,))-None] 1,607.9 ms 859.8 ms +87.01%
WallTime test_write_array[local-Layout(shape=(1000000,), chunks=(1000,), shards=None)-None] 1.2 s 1 s +16.45%
WallTime test_slice_indexing[None-(slice(None, 10, None), slice(None, 10, None), slice(None, 10, None))-memory_get_latency] 2 ms 1.8 ms +10.82%
WallTime test_write_array[memory-Layout(shape=(1000000,), chunks=(100,), shards=(1000000,))-None] 5.3 s 1.5 s ×3.5
WallTime test_write_array[memory-Layout(shape=(1000000,), chunks=(100,), shards=(1000000,))-gzip] 9.5 s 2.7 s ×3.5
WallTime test_slice_indexing[None-(slice(0, None, 4), slice(0, None, 4), slice(0, None, 4))-memory] 372.7 ms 515.9 ms -27.76%
WallTime test_slice_indexing[(50, 50, 50)-(0, 0, 0)-memory] 1.7 ms 3.4 ms -48.59%
WallTime test_slice_indexing[None-(slice(None, 10, None), slice(None, 10, None), slice(None, 10, None))-memory] 875.1 µs 662 µs +32.18%
WallTime test_slice_indexing[None-(slice(10, -10, 4), slice(10, -10, 4), slice(10, -10, 4))-memory] 203.9 ms 282.5 ms -27.83%
WallTime test_slice_indexing[None-(slice(10, -10, 4), slice(10, -10, 4), slice(10, -10, 4))-memory_get_latency] 230.6 ms 316.5 ms -27.15%
WallTime test_write_array[memory-Layout(shape=(1000000,), chunks=(1000,), shards=None)-gzip] 1,015.3 ms 698.4 ms +45.38%
WallTime test_slice_indexing[(50, 50, 50)-(0, 0, 0)-memory_get_latency] 4.1 ms 5.7 ms -28.63%
WallTime test_write_array[local-Layout(shape=(1000000,), chunks=(1000,), shards=(1000,))-None] 2.8 s 1.4 s ×2
WallTime test_slice_indexing[None-(slice(0, None, 4), slice(0, None, 4), slice(0, None, 4))-memory_get_latency] 425.1 ms 575.4 ms -26.12%
WallTime test_slice_indexing[None-(slice(None, None, None), slice(0, 3, 2), slice(0, 10, None))-memory_get_latency] 4.1 ms 5.5 ms -26%
WallTime test_read_array[memory-Layout(shape=(1000000,), chunks=(1000,), shards=None)-None] 275.7 ms 335.7 ms -17.88%
WallTime test_write_array[memory-Layout(shape=(1000000,), chunks=(1000,), shards=(1000,))-gzip] 2.1 s 1 s ×2.1
WallTime test_write_array[local-Layout(shape=(1000000,), chunks=(1000,), shards=(1000,))-gzip] 3.2 s 1.5 s ×2.1
WallTime test_slice_indexing[(50, 50, 50)-(slice(0, None, 4), slice(0, None, 4), slice(0, None, 4))-memory] 410.2 ms 207.5 ms +97.7%
WallTime test_write_array[local-Layout(shape=(1000000,), chunks=(1000,), shards=None)-gzip] 1.6 s 1.2 s +33.88%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing d-v-b:perf/prepared-write-v2-bench (f3a4bbb) with main (7c78574)2

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (9391f43) during the generation of this report, so 7c78574 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark Code will be benchmarked in a CI job. needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant