Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue ... #4

Open
kif opened this issue Jan 2, 2023 · 1 comment
Open

Performance issue ... #4

kif opened this issue Jan 2, 2023 · 1 comment
Assignees

Comments

@kif
Copy link

kif commented Jan 2, 2023

Hi,
I am looking for a fast and portable CRC implementation for Python ... but I think I found a performance bug:

import numpy,zlib,fastcrc
a = numpy.random.random((2048,2048))
%timeit zlib.crc32(a)
26.4 ms ± 29 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
%timeit fastcrc.crc32.aixm(a.tobytes())
83.9 ms ± 8.78 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
%timeit pyFAI.ext.fastcrc.crc32(a)
7.59 ms ± 2.07 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

The implementation from pyFAI relies on the SSE4 instruction, thus not portable.

@overcat overcat self-assigned this Jan 3, 2023
@akhilles
Copy link

FYI, crc-rs has a new (unreleased) implementation that's ~6x faster in micro-benchmarks: https://github.com/mrhooray/crc-rs#throughput-gibs. However, a portable implementation just won't be able to match the performance of a SIMD implementation.

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

No branches or pull requests

3 participants