alamb commented on code in PR #15948: URL: https://github.com/apache/datafusion/pull/15948#discussion_r2075222354
########## datafusion/physical-plan/benches/sort_merge_join.rs: ########## @@ -0,0 +1,117 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use arrow_schema::SortOptions; +use criterion::{criterion_group, criterion_main, Criterion}; +use datafusion_common::JoinType::Inner; +use datafusion_execution::config::SessionConfig; +use datafusion_execution::disk_manager::DiskManagerConfig; +use datafusion_execution::runtime_env::RuntimeEnvBuilder; +use datafusion_execution::TaskContext; +use datafusion_physical_expr::expressions::Column; +use datafusion_physical_plan::common::collect; +use datafusion_physical_plan::joins::SortMergeJoinExec; +use datafusion_physical_plan::test::{build_table_i32, TestMemoryExec}; Review Comment: I worry that using test only structures like this will means the benchmark is not measuring performance that will map directly to query performance. I think you could move the file from * `datafusion/physical-plan/benches/sort_merge_join.rs` to * `datafusion/core/benches/sort_merge_join.rs` And use a SessionContext and actual query to run to be closer. Here is an example that does something similar: https://github.com/apache/datafusion/blob/main/datafusion/core/benches/filter_query_sql.rs ########## datafusion/physical-plan/benches/sort_merge_join.rs: ########## @@ -0,0 +1,117 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use arrow_schema::SortOptions; +use criterion::{criterion_group, criterion_main, Criterion}; +use datafusion_common::JoinType::Inner; +use datafusion_execution::config::SessionConfig; +use datafusion_execution::disk_manager::DiskManagerConfig; +use datafusion_execution::runtime_env::RuntimeEnvBuilder; +use datafusion_execution::TaskContext; +use datafusion_physical_expr::expressions::Column; +use datafusion_physical_plan::common::collect; +use datafusion_physical_plan::joins::SortMergeJoinExec; +use datafusion_physical_plan::test::{build_table_i32, TestMemoryExec}; +use datafusion_physical_plan::ExecutionPlan; +use std::sync::Arc; +use tokio::runtime::Runtime; + +fn create_test_data() -> SortMergeJoinExec { + let left_batch = build_table_i32( + ("a1", &vec![0, 1, 2, 3, 4, 5]), Review Comment: I think a bencmark that has only 5 rows is likely going to only measure the overhead of plan setup rather than the actual performance of a large join that needs to spill Perhaps we can increase this size to 1M rows or something (is important that b1 and b2 remain sorted) ########## datafusion/physical-plan/src/lib.rs: ########## @@ -92,5 +92,4 @@ pub mod udaf { } pub mod coalesce; -#[cfg(test)] Review Comment: I think you could avoid doing this by using the actual operators -- see comment above -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org