Skip to content

Instantly share code, notes, and snippets.

View vigna's full-sized avatar

Sebastiano Vigna vigna

View GitHub Profile
@vigna
vigna / test.rs
Created July 1, 2023 10:00
Basic ChaCha12/ChaCha8/xoshiro256++ speed test
use rand::rngs::SmallRng;
use rand::rngs::StdRng;
use rand::Rng;
use rand::SeedableRng;
use rand_chacha::rand_core::RngCore;
use rand_chacha::ChaCha8Rng;
use std::hint::black_box;
use std::time::Instant;
fn main() {
use rand::rngs::SmallRng;
use rand::rngs::StdRng;
use rand::Rng;
use rand::SeedableRng;
use rand_chacha::ChaCha8Rng;
use std::hint::black_box;
use std::time::Instant;
fn main() {
const N: usize = 1024 * 1024 * 1024;