leung-ming commented on code in PR #1893: URL: https://github.com/apache/datafusion-comet/pull/1893#discussion_r2179672831
########## native/spark-expr/src/agg_funcs/avg_decimal.rs: ########## @@ -341,29 +337,16 @@ impl AvgDecimalGroupsAccumulator { } } - fn is_overflow(&self, index: usize) -> bool { - !self.is_empty.get_bit(index) && !self.is_not_null.get_bit(index) - } - + #[inline] fn update_single(&mut self, group_index: usize, value: i128) { - if self.is_overflow(group_index) { Review Comment: 1. It is worth nothing to skip just several integer additions by introduce a quite heavy and low probability branch. 2. In groups accumulator environment, the probability that all groups are overflowed is low. When any groups are overflowed, the branch predictor hit rate of this branch may reduce dramatically. -- 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