Research preview

Performance

Benchmarks, native vs pure Python, and optimization guidance.

Skip to content

Backends at a glance

BackendImplementationRelative speedWhen to use
vortex-pqc-nativeC extension (compiled)~10× fasterProduction, benchmarks, services
vortex-pqc-pure-pythonPython reference (schoolbook mul)BaselineCI without compiler, education, correctness checks

Running benchmarks

python
from vortex_pqc import benchmark_throughput, native_backend

print(f"Backend: {native_backend()}")
results = benchmark_throughput(operations=50)

for op, stats in results.items():
    ops = stats["mean_ops"]
    ci  = stats["confidence_interval"]
    print(f"{op:8s}  {ops:8,.0f} ops/s  (± {ci:,.0f})")

Example output (native, Apple Silicon — your numbers will vary):

Backend: vortex-pqc-native-aarch64
keygen      1,200 ops/s  (± 50)
encaps      1,100 ops/s  (± 45)
decaps      1,150 ops/s  (± 48)

Where time is spent

OperationDominant costNotes
Keygen1× poly mul per rotation + XOF1 XOF call (vs 4 in Kyber-512)
EncapsK poly muls + hashingFresh randomness each call
DecapsK poly muls + re-encryptionFO check adds one full encaps path

VORTEX vs Kyber-512 efficiency

MetricKyber-512VORTEX-256Advantage
Key expansion XOF calls41VORTEX
Frobenius rotationsN/AK−1 permutationsVORTEX (free vs XOF)
Private key size1 632 B1 248 BVORTEX
Poly mul count (encaps)SimilarSimilarTie
NTT optimisationAvailablePlannedKyber (today)

Optimisation roadmap

OptimisationStatusExpected gain
Schoolbook poly mul (C)✅ ShippedBaseline native
NTT-based poly mul🔜 Planned5–10× on poly operations
AVX2 / NEON SIMD🔜 Planned2–4× on NTT
ARM64 -mcpu=native✅ ShippedPlatform-specific tuning

Tuning for your deployment

Maximise throughput (servers)
✓  Install with C compiler present (native backend)
✓  Use pip install without --no-binary
✓  Pre-generate key pairs (keygen is amortised)
✓  Batch encapsulations if your protocol allows
Minimise binary size (embedded)
✓  Link only libvortex_pqc.a (no Python)
✓  Strip symbols: cc ... -s
✓  Pre-provision keys offline (skip keygen on device)
CI without a compiler
✓  Pure Python backend works everywhere
✓  All 26 tests pass without _native.so
✓  Slower but cryptographically identical

C benchmark

bash
cd c
make lib
# Optional: build and run bench test if available
make -C c test