From eed0acd15fa6573a202332e6572672154610c5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sun, 5 Apr 2020 14:29:56 +0200 Subject: [PATCH] bench: add pareto shape const, generate less info_hashes --- aquatic/src/bin/bench_announce_scrape.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aquatic/src/bin/bench_announce_scrape.rs b/aquatic/src/bin/bench_announce_scrape.rs index 6659334..86b48e9 100644 --- a/aquatic/src/bin/bench_announce_scrape.rs +++ b/aquatic/src/bin/bench_announce_scrape.rs @@ -8,10 +8,10 @@ use aquatic::common::*; use aquatic::handler::*; +const PARETO_SHAPE: f64 = 3.0; const ANNOUNCE_ITERATIONS: usize = 5_000_000; const SCRAPE_ITERATIONS: usize = 500_000; - -const NUM_INFO_HASHES: usize = ANNOUNCE_ITERATIONS; +const NUM_INFO_HASHES: usize = 500_000; fn main(){ @@ -128,7 +128,7 @@ fn create_announce_requests( rng: &mut impl Rng, info_hashes: &Vec ) -> Vec<(AnnounceRequest, SocketAddr)> { - let pareto = Pareto::new(1., 6.).unwrap(); + let pareto = Pareto::new(1., PARETO_SHAPE).unwrap(); let max_index = info_hashes.len() - 1; @@ -166,7 +166,7 @@ fn create_scrape_requests( rng: &mut impl Rng, info_hashes: &Vec ) -> Vec<(ScrapeRequest, SocketAddr)> { - let pareto = Pareto::new(1., 6.).unwrap(); + let pareto = Pareto::new(1., PARETO_SHAPE).unwrap(); let max_index = info_hashes.len() - 1;