Random Generation and Lookup Table Benchmarks

January 18, 2026 ยท View on GitHub

Benchmarks for random byte generation and lookup table operations across Rust and Python implementations.

Overview

Some of the most common operations in data processing are random generation and lookup tables. That's true not only for strings but for any data type, and StringZilla has been extensively used in Image Processing and Bioinformatics for those purposes.

Random Byte Generation

LibraryShort WordsLong Lines
Rust
getrandom::fill0.18 GB/s0.45 GB/s
rand_chacha::ChaCha20Rng0.62 GB/s1.85 GB/s
rand_xoshiro::Xoshiro128Plus0.83 GB/s3.85 GB/s
zeroize::zeroize0.66 GB/s4.73 GB/s
stringzilla::fill_random2.47 GB/s10.57 GB/s
Python
numpy.PCG640.01 GB/s1.28 GB/s
numpy.Philox0.01 GB/s1.59 GB/s
pycryptodome.AES-CTR0.01 GB/s13.16 GB/s
stringzilla.random0.11 GB/s20.37 GB/s

Lookup Tables

Performing in-place lookups in a precomputed table of 256 bytes:

LibraryShort WordsLong Lines
Rust
serial code0.61 GB/s1.49 GB/s
stringzilla::lookup_inplace0.54 GB/s9.90 GB/s
Python
bytes.translate0.05 GB/s1.92 GB/s
numpy.take0.01 GB/s0.85 GB/s
opencv.LUT0.01 GB/s1.95 GB/s
opencv.LUT inplace0.01 GB/s2.16 GB/s
stringzilla.translate0.07 GB/s7.92 GB/s
stringzilla.translate inplace0.06 GB/s8.14 GB/s

See README.md for dataset information and replication instructions.