Repository navigation
Speed up large CRC32 buffers on ARM64 - #60
Open
code-inflation wants to merge 1 commit into
Open
code-inflation wants to merge 1 commit into
code-inflation wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fastcrcnow uses SIMD and was ahead ofpycrc32on 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 usecrc32fast. 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.
fastcrc0.5.0 took 0.598 ms andzlib1.4 took 10.141 ms. That's 43% higher throughput thanfastcrcin 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 afterfork(). A single-core check also passed without starting workers. Native macOS performance hasn't been measured yet.