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

Base64 acceleration for ARM64 #66

Merged
merged 12 commits into from
Jan 18, 2022
Merged

Base64 acceleration for ARM64 #66

merged 12 commits into from
Jan 18, 2022

Conversation

kalamay
Copy link
Contributor

@kalamay kalamay commented Dec 9, 2021

This PR introduces ARM64 support for base64.

The general purpose portion of base64_amd64.go was moved into base64_asm.go while keeping the AMD64-specific code isolated. A new base64_arm64.go implementation in being introduced to the current implementation.

On a Graviton 2 instance, the benchmarks are looking decent:

goarch: arm64
pkg: github.com/segmentio/asm/base64
BenchmarkEncode/asm-4            1207927               994.1 ns/op      4120.41 MB/s
BenchmarkEncode/go-4              208002              5759 ns/op         711.18 MB/s
BenchmarkDecode/asm-4             534616              2242 ns/op        2437.53 MB/s
BenchmarkDecode/go-4              233426              5140 ns/op        1063.06 MB/s

@kalamay kalamay marked this pull request as ready for review January 11, 2022 18:06
Copy link
Contributor

@chriso chriso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

base64/decode_arm64.s Show resolved Hide resolved
@kalamay kalamay merged commit 6453584 into main Jan 18, 2022
@kalamay kalamay deleted the arm-base64 branch January 18, 2022 19:59
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.

None yet

2 participants