theirix commented on code in PR #21383:
URL: https://github.com/apache/datafusion/pull/21383#discussion_r3039127396


##########
datafusion/functions-aggregate/src/first_last.rs:
##########
@@ -831,6 +830,8 @@ pub struct FirstValueAccumulator {
     orderings: Vec<ScalarValue>,
     // Stores the applicable ordering requirement.
     ordering_req: LexOrdering,
+    // derived from `ordering_req`.
+    sort_options: Vec<SortOptions>,

Review Comment:
   I introduced a bench only for `FirstLastGroupsAccumulator` since it has a 
non-trivial buffer improvement in `take_state`. 
   
   Extracting the construction of `sort_options` out of the hot loop can only 
improve performance.  We don't bench mutable `update_batch` and `merge_batch` 
(I have a patch though), which go through `sort_options` usage. Anyway, I added 
benches for `FirstValueAccumulator` and `LastValueAccumulator` for our future 
benefit.



-- 
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