Skip to content

Stride per-shard object checksum scan - #862

Open
amilnarski wants to merge 1 commit into
Netflix:masterfrom
amilnarski:perf/object-checksum-stride
Open

amilnarski wants to merge 1 commit into
Netflix:masterfrom
amilnarski:perf/object-checksum-stride

Conversation

@amilnarski

Copy link
Copy Markdown

HollowObjectTypeReadStateShard.applyShardToChecksum walked every populated ordinal from 0 for each shard, making an object type's checksum O(shards * ordinals). Port the stride/round-up loop that 0333d1e applied to list, set and map shards so each shard visits only its own ordinals. Visit order is unchanged, so checksum values are identical; a new test pins the value for a sharded type with holes in the populated ordinals. At 40M records and 128 shards a checksum drops from 24.2s to 3.1s.

HollowObjectTypeReadStateShard.applyShardToChecksum walked every populated
ordinal from 0 for each shard, making an object type's checksum O(S*M).
Port the stride/round-up loop that 0333d1e applied to list, set and map
shards so each shard visits only its own ordinals. Visit order is
unchanged, so checksum values are identical; a new test pins the value
for a sharded type with holes in the populated ordinals.

Add a CheckSumObjects JMH benchmark alongside CheckSumCollections. At
100k records the old loop grows from 7.2ms (1 shard) to 62.6ms (128
shards); the new loop stays at ~7.2ms. At 40M records and 128 shards a
checksum drops from 24.2s to 3.1s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant