Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcy/vb64
SIMD base64 codecs
https://github.com/mcy/vb64
Last synced: about 1 month ago
JSON representation
SIMD base64 codecs
- Host: GitHub
- URL: https://github.com/mcy/vb64
- Owner: mcy
- License: apache-2.0
- Created: 2023-11-03T01:18:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-08T21:13:49.000Z (12 months ago)
- Last Synced: 2024-12-10T04:31:48.470Z (about 2 months ago)
- Language: Rust
- Size: 711 KB
- Stars: 76
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# vb64
Fast, SIMD base64 codecs.
This crate implements base64 encoding and decoding as fast as possible.
To get maximum performance, compile with `-Ctarget-cpu=native` and
`-Zbuild-std`, which will ensure ideal instruction selection.The following is a perf comparison with the `base64` crate on a Zen 2
machine using AVX2 instructions; lower is better.![perf comparison with `base64`](images/graph.png)
On a Zen 2 machine and compiling with AVX2 support, decoding is between
2x to 2.5x faster than `base64`, while encoding is around 1.2x to 1.5x
faster; with only SSSE3, decoding performance is even with `base64` and
encoding is much worse.It is relatively unlikely that base64 decoding is such a massive bottleneck
for your application that this matters, unless you're parsing base64 blobs
embedded in JSON; you may want to consider using a binary format like
Protobuf instead.Also this crate uses `std::simd` so it requires nightly.
License: Apache-2.0