mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
bench: add pareto shape const, generate less info_hashes
This commit is contained in:
parent
570be610d6
commit
eed0acd15f
1 changed files with 4 additions and 4 deletions
|
|
@ -8,10 +8,10 @@ use aquatic::common::*;
|
||||||
use aquatic::handler::*;
|
use aquatic::handler::*;
|
||||||
|
|
||||||
|
|
||||||
|
const PARETO_SHAPE: f64 = 3.0;
|
||||||
const ANNOUNCE_ITERATIONS: usize = 5_000_000;
|
const ANNOUNCE_ITERATIONS: usize = 5_000_000;
|
||||||
const SCRAPE_ITERATIONS: usize = 500_000;
|
const SCRAPE_ITERATIONS: usize = 500_000;
|
||||||
|
const NUM_INFO_HASHES: usize = 500_000;
|
||||||
const NUM_INFO_HASHES: usize = ANNOUNCE_ITERATIONS;
|
|
||||||
|
|
||||||
|
|
||||||
fn main(){
|
fn main(){
|
||||||
|
|
@ -128,7 +128,7 @@ fn create_announce_requests(
|
||||||
rng: &mut impl Rng,
|
rng: &mut impl Rng,
|
||||||
info_hashes: &Vec<InfoHash>
|
info_hashes: &Vec<InfoHash>
|
||||||
) -> Vec<(AnnounceRequest, SocketAddr)> {
|
) -> 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;
|
let max_index = info_hashes.len() - 1;
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ fn create_scrape_requests(
|
||||||
rng: &mut impl Rng,
|
rng: &mut impl Rng,
|
||||||
info_hashes: &Vec<InfoHash>
|
info_hashes: &Vec<InfoHash>
|
||||||
) -> Vec<(ScrapeRequest, SocketAddr)> {
|
) -> 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;
|
let max_index = info_hashes.len() - 1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue