Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cb2394d
feat: flag-gated benchmarking storage for fake latency
kyteware Jun 19, 2025
af20743
feat: first benchmark
kyteware Jun 19, 2025
5e5858e
chore: remove unused imports
kyteware Jun 19, 2025
1d79162
chore: cargo fmt
kyteware Jun 19, 2025
4182bd8
chore: cargo fmt
kyteware Jun 19, 2025
ceb9d15
ref: clarify naming of benchmark
kyteware Jun 19, 2025
1b3dab3
fix: change confidence interval
kyteware Jun 19, 2025
56333bf
fix: include needed sqlx features for sqlite
kyteware Jun 20, 2025
7bdcf44
chore: rename artifact of old benchmarks crate name
kyteware Jun 20, 2025
62e5b57
ref: rename the first benchmark to a more descriptive name
kyteware Jun 22, 2025
d0f40a6
feat: make latency static and use it for writes as well
kyteware Jun 22, 2025
ad63b89
doc: document reason for python script
kyteware Jun 22, 2025
97df541
ref: move dep documentation to a req.txt file
kyteware Jun 22, 2025
91a1d0a
doc: clarify sqlite usage
kyteware Jun 22, 2025
3335921
chore: add newline to gitignore
kyteware Jun 22, 2025
34d2ad2
doc: clarify benchmarking readme
kyteware Jun 22, 2025
fa1273f
doc: clarify iter_custom usage
kyteware Jun 22, 2025
4c73001
doc: include reasoning for benchmarking storage
kyteware Jun 22, 2025
f8a1e79
fix: lower verison of sqlx in benchmarking for lockfile
kyteware Jun 22, 2025
f76809b
chore: add license to requirements.txt
kyteware Jun 22, 2025
5f8cb97
fix: dont run benchmark if benchmarking flag isn't enabled
kyteware Jun 22, 2025
9a52a9e
chore: turn off warning for benchmarking cfg
kyteware Jun 22, 2025
9f12ba9
chore: cargo fmt
kyteware Jun 22, 2025
3cab046
chore: changes to pass cargo clippy
kyteware Jun 23, 2025
a529afd
chore: ignore sqlx in cargo machete because we only use it to bumb th…
kyteware Jun 24, 2025
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
Prev Previous commit
Next Next commit
ref: rename the first benchmark to a more descriptive name
  • Loading branch information
kyteware committed Jun 22, 2025
commit 62e5b5736da76345558d90535f618da31e6683d2
2 changes: 1 addition & 1 deletion crates/benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ sqlx = { version = "0.8.6", features = ["any", "runtime-tokio", "sqlite"] }
criterion = { version = "0.6.0", features = ["async_tokio"] }

[[bench]]
name = "sql-catalog-scanning-taxicab"
name = "sql-catalog-projection-once"
harness = false
2 changes: 1 addition & 1 deletion crates/benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ This command includes it: `RUSTFLAGS="--cfg benchmarking" cargo bench`

## Existing benchmarks

- `sql-catalog-scanning-taxicab`: Benchmarks scanning two columns from one month of NYC taxicab data.
- `sql-catalog-projection-once`: Benchmarks scanning the NYC taxicab data and projecting two columns.
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,35 @@ use iceberg::{Catalog, TableIdent};
use iceberg_catalog_sql::{SqlBindStyle, SqlCatalog, SqlCatalogConfig};
use tokio::runtime::Runtime;

pub fn bench_1_taxicab_query(c: &mut Criterion) {
let mut group = c.benchmark_group("single_read_taxicab_sql_catalog");
pub fn bench_sql_catalog_projection_once(c: &mut Criterion) {
let mut group = c.benchmark_group("sql_catalog_projection_once");
// request times are very sporadic, so we need a lower confidence level for reasonable results
group.measurement_time(Duration::from_secs(25)).confidence_level(0.8);
group.measurement_time(Duration::from_secs(20)).sample_size(50);

let table_dir = run_construction_script("sql-catalog-taxicab");
let mut db_path = table_dir.clone();
db_path.push("benchmarking-catalog.db");
let uri = format!("sqlite:{}", db_path.to_str().unwrap());

group.bench_function(
"single_read_taxicab_sql_catalog",
"sql_catalog_projection_once",
// iter custom is not ideal, but criterion doesn't let us have a custom async setup which is really annoying
|b| {
b.to_async(Runtime::new().unwrap()).iter_custom(async |_| {
let table = setup_table(table_dir.clone(), uri.clone()).await;
b.to_async(Runtime::new().unwrap()).iter_custom(async |n| {
let mut total_elapsed = Duration::default();

let start = Instant::now();
let output = scan_table(black_box(table)).await;
let end = Instant::now();
for _ in 0..n {
let table = setup_table(table_dir.clone(), uri.clone()).await;

drop(black_box(output));
let start = Instant::now();
let output = scan_table(black_box(table)).await;
let dur = start.elapsed();

end - start
drop(black_box(output));
total_elapsed += dur;
}

total_elapsed
})
},
);
Expand Down Expand Up @@ -93,5 +98,5 @@ async fn scan_table(table: Table) -> Vec<RecordBatch> {
stream.try_collect().await.unwrap()
}

criterion_group!(benches, bench_1_taxicab_query);
criterion_group!(benches, bench_sql_catalog_projection_once);
criterion_main!(benches);