From 2f87d2127ddb11620abd3eb73224c647c51ef199 Mon Sep 17 00:00:00 2001 From: Paul Loyd Date: Thu, 7 Dec 2023 10:23:51 +0100 Subject: [PATCH] test(insert): more realistic payload --- benches/insert.rs | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/benches/insert.rs b/benches/insert.rs index f2f7827..e0924d7 100644 --- a/benches/insert.rs +++ b/benches/insert.rs @@ -45,6 +45,25 @@ struct SomeRow { b: i64, c: i32, d: u32, + e: u64, + f: u32, + g: u64, + h: i64, +} + +impl SomeRow { + fn sample() -> Self { + black_box(Self { + a: 42, + b: 42, + c: 42, + d: 42, + e: 42, + f: 42, + g: 42, + h: 42, + }) + } } async fn run_insert(client: Client, iters: u64) -> Result { @@ -52,14 +71,7 @@ async fn run_insert(client: Client, iters: u64) -> Result { let mut insert = client.insert("table")?; for _ in 0..iters { - insert - .write(&black_box(SomeRow { - a: 42, - b: 42, - c: 42, - d: 42, - })) - .await?; + insert.write(&SomeRow::sample()).await?; } insert.end().await?; @@ -76,12 +88,7 @@ async fn run_inserter(client: Client, iters: u64) -> Re } for _ in 0..iters { - inserter.write(&black_box(SomeRow { - a: 42, - b: 42, - c: 42, - d: 42, - }))?; + inserter.write(&SomeRow::sample())?; inserter.commit().await?; }