diff --git a/bench/standard/aggregates/many_int_groups_1M.bench b/bench/standard/aggregates/many_int_groups_1M.bench new file mode 100644 index 000000000..1296054f8 --- /dev/null +++ b/bench/standard/aggregates/many_int_groups_1M.bench @@ -0,0 +1,8 @@ +# GROUP BY with many int groups + +setup +CREATE TEMP VIEW v(i1, i2) AS + SELECT * FROM generate_series(1, 4) g1, generate_series(1, 1000000) g2 + +run +SELECT sum(i1) FROM v GROUP BY i2; diff --git a/bench/standard/aggregates/many_med_string_groups_1M.bench b/bench/standard/aggregates/many_med_string_groups_1M.bench new file mode 100644 index 000000000..76adb16f9 --- /dev/null +++ b/bench/standard/aggregates/many_med_string_groups_1M.bench @@ -0,0 +1,9 @@ +# GROUP BY with many string groups + +setup +CREATE TEMP VIEW v(ints, strings) AS + SELECT a, repeat(b::string, 100) + FROM generate_series(1, 4) g1(a), generate_series(1, 1000000) g2(b) + +run +SELECT sum(ints) FROM v GROUP BY strings; diff --git a/bench/standard/aggregates/many_small_string_groups_1M.bench b/bench/standard/aggregates/many_small_string_groups_1M.bench new file mode 100644 index 000000000..af13bda28 --- /dev/null +++ b/bench/standard/aggregates/many_small_string_groups_1M.bench @@ -0,0 +1,8 @@ +# GROUP BY with many string groups + +setup +CREATE TEMP VIEW v(ints, strings) AS + SELECT a, b::string FROM generate_series(1, 4) g1(a), generate_series(1, 1000000) g2(b) + +run +SELECT sum(ints) FROM v GROUP BY strings; diff --git a/crates/rayexec_bench/src/benchmark.rs b/crates/rayexec_bench/src/benchmark.rs index f5d3a33a5..03149fe9e 100644 --- a/crates/rayexec_bench/src/benchmark.rs +++ b/crates/rayexec_bench/src/benchmark.rs @@ -20,6 +20,27 @@ impl Benchmark { Self::from_buf_read(reader) } + /// Construct a benchmark run from some reader. + /// + /// The content should include setup queries and benchmark queries. + /// + /// Setup queries are annotated with "setup": + /// + /// ```text + /// setup + /// CREATE TABLE ... + /// ``` + /// + /// Benchmark queries are annotated with "run": + /// + /// ```text + /// run + /// SELECT * FROM ... + /// ``` + /// + /// Any number of setup and benchmark queries can be provided, however a + /// setup query cannot be defined after a benchmark query has already been + /// defined. pub fn from_buf_read(reader: impl BufRead) -> Result { let lines = reader.lines(); diff --git a/crates/rayexec_bench/src/lib.rs b/crates/rayexec_bench/src/lib.rs index 1aae34c97..7f89b2cc4 100644 --- a/crates/rayexec_bench/src/lib.rs +++ b/crates/rayexec_bench/src/lib.rs @@ -116,13 +116,13 @@ pub fn run(builder: impl EngineBuilder, default_dir: &str) -> Result<()> { // Print results. println!( - "{:<40}\t{:>7}\t{:>14}", + "{:<60}\t{:>6}\t{:>14}", "benchmark_name", "count", "time_ms" ); for (name, times) in &all_times { for (idx, query_time) in times.query_times_ms.iter().enumerate() { - println!("{:<40}\t{:>7}\t{:>14}", name, idx + 1, query_time); + println!("{:<60}\t{:>6}\t{:>14}", name, idx + 1, query_time); } }