Skip to content

Reduce multi-stream block size from 64 bytes to 16 bytes in ExtendWithPclmul. - #2226

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_995282703
Oct 22, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_995282703

Conversation

@copybara-service

Copy link
Copy Markdown

Reduce multi-stream block size from 64 bytes to 16 bytes in ExtendWithPclmul.

Change the per-stream block granularity in ExtendWithPclmul from 64 bytes to
16 bytes when copy_type == CopyType::kNone so that fewer trailing bytes fall
through to the slow single-stream scalar loop.

After the 64-byte main loop (bs / 4 iterations), handle the remaining 32-byte
(bs & 2) and 16-byte (bs & 1) per-stream blocks in non-copy mode using
ProcessAllStreams16, rotating the 4 partial CRCs per PCLMUL stream so they
remain ordered from oldest to newest before final reduction.

Re-tune the stream counts, since it's now less expensive to have a larger number of them.

Also, move the computation of the magic constant to before the main loop, so that it's latency is off the critical path.

@copybara-service
copybara-service Bot force-pushed the test_995282703 branch 7 times, most recently from 406ee9d to 607cdb0 Compare October 22, 2026 19:20
…hPclmul.

Change the per-stream block granularity in `ExtendWithPclmul` from 64 bytes to
16 bytes when `copy_type == CopyType::kNone` so that fewer trailing bytes fall
through to the slow single-stream scalar loop.

After the 64-byte main loop (`bs / 4` iterations), handle the remaining 32-byte
(`bs & 2`) and 16-byte (`bs & 1`) per-stream blocks in non-copy mode using
`ProcessAllStreams16`, rotating the 4 partial CRCs per PCLMUL stream so they
remain ordered from oldest to newest before final reduction.

Re-tune the stream counts, since it's now less expensive to have a larger number of them.

Also, move the computation of the magic constant to before the main loop, so that it's latency is off the critical path.

PiperOrigin-RevId: 1004984384
@copybara-service
copybara-service Bot merged commit 0abf9f7 into master Oct 22, 2026
76 checks passed
@copybara-service
copybara-service Bot deleted the test_995282703 branch October 22, 2026 19:51
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