Skip to content

Speed up large CRC32 buffers on ARM64 - #60

Open
code-inflation wants to merge 1 commit into
chore/maintenance-refreshfrom
perf/arm64-large-crc32
Open

code-inflation wants to merge 1 commit into
chore/maintenance-refreshfrom
perf/arm64-large-crc32

Conversation

@code-inflation

Copy link
Copy Markdown
Owner

fastcrc now uses SIMD and was ahead of pycrc32 on our 32 MiB ARM64 benchmark. This adds a parallel path for inputs of at least 16 MiB on ARM64 Linux and macOS. The caller and three workers take chunks as they become free, then combine the partial checksums in byte order. Small inputs and machines without the required CPU features still use crc32fast. The Python API is unchanged.

This is stacked on #59 so the performance changes can be reviewed separately from the maintenance update.

Verification

On the same ARM64 Linux VM, the warm release wheel took 0.417 ms for 32 MiB, down from 0.733 ms on #59. fastcrc 0.5.0 took 0.598 ms and zlib 1.4 took 10.141 ms. That's 43% higher throughput than fastcrc in the repeated runs; the 50% margin wasn't consistent. The first call took 0.669 ms, including worker startup. The latency checks found no small-input regression.

All 32 tests passed against installed ARM64 Linux wheels on CPython 3.11–3.15, including seeded updates, combine(), and hashing after fork(). A single-core check also passed without starting workers. Native macOS performance hasn't been measured yet.

@code-inflation
code-inflation added this pull request to stack #61 November 29, 2026 13:08
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