akupchinskiy commented on PR #27047:
URL: https://github.com/apache/datafusion/pull/27047#issuecomment-7279223410

   Thanks @alamb! Pushed 766e59a4d6 with the review fixes (replied inline).
   
   I also looked into the benchmark bot regression. `first_last_ignore_nulls` 
and `first_last_many_columns` run about 40 first/last aggregates over a tiny 
table, and each accumulator was building its row converter up front. Now that 
happens on the first batch, which brings it down from +5-6% to about +1% on my 
machine (Graviton4, 5 rounds):
   
   | case | before | now |
   |---|---|---|
   | first_last_ignore_nulls | +6.4% | +1.3% |
   | first_last_many_columns | +5.4% | +0.3% |
   | first_last_one_column (control) | +0.2% | -0.2% |
   
   The remaining ~1% is real, not noise: with batches this small, setting up 
and encoding rows costs slightly more than the `ScalarValue` code it replaces. 
I'd leave it for now; if it matters, it could be fixed later by sharing the 
converter between accumulators or by starting with the `ScalarValue` path for 
small inputs.
   
   The rest still looks good: `first_last_orderings` is 2-21x faster than main, 
the 50M row tests with 1M-5M groups 2-10x, and the `first_last` criterion bench 
is flat.
   


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