mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
Use (unbounded) SegQueue instead of ArrayQueue
This commit is contained in:
parent
6503e89375
commit
f37ba1e52e
7 changed files with 17 additions and 37 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue