alamb commented on code in PR #15632: URL: https://github.com/apache/datafusion/pull/15632#discussion_r2032958303
########## datafusion/physical-expr/benches/binary_op.rs: ########## @@ -130,75 +129,6 @@ fn generate_boolean_cases<const TEST_ALL_FALSE: bool>( cases } -/// Benchmarks boolean operations `false_count/bool_or` and `true_count/bool_and` on [`BooleanArray`] -/// You can run this benchmark with: -/// ```sh -/// # test true_count/false_count -/// TEST_BOOL_COUNT=1 cargo bench --bench binary_op -- boolean_ops -/// # test bool_or/bool_and -/// cargo bench --bench binary_op -- boolean_ops -/// ``` -fn benchmark_boolean_ops(c: &mut Criterion) { - let len = 1_000_000; // Use one million elements for clear performance differentiation - static TEST_BOOL_COUNT: LazyLock<bool> = - LazyLock::new(|| match std::env::var("TEST_BOOL_COUNT") { - Ok(_) => { - println!("TEST_BOOL_COUNT=ON"); - true - } - Err(_) => { - println!("TEST_BOOL_COUNT=OFF"); - false - } - }); - - // Determine the test function to be executed based on the ENV `TEST_BOOL_COUNT` - fn test_func<const TEST_ALL_FALSE: bool>(array: &BooleanArray) -> bool { - // Use false_count for all false and true_count for all true - if *TEST_BOOL_COUNT { - if TEST_ALL_FALSE { - array.false_count() == array.len() - } else { - array.true_count() == array.len() - } - } - // Use bool_or for all false and bool_and for all true - else if TEST_ALL_FALSE { - match bool_or(array) { - Some(v) => !v, - None => false, - } - } else { - bool_and(array).unwrap_or(false) Review Comment: these are benchmarks for bool_and and false_count / true_count so I don't think we need them in DataFusion ########## datafusion/physical-expr/benches/binary_op.rs: ########## @@ -130,75 +129,6 @@ fn generate_boolean_cases<const TEST_ALL_FALSE: bool>( cases } -/// Benchmarks boolean operations `false_count/bool_or` and `true_count/bool_and` on [`BooleanArray`] -/// You can run this benchmark with: -/// ```sh -/// # test true_count/false_count -/// TEST_BOOL_COUNT=1 cargo bench --bench binary_op -- boolean_ops -/// # test bool_or/bool_and -/// cargo bench --bench binary_op -- boolean_ops -/// ``` -fn benchmark_boolean_ops(c: &mut Criterion) { - let len = 1_000_000; // Use one million elements for clear performance differentiation - static TEST_BOOL_COUNT: LazyLock<bool> = - LazyLock::new(|| match std::env::var("TEST_BOOL_COUNT") { - Ok(_) => { - println!("TEST_BOOL_COUNT=ON"); - true - } - Err(_) => { - println!("TEST_BOOL_COUNT=OFF"); - false - } - }); - - // Determine the test function to be executed based on the ENV `TEST_BOOL_COUNT` - fn test_func<const TEST_ALL_FALSE: bool>(array: &BooleanArray) -> bool { - // Use false_count for all false and true_count for all true - if *TEST_BOOL_COUNT { - if TEST_ALL_FALSE { - array.false_count() == array.len() - } else { - array.true_count() == array.len() - } - } - // Use bool_or for all false and bool_and for all true - else if TEST_ALL_FALSE { - match bool_or(array) { - Some(v) => !v, - None => false, - } - } else { - bool_and(array).unwrap_or(false) Review Comment: these are benchmarks for arrow functions bool_and and false_count / true_count so I don't think we need them in DataFusion -- 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