yiguolei commented on code in PR #54582:
URL: https://github.com/apache/doris/pull/54582#discussion_r2302593363


##########
be/src/vec/aggregate_functions/aggregate_function_product.h:
##########
@@ -38,14 +38,42 @@ template <PrimitiveType T>
 struct AggregateFunctionProductData {
     typename PrimitiveTypeTraits<T>::ColumnItemType product {};
 
+    void add_impl(typename PrimitiveTypeTraits<T>::ColumnItemType value,
+                  typename PrimitiveTypeTraits<T>::ColumnItemType& 
product_ref) {
+        if constexpr (std::is_integral_v<typename 
PrimitiveTypeTraits<T>::ColumnItemType>) {
+            typename PrimitiveTypeTraits<T>::ColumnItemType new_product;
+            if (__builtin_expect(__builtin_mul_overflow(product_ref, value, 
&new_product), false)) {

Review Comment:
   这个你本地简单测试一下性能,看看加这个if 判断,性能回退多少



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to