You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "tanmay442 (via GitHub)" <gi...@apache.org> on 2026/10/20 19:16:27 UTC
[PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
tanmay442 opened a new pull request, #26536:
URL: https://github.com/apache/datafusion/pull/26536
## Which issue does this PR close?
- N/A
## Rationale for this change
This is a performance change only. The rows a query returns, the error
messages, the log lines and the row ordering are all unchanged.
`first_value(x ORDER BY y)` and `last_value(x ORDER BY y)` get slow as the
number of groups in the query grows. The grouped accumulator keeps a scoreboard
with one bit per group to record which group already has a winning row in the
current batch (`datafusion/functions-aggregate/src/first_last.rs:414`). At the
end of the batch it tested every one of those bits to find the groups that had
a winner, so the work per batch grew with the number of groups in the query
rather than with the number of groups the batch touched.
The scan was over `total_num_groups` bits per batch. A group-by over a million
groups spends most of its aggregate time in it, even though each input batch
touches only a few thousand groups.
## What changes are included in this PR?
1. `get_filtered_extreme_of_each_group`
(`datafusion/functions-aggregate/src/first_last.rs:586`) collected the
winners by walking the whole winner index array and testing the scoreboard
bit of every group. It now calls `scoreboard_winners`
(`datafusion/functions-aggregate/src/first_last.rs:668`), which reads the
scoreboard a word at a time and takes the trailing zeros of each word. The
scan goes from one bit test per group to one word read per 64 groups, plus
one extraction per group that has a winner.
2. `update_bench_many_groups`
(`datafusion/functions-aggregate/benches/first_last.rs:270`) is a new
criterion case that allocates a million groups and touches a few thousand of
them per batch. The existing cases in this file touch every group in every
batch, so they cannot show this change. The contributor guide suggests a
separate pull request for a new benchmark, and I will split it if that is
preferred.
The numbers come from criterion with interleaved ABBA runs and 20 samples
per side. The intervals are percentile bootstraps over the median difference.
On the new `update_bench_many_groups` benchmark:
| case | before | after | delta | 95% CI |
|---|---|---|---|---|
| `groups=1000000, touched=64`, first_value | 62.73 ms | 16.80 ms | -73.2% | [-73.6%, -73.0%] |
| `groups=1000000, touched=64`, last_value | 63.65 ms | 17.63 ms | -72.3% | [-72.6%, -71.9%] |
| `groups=1000000, touched=8192`, first_value | 91.52 ms | 45.69 ms | -50.1% | [-50.4%, -49.5%] |
| `groups=1000000, touched=8192`, last_value | 91.75 ms | 45.68 ms | -50.2% | [-50.6%, -49.6%] |
The benchmarks that touch every group in the batch are unchanged. Over the
eight update and merge cases the median delta is -1.4%, the range is -3.4% to
+0.6%. The eight `evaluate_bench` cases do not touch the changed code, run at
14 to 17 us, and scatter between -5.6% and +2.7%. The same binary run against
a copy of itself measures +0.02% median, so that scatter is measurement noise.
The saving per batch is proportional to the number of allocated groups and does
not depend on how many groups the batch touches. The bytes read are the same
either way, so this is an instruction-count win and not a memory-traffic win.
### Why the behaviour is unchanged
- The scoreboard reset, the row loop, the comparator and the state updates are
untouched. Only the collection of the winners changed.
- The old code walked the winner index array in order and kept the groups
whose scoreboard bit was set. The new code walks the scoreboard in the same
order and finds the same groups, so both return the winners in ascending
group order.
- The scoreboard is a `BooleanBufferBuilder`, so its bytes are reachable
through `as_slice()`. The bits past the logical length of the scoreboard are
zero, because the scoreboard is rebuilt with `append_n(len, false)` before
each batch, so the scan cannot find a group past the end.
- The result does not depend on the byte order. `u64::from_le_bytes` puts the
first byte in the low bits on every platform, and arrow packs bits least
significant first within a byte, so bit `i` of the scoreboard is bit `i % 64`
of word `i / 64` on every platform.
- The callers update the state per group, so the order of the winners does not
affect the result.
No public API change. `scoreboard_winners` is a private method on a private
struct, and the accumulator gains no field and no allocation.
## What is the testing strategy for this PR?
`cargo test -p datafusion-functions-aggregate --lib` passes, 254 tests, and
`cargo test --profile=ci --test sqllogictests` passes, 535 of 535 test files.
`ci/scripts/rust_fmt.sh` and `ci/scripts/rust_clippy.sh` are clean.
`cargo doc --document-private-items --no-deps -p datafusion-functions-aggregate`
with `RUSTDOCFLAGS="-D warnings"` is clean. `typos` and the `hawkeye` license
header check pass on the two changed files, and
`ci/scripts/check_large_files.sh --base origin/main --head HEAD` passes for
this commit range.
One test is added, `scoreboard_winners_cover_every_word`
(`datafusion/functions-aggregate/src/first_last.rs:3004`). It puts groups at
index 0, 63, 64 and 99,999, so it covers the first word of the scoreboard, the
second word and the last partial word, which holds fewer than 64 groups. It
asserts the winning value of each group after two batches, and that a group
that was never seen stays null. Removing the partial word handling makes the
test fail, so it covers the new code.
The full workspace suite takes about 40 minutes and I did not run it. I have no
query level benchmark for this change yet, so the numbers above are at the
accumulator level.
## Are there any user-facing changes?
No. The winners are collected in the same ascending order as before, so every
query returns the same rows. There is no public API change.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6311269329
These numbers were also run on `522db22`. The follow-up above covers what the current head measures and how to get a paired run for it.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6311268568
These numbers were run on `522db22`, which has since been replaced. The current state, and the measurements that go with it, are in the pull request body above; the paired run follows the benchmark pull request.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6307615237
🤖 Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/26536#issuecomment-6307221599)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB)
Comparing perf/first-last-sparse-group-scoreboard (522db22102ee2cb60b922a3532dadb7b38449be9) to e30aff5 (merge-base) [diff](https://github.com/apache/datafusion/compare/e30aff54957c9e16912f5c1102282e2af146f90e..522db22102ee2cb60b922a3532dadb7b38449be9)
<details><summary>Run configuration</summary>
```yaml
run benchmark first_last
env:
BENCH_FILTER: "^(first_value|last_value) (update_bench|merge_bench)"
```
</details>
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
<details><summary>Details</summary>
<p>
```
group HEAD perf_first-last-sparse-group-scoreboard
----- ---- ---------------------------------------
first_value merge_bench list<i64>[4] nulls=0% 1.01 38.1±0.13ms ? ?/sec 1.00 37.6±0.08ms ? ?/sec
first_value merge_bench list<i64>[4] nulls=90% 1.00 38.3±0.12ms ? ?/sec 1.00 38.1±0.12ms ? ?/sec
first_value merge_bench list<struct(i64,utf8)>[4] nulls=0% 1.00 40.9±0.10ms ? ?/sec 1.00 40.9±0.06ms ? ?/sec
first_value merge_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 41.6±0.12ms ? ?/sec 1.00 41.5±0.08ms ? ?/sec
first_value merge_bench map<utf8,i64> nulls=0% 1.00 40.5±0.09ms ? ?/sec 1.00 40.5±0.20ms ? ?/sec
first_value merge_bench map<utf8,i64> nulls=90% 1.00 41.9±0.08ms ? ?/sec 1.00 41.7±0.12ms ? ?/sec
first_value merge_bench nulls=0%, filter=false 1.00 35.3±0.06ms ? ?/sec 1.00 35.4±0.06ms ? ?/sec
first_value merge_bench nulls=0%, filter=true 1.00 35.4±0.08ms ? ?/sec 1.00 35.5±0.05ms ? ?/sec
first_value merge_bench nulls=90%, filter=false 1.00 37.8±0.07ms ? ?/sec 1.01 38.1±0.06ms ? ?/sec
first_value merge_bench nulls=90%, filter=true 1.00 37.8±0.07ms ? ?/sec 1.01 38.1±0.09ms ? ?/sec
first_value merge_bench struct(i64,utf8,f64) nulls=0% 1.00 40.0±0.10ms ? ?/sec 1.00 40.0±0.12ms ? ?/sec
first_value merge_bench struct(i64,utf8,f64) nulls=90% 1.00 42.3±0.15ms ? ?/sec 1.00 42.2±0.09ms ? ?/sec
first_value update_bench list<i64>[4] nulls=0% 1.01 32.2±0.12ms ? ?/sec 1.00 32.0±0.07ms ? ?/sec
first_value update_bench list<i64>[4] nulls=90% 1.00 32.6±0.10ms ? ?/sec 1.00 32.6±0.08ms ? ?/sec
first_value update_bench list<struct(i64,utf8)>[4] nulls=0% 1.01 35.5±0.11ms ? ?/sec 1.00 35.3±0.16ms ? ?/sec
first_value update_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 36.2±0.10ms ? ?/sec 1.00 36.3±0.10ms ? ?/sec
first_value update_bench map<utf8,i64> nulls=0% 1.00 35.3±0.11ms ? ?/sec 1.00 35.3±0.14ms ? ?/sec
first_value update_bench map<utf8,i64> nulls=90% 1.00 36.6±0.10ms ? ?/sec 1.00 36.6±0.13ms ? ?/sec
first_value update_bench nulls=0%, filter=false 1.00 29.5±0.11ms ? ?/sec 1.01 29.8±0.09ms ? ?/sec
first_value update_bench nulls=0%, filter=true 1.04 46.8±0.18ms ? ?/sec 1.00 45.1±0.12ms ? ?/sec
first_value update_bench nulls=90%, filter=false 1.00 33.9±0.06ms ? ?/sec 1.00 33.8±0.09ms ? ?/sec
first_value update_bench nulls=90%, filter=true 1.03 47.1±0.14ms ? ?/sec 1.00 45.7±0.09ms ? ?/sec
first_value update_bench struct(i64,utf8,f64) nulls=0% 1.00 34.7±0.09ms ? ?/sec 1.00 34.7±0.11ms ? ?/sec
first_value update_bench struct(i64,utf8,f64) nulls=90% 1.00 37.2±0.12ms ? ?/sec 1.00 37.0±0.08ms ? ?/sec
first_value update_bench_many_groups groups=1000000, touched=64 1.00 24.4±0.42ms ? ?/sec
first_value update_bench_many_groups groups=1000000, touched=8192 1.00 48.7±0.40ms ? ?/sec
last_value merge_bench list<i64>[4] nulls=0% 1.01 38.3±0.12ms ? ?/sec 1.00 37.8±0.06ms ? ?/sec
last_value merge_bench list<i64>[4] nulls=90% 1.00 38.7±0.14ms ? ?/sec 1.00 38.6±0.14ms ? ?/sec
last_value merge_bench list<struct(i64,utf8)>[4] nulls=0% 1.01 41.2±0.10ms ? ?/sec 1.00 40.9±0.09ms ? ?/sec
last_value merge_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 41.9±0.10ms ? ?/sec 1.00 41.8±0.11ms ? ?/sec
last_value merge_bench map<utf8,i64> nulls=0% 1.00 40.8±0.11ms ? ?/sec 1.00 40.7±0.11ms ? ?/sec
last_value merge_bench map<utf8,i64> nulls=90% 1.00 42.3±0.10ms ? ?/sec 1.00 42.1±0.17ms ? ?/sec
last_value merge_bench nulls=0%, filter=false 1.00 35.7±0.07ms ? ?/sec 1.01 36.0±0.05ms ? ?/sec
last_value merge_bench nulls=0%, filter=true 1.00 35.9±0.11ms ? ?/sec 1.00 35.9±0.05ms ? ?/sec
last_value merge_bench nulls=90%, filter=false 1.01 47.2±0.12ms ? ?/sec 1.00 46.9±0.13ms ? ?/sec
last_value merge_bench nulls=90%, filter=true 1.01 47.6±0.24ms ? ?/sec 1.00 46.9±0.12ms ? ?/sec
last_value merge_bench struct(i64,utf8,f64) nulls=0% 1.01 40.5±0.10ms ? ?/sec 1.00 40.1±0.14ms ? ?/sec
last_value merge_bench struct(i64,utf8,f64) nulls=90% 1.01 42.7±0.15ms ? ?/sec 1.00 42.4±0.09ms ? ?/sec
last_value update_bench list<i64>[4] nulls=0% 1.00 32.6±0.12ms ? ?/sec 1.03 33.4±0.07ms ? ?/sec
last_value update_bench list<i64>[4] nulls=90% 1.00 33.1±0.16ms ? ?/sec 1.02 33.7±0.08ms ? ?/sec
last_value update_bench list<struct(i64,utf8)>[4] nulls=0% 1.00 35.9±0.11ms ? ?/sec 1.02 36.5±0.06ms ? ?/sec
last_value update_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 36.6±0.10ms ? ?/sec 1.02 37.1±0.09ms ? ?/sec
last_value update_bench map<utf8,i64> nulls=0% 1.00 35.6±0.12ms ? ?/sec 1.01 36.0±0.07ms ? ?/sec
last_value update_bench map<utf8,i64> nulls=90% 1.00 37.0±0.10ms ? ?/sec 1.01 37.5±0.08ms ? ?/sec
last_value update_bench nulls=0%, filter=false 1.01 30.6±0.10ms ? ?/sec 1.00 30.2±0.06ms ? ?/sec
last_value update_bench nulls=0%, filter=true 1.03 46.9±0.10ms ? ?/sec 1.00 45.5±0.09ms ? ?/sec
last_value update_bench nulls=90%, filter=false 1.00 42.2±0.08ms ? ?/sec 1.00 42.1±0.08ms ? ?/sec
last_value update_bench nulls=90%, filter=true 1.04 54.0±0.25ms ? ?/sec 1.00 52.0±0.10ms ? ?/sec
last_value update_bench struct(i64,utf8,f64) nulls=0% 1.00 35.1±0.09ms ? ?/sec 1.02 35.8±0.07ms ? ?/sec
last_value update_bench struct(i64,utf8,f64) nulls=90% 1.00 37.4±0.10ms ? ?/sec 1.01 37.8±0.10ms ? ?/sec
last_value update_bench_many_groups groups=1000000, touched=64 1.00 24.4±0.58ms ? ?/sec
last_value update_bench_many_groups groups=1000000, touched=8192 1.00 48.8±0.42ms ? ?/sec
```
</p>
</details>
<details><summary>Resource Usage</summary>
**first_last — base (merge-base)**
| Metric | Value |
|--------|-------|
| Wall time | 850.2s |
| Peak memory | 64.6 MiB |
| Avg memory | 40.5 MiB |
| CPU user | 744.3s |
| CPU sys | 0.4s |
| Peak spill | 0 B |
**first_last — branch**
| Metric | Value |
|--------|-------|
| Wall time | 910.2s |
| Peak memory | 501.9 MiB |
| Avg memory | 247.3 MiB |
| CPU user | 799.8s |
| CPU sys | 0.7s |
| Peak spill | 0 B |
</details>
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6309260763
@tanmay442 Thank you for working on this.
[The rerun](https://github.com/apache/datafusion/pull/26536#issuecomment-6307856613) reproduced slowdowns in all eight cases: approximately 0.8–3.4%, compared with 1.1–2.5% in the first run. The largest was list<i64>[4] with no nulls: 32.6 → 33.7 ms.
Could you investigate this regression?
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6307783900
🤖 Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/26536#issuecomment-6307737991)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c6307737991-3711-kd7gj 6.12.94+ #1 SMP Fri Aug 21 08:00:16 UTC 2026 aarch64 GNU/Linux`
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
Comparing 522db22102ee2cb60b922a3532dadb7b38449be9 (522db22102ee2cb60b922a3532dadb7b38449be9) to e30aff54957c9e16912f5c1102282e2af146f90e [diff](https://github.com/apache/datafusion/compare/e30aff54957c9e16912f5c1102282e2af146f90e..522db22102ee2cb60b922a3532dadb7b38449be9)
<details><summary>Run configuration</summary>
```yaml
run benchmark first_last
env:
BENCH_FILTER: "^last_value update_bench (list|map|struct)"
baseline:
ref: "e30aff54957c9e16912f5c1102282e2af146f90e"
changed:
ref: "522db22102ee2cb60b922a3532dadb7b38449be9"
```
</details>
Results will be posted here when complete
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6307235103
🤖 Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/26536#issuecomment-6307221599)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c6307221599-3710-b57mh 6.12.94+ #1 SMP Fri Aug 21 08:00:16 UTC 2026 aarch64 GNU/Linux`
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
Comparing perf/first-last-sparse-group-scoreboard (522db22102ee2cb60b922a3532dadb7b38449be9) to e30aff5 (merge-base) [diff](https://github.com/apache/datafusion/compare/e30aff54957c9e16912f5c1102282e2af146f90e..522db22102ee2cb60b922a3532dadb7b38449be9)
<details><summary>Run configuration</summary>
```yaml
run benchmark first_last
env:
BENCH_FILTER: "^(first_value|last_value) (update_bench|merge_bench)"
```
</details>
Results will be posted here when complete
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6302803915
Hi @alamb, this is my first PR to DataFusion, so the workflow runs need a
maintainer/contributor to approve them to start. Could you approve the CI run when you have
a moment? Happy to wait. The same workflows are running on my fork at this
commit:
https://github.com/tanmay442/datafusion/actions/runs/39501484360
Any review(iff any) is welcome. One quick question on thr pr is it good like the description and all , is it easily reviewable and provide appropriate info ?
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6320754442
🤖 Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/26536#issuecomment-6320691868)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c6320691868-3732-s8d29 6.12.94+ #1 SMP Fri Aug 21 08:00:16 UTC 2026 aarch64 GNU/Linux`
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
Comparing 0e0a63c2f35b1fee2122cf3df5d0e75f477f1348 (0e0a63c2f35b1fee2122cf3df5d0e75f477f1348) to f9bc5a3fc60cc7f4319cd2c156cb3d024a8c1b21 [diff](https://github.com/apache/datafusion/compare/f9bc5a3fc60cc7f4319cd2c156cb3d024a8c1b21..0e0a63c2f35b1fee2122cf3df5d0e75f477f1348)
<details><summary>Run configuration</summary>
```yaml
run benchmark first_last
baseline:
ref: "f9bc5a3fc60cc7f4319cd2c156cb3d024a8c1b21"
changed:
ref: "0e0a63c2f35b1fee2122cf3df5d0e75f477f1348"
```
</details>
Results will be posted here when complete
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6312648107
@kumarUjjawal I rewrote the implementation after your run, so the numbers you measured belong to the previous version.
The change is a complete overhaul of the mechanism, not of the scope. The pull request still touches one file. The tournament path now collects its winners from the list of groups the batch touched.
Could you trigger the benchmark runner on this pull request so i can get feedback ? Please run the whole first_last suite. The eight nested last_value update_bench rows then land in the same table as everything else.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6307221599
run benchmark first_last
env:
BENCH_FILTER: '^(first_value|last_value) (update_bench|merge_bench)'
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6307856613
🤖 Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/26536#issuecomment-6307737991)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB)
Comparing 522db22102ee2cb60b922a3532dadb7b38449be9 (522db22102ee2cb60b922a3532dadb7b38449be9) to e30aff54957c9e16912f5c1102282e2af146f90e [diff](https://github.com/apache/datafusion/compare/e30aff54957c9e16912f5c1102282e2af146f90e..522db22102ee2cb60b922a3532dadb7b38449be9)
<details><summary>Run configuration</summary>
```yaml
run benchmark first_last
env:
BENCH_FILTER: "^last_value update_bench (list|map|struct)"
baseline:
ref: "e30aff54957c9e16912f5c1102282e2af146f90e"
changed:
ref: "522db22102ee2cb60b922a3532dadb7b38449be9"
```
</details>
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
<details><summary>Details</summary>
<p>
```
group HEAD perf_first-last-sparse-group-scoreboard
----- ---- ---------------------------------------
last_value update_bench list<i64>[4] nulls=0% 1.00 32.6±0.09ms ? ?/sec 1.03 33.7±0.09ms ? ?/sec
last_value update_bench list<i64>[4] nulls=90% 1.00 33.2±0.12ms ? ?/sec 1.03 34.0±0.08ms ? ?/sec
last_value update_bench list<struct(i64,utf8)>[4] nulls=0% 1.00 35.9±0.10ms ? ?/sec 1.01 36.2±0.09ms ? ?/sec
last_value update_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 36.6±0.09ms ? ?/sec 1.01 37.0±0.07ms ? ?/sec
last_value update_bench map<utf8,i64> nulls=0% 1.00 35.5±0.10ms ? ?/sec 1.02 36.1±0.10ms ? ?/sec
last_value update_bench map<utf8,i64> nulls=90% 1.00 36.9±0.08ms ? ?/sec 1.02 37.5±0.10ms ? ?/sec
last_value update_bench struct(i64,utf8,f64) nulls=0% 1.00 34.6±0.11ms ? ?/sec 1.02 35.3±0.10ms ? ?/sec
last_value update_bench struct(i64,utf8,f64) nulls=90% 1.00 37.4±0.16ms ? ?/sec 1.01 37.9±0.09ms ? ?/sec
```
</p>
</details>
<details><summary>Resource Usage</summary>
**first_last — base (merge-base)**
| Metric | Value |
|--------|-------|
| Wall time | 170.1s |
| Peak memory | 57.8 MiB |
| Avg memory | 32.6 MiB |
| CPU user | 120.2s |
| CPU sys | 0.1s |
| Peak spill | 0 B |
**first_last — branch**
| Metric | Value |
|--------|-------|
| Wall time | 170.0s |
| Peak memory | 60.5 MiB |
| Avg memory | 34.4 MiB |
| CPU user | 121.7s |
| CPU sys | 0.1s |
| Peak spill | 0 B |
</details>
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): read the first/last value scoreboard a word at a time [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6307737991
run benchmark first_last
env:
BENCH_FILTER: '^last_value update_bench (list|map|struct)'
baseline:
ref: e30aff54957c9e16912f5c1102282e2af146f90e
changed:
ref: 522db22102ee2cb60b922a3532dadb7b38449be9
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 closed pull request #26536: perf(aggregate): collect the first/last value winners from the touched groups
URL: https://github.com/apache/datafusion/pull/26536
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6321759764
🤖 Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/26536#issuecomment-6320691868)
**Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB)
Comparing 0e0a63c2f35b1fee2122cf3df5d0e75f477f1348 (0e0a63c2f35b1fee2122cf3df5d0e75f477f1348) to f9bc5a3fc60cc7f4319cd2c156cb3d024a8c1b21 [diff](https://github.com/apache/datafusion/compare/f9bc5a3fc60cc7f4319cd2c156cb3d024a8c1b21..0e0a63c2f35b1fee2122cf3df5d0e75f477f1348)
<details><summary>Run configuration</summary>
```yaml
run benchmark first_last
baseline:
ref: "f9bc5a3fc60cc7f4319cd2c156cb3d024a8c1b21"
changed:
ref: "0e0a63c2f35b1fee2122cf3df5d0e75f477f1348"
```
</details>
<details><summary>CPU Details (lscpu)</summary>
```
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 16
On-line CPU(s) list: 0-15
Vendor ID: ARM
Model name: Neoverse-V2
Model: 1
Thread(s) per core: 1
Core(s) per cluster: 16
Socket(s): -
Cluster(s): 1
Stepping: r0p1
BogoMIPS: 2000.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache: 1 MiB (16 instances)
L1i cache: 1 MiB (16 instances)
L2 cache: 32 MiB (16 instances)
L3 cache: 80 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-15
Vulnerability Gather data sampling: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Mitigation; CSV2, BHB
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Not affected
```
</details>
<details><summary>Details</summary>
<p>
```
group HEAD perf_first-last-sparse-group-scoreboard
----- ---- ---------------------------------------
first_value coalesce_peers(i64,utf8,f64) coalesced struct (winner changes) 1.00 441.2±5.01ms ? ?/sec 1.02 449.7±2.47ms ? ?/sec
first_value coalesce_peers(i64,utf8,f64) coalesced struct (winner stable) 1.00 35.0±0.13ms ? ?/sec 1.04 36.3±0.11ms ? ?/sec
first_value coalesce_peers(i64,utf8,f64) separate x3 (winner changes) 1.00 78.0±0.42ms ? ?/sec 1.08 84.2±0.30ms ? ?/sec
first_value coalesce_peers(i64,utf8,f64) separate x3 (winner stable) 1.00 90.5±0.31ms ? ?/sec 1.03 93.3±0.26ms ? ?/sec
first_value evaluate_bench list<i64>[4] nulls=0%, all 1.00 507.1±6.13µs ? ?/sec 1.00 506.3±5.14µs ? ?/sec
first_value evaluate_bench list<i64>[4] nulls=90%, all 1.01 558.9±8.39µs ? ?/sec 1.00 553.2±7.08µs ? ?/sec
first_value evaluate_bench list<struct(i64,utf8)>[4] nulls=0%, all 1.04 848.3±18.39µs ? ?/sec 1.00 818.3±6.02µs ? ?/sec
first_value evaluate_bench list<struct(i64,utf8)>[4] nulls=90%, all 1.05 854.2±28.25µs ? ?/sec 1.00 815.6±34.03µs ? ?/sec
first_value evaluate_bench map<utf8,i64> nulls=0%, all 1.04 696.2±9.70µs ? ?/sec 1.00 669.9±9.42µs ? ?/sec
first_value evaluate_bench map<utf8,i64> nulls=90%, all 1.00 702.8±48.63µs ? ?/sec 1.05 738.6±37.57µs ? ?/sec
first_value evaluate_bench nulls=0%, filter=false, all 1.00 17.4±1.97µs ? ?/sec 1.19 20.6±3.37µs ? ?/sec
first_value evaluate_bench nulls=0%, filter=false, first(2) 1.00 13.1±1.36µs ? ?/sec 1.07 13.9±1.49µs ? ?/sec
first_value evaluate_bench nulls=0%, filter=true, all 1.00 16.9±1.88µs ? ?/sec 1.10 18.6±3.41µs ? ?/sec
first_value evaluate_bench nulls=0%, filter=true, first(2) 1.00 18.2±2.09µs ? ?/sec 1.02 18.7±2.32µs ? ?/sec
first_value evaluate_bench nulls=90%, filter=false, all 1.00 17.3±1.77µs ? ?/sec 1.00 17.3±2.52µs ? ?/sec
first_value evaluate_bench nulls=90%, filter=false, first(2) 1.06 19.1±2.42µs ? ?/sec 1.00 18.0±1.94µs ? ?/sec
first_value evaluate_bench nulls=90%, filter=true, all 1.00 16.7±1.52µs ? ?/sec 1.10 18.3±3.26µs ? ?/sec
first_value evaluate_bench nulls=90%, filter=true, first(2) 1.05 18.9±2.46µs ? ?/sec 1.00 18.0±2.01µs ? ?/sec
first_value evaluate_bench struct(i64,utf8,f64) nulls=0%, all 1.02 730.3±11.55µs ? ?/sec 1.00 715.3±6.72µs ? ?/sec
first_value evaluate_bench struct(i64,utf8,f64) nulls=90%, all 1.04 1110.8±15.43µs ? ?/sec 1.00 1064.7±48.11µs ? ?/sec
first_value merge_bench list<i64>[4] nulls=0% 1.00 37.9±0.16ms ? ?/sec 1.00 37.8±0.12ms ? ?/sec
first_value merge_bench list<i64>[4] nulls=90% 1.00 38.3±0.12ms ? ?/sec 1.00 38.3±0.17ms ? ?/sec
first_value merge_bench list<struct(i64,utf8)>[4] nulls=0% 1.00 40.7±0.12ms ? ?/sec 1.00 40.9±0.18ms ? ?/sec
first_value merge_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 41.5±0.15ms ? ?/sec 1.01 41.7±0.12ms ? ?/sec
first_value merge_bench map<utf8,i64> nulls=0% 1.00 40.3±0.15ms ? ?/sec 1.01 40.6±0.13ms ? ?/sec
first_value merge_bench map<utf8,i64> nulls=90% 1.00 41.7±0.11ms ? ?/sec 1.01 41.9±0.16ms ? ?/sec
first_value merge_bench nulls=0%, filter=false 1.00 35.7±0.09ms ? ?/sec 1.00 35.6±0.16ms ? ?/sec
first_value merge_bench nulls=0%, filter=true 1.01 35.7±0.07ms ? ?/sec 1.00 35.4±0.14ms ? ?/sec
first_value merge_bench nulls=90%, filter=false 1.00 37.4±0.06ms ? ?/sec 1.02 38.3±0.05ms ? ?/sec
first_value merge_bench nulls=90%, filter=true 1.00 37.4±0.07ms ? ?/sec 1.03 38.4±0.06ms ? ?/sec
first_value merge_bench struct(i64,utf8,f64) nulls=0% 1.00 40.5±0.19ms ? ?/sec 1.00 40.4±0.14ms ? ?/sec
first_value merge_bench struct(i64,utf8,f64) nulls=90% 1.00 42.5±0.15ms ? ?/sec 1.01 42.7±0.14ms ? ?/sec
first_value trivial_update_bench nulls=0%, ignore_nulls=false 1.00 2.6±0.07µs ? ?/sec 1.00 2.6±0.06µs ? ?/sec
first_value trivial_update_bench nulls=0%, ignore_nulls=true 1.00 2.7±0.10µs ? ?/sec 1.00 2.7±0.06µs ? ?/sec
first_value trivial_update_bench nulls=90%, ignore_nulls=false 1.02 3.0±0.20µs ? ?/sec 1.00 2.9±0.13µs ? ?/sec
first_value trivial_update_bench nulls=90%, ignore_nulls=true 1.01 3.6±0.03µs ? ?/sec 1.00 3.6±0.02µs ? ?/sec
first_value update_bench list<i64>[4] nulls=0% 1.00 32.2±0.15ms ? ?/sec 1.04 33.4±0.08ms ? ?/sec
first_value update_bench list<i64>[4] nulls=90% 1.00 32.8±0.13ms ? ?/sec 1.04 34.0±0.12ms ? ?/sec
first_value update_bench list<struct(i64,utf8)>[4] nulls=0% 1.00 35.6±0.15ms ? ?/sec 1.02 36.3±0.15ms ? ?/sec
first_value update_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 36.5±0.13ms ? ?/sec 1.02 37.2±0.12ms ? ?/sec
first_value update_bench map<utf8,i64> nulls=0% 1.00 35.4±0.09ms ? ?/sec 1.02 36.1±0.18ms ? ?/sec
first_value update_bench map<utf8,i64> nulls=90% 1.00 36.8±0.12ms ? ?/sec 1.02 37.5±0.14ms ? ?/sec
first_value update_bench nulls=0%, filter=false 1.00 30.3±0.06ms ? ?/sec 1.01 30.6±0.10ms ? ?/sec
first_value update_bench nulls=0%, filter=true 1.05 47.0±0.08ms ? ?/sec 1.00 44.9±0.14ms ? ?/sec
first_value update_bench nulls=90%, filter=false 1.00 34.1±0.06ms ? ?/sec 1.00 34.0±0.04ms ? ?/sec
first_value update_bench nulls=90%, filter=true 1.02 46.6±0.11ms ? ?/sec 1.00 45.6±0.10ms ? ?/sec
first_value update_bench struct(i64,utf8,f64) nulls=0% 1.00 35.1±0.11ms ? ?/sec 1.03 36.0±0.15ms ? ?/sec
first_value update_bench struct(i64,utf8,f64) nulls=90% 1.00 37.7±0.17ms ? ?/sec 1.01 38.1±0.17ms ? ?/sec
last_value evaluate_bench nulls=0%, filter=false, all 1.00 18.1±2.01µs ? ?/sec 1.02 18.5±3.06µs ? ?/sec
last_value evaluate_bench nulls=0%, filter=false, first(2) 1.02 18.9±2.08µs ? ?/sec 1.00 18.6±2.06µs ? ?/sec
last_value evaluate_bench nulls=0%, filter=true, all 1.00 17.3±2.07µs ? ?/sec 1.00 17.3±2.65µs ? ?/sec
last_value evaluate_bench nulls=0%, filter=true, first(2) 1.03 18.8±2.09µs ? ?/sec 1.00 18.3±1.61µs ? ?/sec
last_value evaluate_bench nulls=90%, filter=false, all 1.00 17.7±1.97µs ? ?/sec 1.01 17.9±2.78µs ? ?/sec
last_value evaluate_bench nulls=90%, filter=false, first(2) 1.03 19.1±1.91µs ? ?/sec 1.00 18.5±1.58µs ? ?/sec
last_value evaluate_bench nulls=90%, filter=true, all 1.00 16.9±1.57µs ? ?/sec 1.04 17.5±2.29µs ? ?/sec
last_value evaluate_bench nulls=90%, filter=true, first(2) 1.00 18.7±2.07µs ? ?/sec 1.01 18.9±2.16µs ? ?/sec
last_value merge_bench list<i64>[4] nulls=0% 1.00 38.3±2.65ms ? ?/sec 1.03 39.4±0.12ms ? ?/sec
last_value merge_bench list<i64>[4] nulls=90% 1.00 38.3±0.11ms ? ?/sec 1.04 39.7±0.17ms ? ?/sec
last_value merge_bench list<struct(i64,utf8)>[4] nulls=0% 1.00 41.0±0.13ms ? ?/sec 1.02 42.0±0.10ms ? ?/sec
last_value merge_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 41.6±0.14ms ? ?/sec 1.03 42.7±0.19ms ? ?/sec
last_value merge_bench map<utf8,i64> nulls=0% 1.00 40.5±0.12ms ? ?/sec 1.03 41.6±0.16ms ? ?/sec
last_value merge_bench map<utf8,i64> nulls=90% 1.00 41.9±0.15ms ? ?/sec 1.03 43.0±0.13ms ? ?/sec
last_value merge_bench nulls=0%, filter=false 1.00 35.9±0.09ms ? ?/sec 1.01 36.5±0.17ms ? ?/sec
last_value merge_bench nulls=0%, filter=true 1.00 36.0±0.10ms ? ?/sec 1.01 36.1±0.11ms ? ?/sec
last_value merge_bench nulls=90%, filter=false 1.00 46.3±0.08ms ? ?/sec 1.01 46.7±0.12ms ? ?/sec
last_value merge_bench nulls=90%, filter=true 1.00 46.7±0.09ms ? ?/sec 1.01 47.0±0.16ms ? ?/sec
last_value merge_bench struct(i64,utf8,f64) nulls=0% 1.00 40.4±0.19ms ? ?/sec 1.03 41.6±0.13ms ? ?/sec
last_value merge_bench struct(i64,utf8,f64) nulls=90% 1.00 42.6±0.11ms ? ?/sec 1.02 43.5±0.19ms ? ?/sec
last_value trivial_update_bench nulls=0%, ignore_nulls=false 1.00 2.6±0.05µs ? ?/sec 1.00 2.6±0.05µs ? ?/sec
last_value trivial_update_bench nulls=0%, ignore_nulls=true 1.00 2.7±0.05µs ? ?/sec 1.01 2.7±0.05µs ? ?/sec
last_value trivial_update_bench nulls=90%, ignore_nulls=false 1.01 3.0±0.03µs ? ?/sec 1.00 2.9±0.03µs ? ?/sec
last_value trivial_update_bench nulls=90%, ignore_nulls=true 1.00 6.7±0.04µs ? ?/sec 1.09 7.3±0.06µs ? ?/sec
last_value update_bench list<i64>[4] nulls=0% 1.00 33.3±0.13ms ? ?/sec 1.00 33.2±0.10ms ? ?/sec
last_value update_bench list<i64>[4] nulls=90% 1.00 33.6±0.10ms ? ?/sec 1.01 34.0±0.15ms ? ?/sec
last_value update_bench list<struct(i64,utf8)>[4] nulls=0% 1.01 36.5±0.13ms ? ?/sec 1.00 36.3±0.10ms ? ?/sec
last_value update_bench list<struct(i64,utf8)>[4] nulls=90% 1.00 37.2±0.12ms ? ?/sec 1.00 37.3±0.15ms ? ?/sec
last_value update_bench map<utf8,i64> nulls=0% 1.00 36.0±0.11ms ? ?/sec 1.00 36.1±0.13ms ? ?/sec
last_value update_bench map<utf8,i64> nulls=90% 1.00 37.5±0.10ms ? ?/sec 1.00 37.6±0.20ms ? ?/sec
last_value update_bench nulls=0%, filter=false 1.01 30.7±0.08ms ? ?/sec 1.00 30.5±0.12ms ? ?/sec
last_value update_bench nulls=0%, filter=true 1.05 47.1±0.08ms ? ?/sec 1.00 44.8±0.09ms ? ?/sec
last_value update_bench nulls=90%, filter=false 1.01 42.3±0.07ms ? ?/sec 1.00 42.0±0.12ms ? ?/sec
last_value update_bench nulls=90%, filter=true 1.02 53.6±0.15ms ? ?/sec 1.00 52.8±0.14ms ? ?/sec
last_value update_bench struct(i64,utf8,f64) nulls=0% 1.00 35.8±0.15ms ? ?/sec 1.00 36.0±0.10ms ? ?/sec
last_value update_bench struct(i64,utf8,f64) nulls=90% 1.00 38.2±0.11ms ? ?/sec 1.00 38.1±0.11ms ? ?/sec
```
</p>
</details>
<details><summary>Resource Usage</summary>
**first_last — base (merge-base)**
| Metric | Value |
|--------|-------|
| Wall time | 1390.3s |
| Peak memory | 2.8 GiB |
| Avg memory | 112.9 MiB |
| CPU user | 1234.8s |
| CPU sys | 9.7s |
| Peak spill | 0 B |
**first_last — branch**
| Metric | Value |
|--------|-------|
| Wall time | 1365.3s |
| Peak memory | 2.8 GiB |
| Avg memory | 115.2 MiB |
| CPU user | 1232.5s |
| CPU sys | 9.6s |
| Peak spill | 0 B |
</details>
---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6311265607
A follow-up, because the numbers moved under me.
The version you measured was replaced. The tournament path now collects its winners from the list of groups the batch touched, the same list the pre-ordered path has used since #25050, so the per-batch sweep is gone rather than made cheaper. The head of this pull request is that version as of the time of writing.
What I can measure locally, on an x86 machine, base and change built from the same benchmark file and compared by criterion:
| case | base | change | delta |
|---|---|---|---|
| `first_value update_bench_many_groups_distinct_batches groups=1000000, touched=64` | 50.76 ms | 4.26 ms | -91.6% |
| `first_value update_bench_many_groups_distinct_batches groups=1000000, touched=8192` | 89.49 ms | 38.52 ms | -57.0% |
| `last_value update_bench_many_groups_distinct_batches groups=1000000, touched=64` | 51.45 ms | 4.29 ms | -91.7% |
| `last_value update_bench_many_groups_distinct_batches groups=1000000, touched=8192` | 96.10 ms | 38.62 ms | -59.9% |
| `first_value update_bench_many_groups_dense groups=100000` | 403.75 ms | 402.81 ms | -0.2%, not significant |
| `last_value update_bench_many_groups_dense groups=100000` | 406.86 ms | 400.85 ms | -1.5% |
The `distinct_batches` cases are the ones to read: each batch owns a disjoint range of groups, so every batch writes the state of every winner, which is the work a query does. The dense case is the other end, where every batch touches every group, and the change is flat there.
What I cannot do from here is the run that would attribute your eight rows, because that needs a baseline that has the benchmark in it, and the benchmark is in a separate pull request. A bench-only null run would settle it: the same library, with the benchmark file as the only difference, so anything that moves on those eight rows is the harness and not the code.
```yaml
run benchmark first_last
baseline:
ref: f9bc5a3fc60cc7f4319cd2c156cb3d024a8c1b21
changed:
ref: perf/first-last-bench-only
env:
BENCH_FILTER: '^last_value update_bench (list|map|struct)'
```
If that shows a spread of the same size, those eight rows are the harness. If it shows them tight, the change does cost something in that shape, and I will profile the two binaries and report back with data.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6322055374
> @tanmay442 can you please not paste the whole llm response its hard to figure out what's important from the wall of text. See https://datafusion.apache.org/contributor-guide/ai-policy.html
@kumarUjjawal
Hey, I am really sorry for the discomfort caused. It was really my neglect, and I shouldn't have done that. I see that these new changes also have no performance gains and only regressions. I agree it is my fault; I just read the code initially and thought of a fix, but I definitely severely underestimated the complexity of the project. And since after the first bench run (which was a degradation) I felt like I had to fix it, which I did not know how to do, so I threw Opus at it, which I shouldn't have done. I take the blame and understand this is a bad practice, truly apologizing for the waste of your time and mental resources. I would like to call it here and close this PR sincerely, and the other one as well, since they serve no purpose to anyone and are honestly slop. As someone who has recently learned the language to a competent enough extent, I thought exploring large codebases should be the next step, but was I wrong . Once again, I apologize and will make sure that I neve
r spam any OSS project ever again. Trully appreciate your patience , thanks
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6310595695
A note on what changing the approach would mean, since I promised it above.
A batch touches at most as many groups as it has rows, so when the group count is below the row count the word-at-a-time scan of the scoreboard is the cheaper path. Choosing between the two would be one comparison at the top of the function rather than a rewrite. Whether that is worth two paths, for a percent or two in one shape against the win in the other, is a call to make with the measurement in hand.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6320757427
@tanmay442 can you please not paste the whole llm response its hard to figure out what's important from the wall of text. See https://datafusion.apache.org/contributor-guide/ai-policy.html
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "tanmay442 (via GitHub)" <gi...@apache.org>.
tanmay442 commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6310356158
> Yes, I am on it, and the head has been rewritten since your runs, so the rows
> in your table belong to an earlier version.
>
> The change replaces the per-batch scoreboard sweep with a list of the groups
> a batch touched. That is the same list the pre-ordered fast path has used
> since #25050, so the general path now carries the bookkeeping that path has
> had all along.
>
> The price shows up in one distribution only, the one where every group is
> touched by every batch. There the per-batch traffic goes up about 2×, 16
> bytes per group instead of the 8 bytes per group that version read. A batch
> is 8,192 rows, so a batch touches at most 8,192 groups, and the touched list
> stays at 64 KB or smaller, in cache, next to thousands of row comparisons.
> The bound follows the batch rather than the group count, so the cost does not
> grow with the size of the group-by.
>
> The distribution the change targets moves the other way. A million groups
> with a batch touching 64 of them went from about 8 MB of traffic per batch to
> about 1 KB, roughly 8,000× less. That is the whole reason for the change.
>
> The same eight cases, with the same two binaries, came out between 1.07% and
> 2.45% in the full run and between 0.84% and 3.37% when the runner was asked
> for just those eight, so I am not writing those rows off as noise.
>
> Nobody has a clean measurement of the dense case yet, us included, which is
> why the benchmark goes into its own pull request first, #26554. It adds
> `update_bench_many_groups_dense`, a dense case at 100,000 groups, so the
> number comes from the project runner rather than from my laptop. If the
> runner shows a regression on the dense case, I will report it and change the
> approach.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf(aggregate): collect the first/last value winners from the touched groups [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on PR #26536:
URL: https://github.com/apache/datafusion/pull/26536#issuecomment-6320691868
run benchmark first_last
baseline:
ref: f9bc5a3fc60cc7f4319cd2c156cb3d024a8c1b21
changed:
ref: 0e0a63c2f35b1fee2122cf3df5d0e75f477f1348
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org