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

SIMD support? #266

Open
JosiahParry opened this issue Jan 13, 2024 · 2 comments
Open

SIMD support? #266

JosiahParry opened this issue Jan 13, 2024 · 2 comments

Comments

@JosiahParry
Copy link
Contributor

I'm curious what would need to be done to include SIMD support here. I ran a quick comparison between bindings to base64 here and the python bindings of the libbase64 which has SIMD support and the difference particularly for encoding are quite stark!

Using rust-base64 I can encode a 200mb file in 0.43 sec but with pybase64 (the bindings) it happens in 0.08 secs which is, I believe, due to the SIMD support on Mac M1. Decoding was 0.16 and 0.14 sec respectively.

I suspect that use of simd should be fairly straightforward here because we're dealing with know chunk sized of 4 bits at a time e.g. u8x64 https://rust-lang.github.io/portable-simd/core_simd/simd/type.u8x64.html could be quite handy here.

@marshallpierce
Copy link
Owner

#170 has some work towards an AVX2 Engine. All that's needed is for someone with the time to finish that effort.

@marshallpierce
Copy link
Owner

Well, for M1, a NEON impl will be needed, but the same idea holds: write an Engine that uses a suitable SIMD flow. Then, we can consider if and when automatic engine selection makes sense.

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

2 participants