diff --git a/crates/bench/benches/generic.rs b/crates/bench/benches/generic.rs index 8a350c5d57..84fb4b3af9 100644 --- a/crates/bench/benches/generic.rs +++ b/crates/bench/benches/generic.rs @@ -293,7 +293,7 @@ fn _filter_setup( load: u32, buckets: u32, ) -> ResultBench<(String, TableSchema, Vec)> { - let filter_column_type = match &T::product_type().elements[column_index as usize].algebraic_type { + let filter_column_type = match T::product_type().elements[column_index as usize].algebraic_type { AlgebraicType::String => "string", AlgebraicType::U32 => "u32", AlgebraicType::U64 => "u64", diff --git a/crates/bench/benches/special.rs b/crates/bench/benches/special.rs index 4c692e284b..9b20865786 100644 --- a/crates/bench/benches/special.rs +++ b/crates/bench/benches/special.rs @@ -4,10 +4,7 @@ use spacetimedb_bench::{ schemas::{create_sequential, BenchTable, Location, Person, RandomTable}, spacetime_module::BENCHMARKS_MODULE, }; -use spacetimedb_lib::{ - sats::{self, BuiltinValue}, - AlgebraicValue, ProductValue, -}; +use spacetimedb_lib::{sats, ProductValue}; use spacetimedb_testing::modules::start_runtime; fn criterion_benchmark(c: &mut Criterion) { @@ -26,9 +23,7 @@ fn custom_module_benchmarks(c: &mut Criterion) { }; let module = runtime.block_on(async { BENCHMARKS_MODULE.load_module(config).await }); - let args = ProductValue { - elements: vec![AlgebraicValue::Builtin(BuiltinValue::String("0".repeat(65536)))], - }; + let args = sats::product!["0".repeat(65536)]; c.bench_function("stdb_module/large_arguments/64KiB", |b| { b.iter_batched( || args.clone(), @@ -37,10 +32,8 @@ fn custom_module_benchmarks(c: &mut Criterion) { ) }); - for n in [1, 100, 1000] { - let args = ProductValue { - elements: vec![AlgebraicValue::Builtin(BuiltinValue::U32(n))], - }; + for n in [1u32, 100, 1000] { + let args = sats::product![n]; c.bench_function(&format!("stdb_module/print_bulk/lines={n}"), |b| { b.iter_batched( || args.clone(),