From 9e6155673fc4756db710f7b3b0c7d05b469d4b8b Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Wed, 27 Jan 2016 01:20:17 -0800 Subject: [PATCH] clean up benchmark --- tarpc/src/macros.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tarpc/src/macros.rs b/tarpc/src/macros.rs index af07b37..2364c44 100644 --- a/tarpc/src/macros.rs +++ b/tarpc/src/macros.rs @@ -500,12 +500,13 @@ mod test { let _ = env_logger::init(); let handle = hello::serve("localhost:0", HelloServer, None).unwrap(); let client = hello::AsyncClient::new(handle.local_addr(), None).unwrap(); - let mut rpcs = Vec::with_capacity(100); + let concurrency = 100; + let mut rpcs = Vec::with_capacity(concurrency); bencher.iter(|| { - for _ in 0..1000 { + for _ in 0..concurrency { rpcs.push(client.hello("Bob".into())); } - for _ in 0..1000 { + for _ in 0..concurrency { rpcs.pop().unwrap().get().unwrap(); } });