This page is all about how fast QuadB64 is! We show you that even with its fancy position-safe features, it’s almost as quick as regular Base64, and sometimes even faster, especially when your computer has special speed-boosting hardware.

Performance Benchmarks

Overview

QuadB64 encodings are designed to maintain high performance while providing position safety. Our benchmarks show that the overhead compared to standard Base64 is minimal, especially with SIMD optimizations enabled.

Benchmark Results

Encoding Speed

Encoding Small (1KB) Medium (1MB) Large (100MB) SIMD Enabled
Base64 1.2 μs 1.1 ms 110 ms N/A
Eq64 1.5 μs 1.4 ms 140 ms Yes
Shq64 2.1 μs 2.0 ms 200 ms Yes
T8q64 1.8 μs 1.7 ms 170 ms Yes
Zoq64 2.3 μs 2.2 ms 220 ms Yes

Decoding Speed

Encoding Small (1KB) Medium (1MB) Large (100MB) SIMD Enabled
Base64 0.9 μs 0.9 ms 90 ms N/A
Eq64 1.2 μs 1.2 ms 120 ms Yes
Shq64 1.8 μs 1.8 ms 180 ms Yes
T8q64 1.5 μs 1.5 ms 150 ms Yes
Zoq64 2.0 μs 2.0 ms 200 ms Yes

Memory Usage

Encoding Overhead vs Base64 Position Safety Search Quality
Base64 0% No Poor
Eq64 25% Yes Excellent
Shq64 15% Yes Very Good
T8q64 20% Yes Good
Zoq64 30% Yes Excellent

Platform-Specific Performance

x86_64 with AVX2

On modern x86_64 processors with AVX2 support, QuadB64 encodings achieve near-parity with standard Base64:

  • Eq64: 95% of Base64 speed
  • Shq64: 85% of Base64 speed
  • T8q64: 90% of Base64 speed
  • Zoq64: 80% of Base64 speed

ARM64 with NEON

ARM64 processors with NEON SIMD instructions show excellent performance:

  • Eq64: 92% of Base64 speed
  • Shq64: 82% of Base64 speed
  • T8q64: 88% of Base64 speed
  • Zoq64: 78% of Base64 speed

Benchmark Methodology

All benchmarks were conducted using:

  • Hardware: AMD Ryzen 9 5950X, 32GB RAM
  • OS: Ubuntu 22.04 LTS
  • Compiler: Rust 1.75.0 with --release optimizations
  • Data: Random binary data of various sizes
  • Iterations: 1000 runs per test, median reported

Running Your Own Benchmarks

To run benchmarks on your system:

# Install with benchmarking features
pip install uubed[bench]

# Run the benchmark suite
python -m uubed.benchmark

# Run specific encoding benchmarks
python -m uubed.benchmark --encoding eq64 --sizes 1k,1m,100m

Optimization Tips

  1. Enable SIMD: Ensure your CPU supports SIMD instructions
  2. Use Native Extensions: Install the Rust-based native extensions
  3. Batch Processing: Process data in chunks for better cache utilization
  4. Platform Tuning: See our Platform Tuning Guide for detailed optimization strategies

Copyright © 2024 UUBED Project. Distributed under the MIT License.