Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get benchmarks type checking again #392

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/bench/benches/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ fn _filter_setup<DB: BenchDatabase, T: BenchTable + RandomTable>(
load: u32,
buckets: u32,
) -> ResultBench<(String, TableSchema, Vec<T>)> {
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",
Expand Down
15 changes: 4 additions & 11 deletions crates/bench/benches/special.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(),
Expand All @@ -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(),
Expand Down
Loading