zzzxl1993 commented on code in PR #40813:
URL: https://github.com/apache/doris/pull/40813#discussion_r1826521869
##########
be/src/vec/aggregate_functions/aggregate_function.h:
##########
@@ -287,8 +288,14 @@ class IAggregateFunctionHelper : public IAggregateFunction
{
void add_batch_single_place(size_t batch_size, AggregateDataPtr place,
const IColumn** columns,
Arena* arena) const override {
const Derived* derived = assert_cast<const Derived*>(this);
- for (size_t i = 0; i < batch_size; ++i) {
- derived->add(place, columns, i, arena);
+
+ if constexpr (is_aggregate_function_multi_top<Derived>::value ||
+
is_aggregate_function_multi_top_with_null_variadic_inline<Derived>::value) {
+ derived->add_range(place, columns, 0, batch_size, arena);
Review Comment:
Calling add directly on nullable types has poor performance. Using add_range
uniformly can prevent multiple calls.
--
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]