andygrove commented on code in PR #2069: URL: https://github.com/apache/datafusion-comet/pull/2069#discussion_r2267077952
########## native/spark-expr/src/agg_funcs/sum_decimal.rs: ########## @@ -287,24 +287,16 @@ impl SumDecimalGroupsAccumulator { !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 unlikely(self.is_overflow(group_index)) { - // This means there's a overflow in decimal, so we will just skip the rest - // of the computation - return; - } - self.is_empty.set_bit(group_index, false); let (new_sum, is_overflow) = self.sum[group_index].overflowing_add(value); + self.sum[group_index] = new_sum; - if is_overflow || !is_valid_decimal_precision(new_sum, self.precision) { + if unlikely(is_overflow || !is_valid_decimal_precision(new_sum, self.precision)) { Review Comment: Is there an existing benchmark in the repo that you are using? If not, could you add criterion benchmark so that we can see the performance improvement from these changes? -- 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