Use (unbounded) SegQueue instead of ArrayQueue

This commit is contained in:
Joakim Frostegård 2020-04-11 19:59:52 +02:00
parent 6503e89375
commit f37ba1e52e
7 changed files with 17 additions and 37 deletions

View file

@ -51,7 +51,7 @@ pub fn bench(
requests,
);
while let Ok((response, src)) = state.response_queue.pop(){
while let Ok((response, _)) = state.response_queue.pop(){
if let Response::Announce(_) = response {
num_responses += 1;
}

View file

@ -97,7 +97,7 @@ fn run(bench_config: BenchConfig){
let pb = create_progress_bar("Connect handler", bench_config.num_rounds);
for _ in (0..bench_config.num_rounds).progress_with(pb){
let state = State::new(&config);
let state = State::new();
let handles: Vec<_> = (0..bench_config.num_threads).map(|_| {
let requests = requests.clone();
@ -157,7 +157,7 @@ fn run(bench_config: BenchConfig){
let mut last_torrents = None;
for i in (0..bench_config.num_rounds).progress_with(pb){
let mut state = State::new(&config);
let mut state = State::new();
state.connections = connections.clone();
@ -186,7 +186,7 @@ fn run(bench_config: BenchConfig){
// Benchmark scrape handler
{
let mut state = State::new(&config);
let mut state = State::new();
state.torrents = last_torrents.unwrap();
let requests = scrape::create_requests(&mut rng, &info_hashes);