Pre-allocate the distribution

This commit is contained in:
Luke Parker 2022-06-20 23:10:13 -04:00
parent f10bd5feee
commit 462d0e74ce
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6

View file

@ -20,7 +20,7 @@ const DECOYS: usize = RING_LEN - 1;
lazy_static! {
static ref GAMMA: Gamma<f64> = Gamma::new(19.28, 1.0 / 1.61).unwrap();
static ref DISTRIBUTION: Mutex<Vec<u64>> = Mutex::new(vec![]);
static ref DISTRIBUTION: Mutex<Vec<u64>> = Mutex::new(Vec::with_capacity(3000000));
}
async fn select_n<R: RngCore + CryptoRng>(