๐ Base 64
โจ SIMD-accelerated Base64 for Rust โจ
๐ Features
- ๐ก Uses AVX2 instructions for super-fast encoding and decoding
- ๐ Fallback when AVX2 is unavailable uses any available SIMD
๐ฏ Project goals
- ๐ง Simple, idiomatic API
- ๐ฆ Sensible defaults
- โก Fast
Installation
Usage
use bs64;
Benchmarks
Ran using 100k inputs, 10000 iterations on an Intelยฎ Coreโข i7-1065G7. Comparisons are made against base64 and data-encoding crates.
cargo run --features "cli" --release -- -b 100000 -i 10000
Encode
| name | MB/s |
|---|---|
| ๐ bs64::encode() | 4813.70 |
| ๐ bs64::encode_mut() | 6579.17 |
| ๐ bs64 fallback | 944.18 |
| data_encoding | 858.51 |
| data_encoding mut | 873.28 |
| base64 | 748.02 |
| base64 mut | 870.99 |
Decode
| name | MB/s |
|---|---|
| ๐ bs64::decode() | 3899.26 |
| ๐ bs64::decode_mut() | 3965.25 |
| ๐ bs64 fallback | 837.17 |
| data_encoding | 647.33 |
| data_encoding mut | 684.01 |
| base64 | 761.68 |
| base64 mut | 805.60 |
TODO
- Integration tests
- Benchmarking suite
- Regression tests + benchmark in Github Actions
- Change default implementation with feature flags
- Builders for custom configs at runtime