From b07b25bc3e0c3ee48755a93453378caa57d6be55 Mon Sep 17 00:00:00 2001 From: Simeon Romanov Date: Sat, 16 Dec 2023 15:03:42 +0300 Subject: [PATCH] post review fixes --- .github/workflows/build.yml | 5 +++++ src/benchmark/bin.rs | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 841aa06e89..54bff34747 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,11 @@ jobs: with: command: build args: --features async-io-rio + - name: Build benchmarks + uses: actions-rs/cargo@v1 + with: + command: build + args: --features benchmark build-windows: runs-on: windows-latest diff --git a/src/benchmark/bin.rs b/src/benchmark/bin.rs index 6fe5888b7e..ad4ce79ac9 100644 --- a/src/benchmark/bin.rs +++ b/src/benchmark/bin.rs @@ -29,7 +29,6 @@ mod prelude { io::Write, ops::Add, path::{Path, PathBuf}, - sync::Arc, time::{Duration, Instant}, }; } @@ -79,13 +78,12 @@ async fn start_app() { let prepared = (0..futures_limit).map(|_| generator.next().unwrap()); { - let arc_writer = Arc::new(&writer); let mut futures_pool: FuturesUnordered<_> = prepared .into_iter() .map(|(key, data)| { let ltx = tx.clone(); counter += 1; - arc_writer.write(key, data, ltx) + writer.write(key, data, ltx) }) .collect(); println!( @@ -115,7 +113,7 @@ async fn start_app() { if let Some((key, data)) = generator.next() { let ltx = tx.clone(); counter += 1; - futures_pool.push(arc_writer.write(key.into(), data, ltx)); + futures_pool.push(writer.write(key.into(), data, ltx)); } } debug!("#{}/{} next await", counter, futures_pool.len());