Skip to content

perf: Reduce record batch memory accounting overhead - #24319

Open
ryux1 wants to merge 3 commits into
apache:mainfrom
ryux1:perf/batch-memory-accounting
Open

perf: Reduce record batch memory accounting overhead#24319
ryux1 wants to merge 3 commits into
apache:mainfrom
ryux1:perf/batch-memory-accounting

Conversation

@ryux1

@ryux1 ryux1 commented Aug 13, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

Record batch memory accounting runs on hot execution paths. The current implementation materializes ArrayData for every array and allocates a hash set even for small batches, adding measurable overhead to queries that frequently update memory reservations.

What changes are included in this PR?

  • Traverse Arrow arrays directly and recursively count their backing buffers without materializing ArrayData.
  • Track the first 16 buffer identities inline, then promote to a hash set for wider batches or counters spanning many batches.
  • Preserve shared-buffer deduplication and full buffer-capacity accounting semantics.
  • Add parity coverage against the previous ArrayData traversal for primitive, binary/view, list/view, fixed-size, struct, union, dictionary, map, and all legal run-end index layouts.
  • Add a focused Criterion benchmark across column counts, row counts, and primitive/list/struct layouts.

Criterion point estimates from cargo bench -p datafusion-common --bench record_batch_memory, measured sequentially on upstream main and this PR on the same machine:

Column count (8,192 rows, Int64)

Columns main this PR Speedup
1 81.999 ns 10.645 ns 7.70x
4 308.11 ns 38.669 ns 7.97x
16 1.2543 us 173.55 ns 7.23x
64 4.7457 us 1.3914 us 3.41x

Row count (4 Int64 columns)

Rows main this PR Speedup
1 299.20 ns 39.939 ns 7.49x
128 302.99 ns 38.914 ns 7.79x
8,192 307.64 ns 39.740 ns 7.74x
65,536 310.61 ns 38.994 ns 7.97x

Array layout (4 columns, 8,192 rows)

Layout main this PR Speedup
Primitive Int64 311.01 ns 40.140 ns 7.75x
List of Int64 778.29 ns 82.865 ns 9.39x
Struct of two Int64 fields 1.0072 us 113.70 ns 8.86x

Each list row contains two Int64 values. Each struct column contains two Int64 child fields.

Are these changes tested?

Yes.

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test -p datafusion-common utils::memory --lib (10 passed)
  • RUST_BACKTRACE=1 cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-cli --workspace --lib --tests --bins --features avro,json,backtrace,extended_tests,recursive_protection,parquet_encryption
  • Focused Criterion comparison shown above

Are there any user-facing changes?

No API or behavior changes. This reduces CPU and allocation overhead in record batch memory accounting.

AI assistance: OpenAI Codex assisted with implementation and test execution. I reviewed the change and its behavior end to end.

@github-actions github-actions Bot added the common Related to common crate label Aug 13, 2026
@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.94366% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.18%. Comparing base (8c099dc) to head (db959c3).
⚠️ Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/common/src/utils/memory.rs 98.94% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24319      +/-   ##
==========================================
+ Coverage   81.13%   81.18%   +0.04%     
==========================================
  Files        1112     1109       -3     
  Lines      388220   388301      +81     
  Branches   388220   388301      +81     
==========================================
+ Hits       314985   315240     +255     
+ Misses      54696    54516     -180     
- Partials    18539    18545       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ryux1
Would be nice to benchmark also different batch sizes and also nested types

ryux1 added 2 commits August 13, 2026 19:39
Extend the microbenchmark across row counts and List/Struct layouts.

Exercise all legal run-end index types in the ArrayData parity test.
@ryux1
ryux1 force-pushed the perf/batch-memory-accounting branch from e584d8b to 890be61 Compare August 13, 2026 18:14
@ryux1

ryux1 commented Aug 13, 2026

Copy link
Copy Markdown
Author

Thanks @comphead — added in 890be61:

  • row-count cases for 1, 128, 8,192, and 65,536 rows with four primitive columns
  • primitive, List<Int64>, and two-field Struct<Int64, Int64> layout cases at 8,192 rows
  • concrete run-end encoded parity cases for all three legal index widths

The updated A/B tables are in the PR description. The row-count cases stay essentially flat as expected for buffer traversal; measured speedups are 7.49–7.97x for four primitive columns, 9.39x for lists, and 8.86x for structs.

cargo fmt, workspace Clippy with all targets/features, the focused memory tests, the full extended workspace test command, and the expanded Criterion benchmark all pass locally. Ready for another look.

@alamb

alamb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Thanks @ryux1 -- I'll check it out shortly

@alamb

alamb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

run benchmark window_query_sql

1 similar comment
@alamb

alamb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

run benchmark window_query_sql

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5286431070-1589-8dnfx 6.12.85+ #1 SMP Wed Jun 17 20:31:55 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing perf/batch-memory-accounting (890be61) to 8c099dc (merge-base) diff

Run configuration
run benchmark window_query_sql

Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5286433070-1590-l26gz 6.12.85+ #1 SMP Wed Jun 17 20:31:55 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing perf/batch-memory-accounting (890be61) to 8c099dc (merge-base) diff

Run configuration
run benchmark window_query_sql

Results will be posted here when complete


File an issue against this benchmark runner

Comment thread datafusion/common/src/utils/memory.rs
Clarify that the 16-entry threshold avoids allocations for small
buffer sets while bounding inline storage and linear lookup. The
threshold is a performance heuristic rather than a semantic limit.
@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

Comparing perf/batch-memory-accounting (890be61) to 8c099dc (merge-base) diff

Run configuration
run benchmark window_query_sql
CPU Details (lscpu)
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

group                                                             HEAD                                   perf_batch-memory-accounting
-----                                                             ----                                   ----------------------------
window empty over, aggregate functions                            1.00     13.5±0.64ms        ? ?/sec    1.10     14.9±0.28ms        ? ?/sec
window empty over, built-in functions                             1.00    167.3±2.42ms        ? ?/sec    1.02    171.4±2.43ms        ? ?/sec
window order by, aggregate functions                              1.01    913.6±6.32ms        ? ?/sec    1.00    907.0±3.46ms        ? ?/sec
window order by, built-in functions                               1.02    856.7±4.62ms        ? ?/sec    1.00    843.4±2.26ms        ? ?/sec
window partition and order by, u64_narrow, aggregate functions    1.00    282.7±1.07ms        ? ?/sec    1.00    282.3±1.19ms        ? ?/sec
window partition and order by, u64_narrow, built-in functions     1.00    203.9±1.06ms        ? ?/sec    1.00    203.0±0.98ms        ? ?/sec
window partition and order by, u64_wide, aggregate functions      1.01   971.1±91.24ms        ? ?/sec    1.00  960.0±114.07ms        ? ?/sec
window partition and order by, u64_wide, built-in functions       1.03  893.6±111.33ms        ? ?/sec    1.00  869.1±129.59ms        ? ?/sec
window partition by, u64_narrow, aggregate functions              1.05     11.4±0.08ms        ? ?/sec    1.00     10.9±0.08ms        ? ?/sec
window partition by, u64_narrow, built-in functions               1.03     42.5±0.48ms        ? ?/sec    1.00     41.1±0.49ms        ? ?/sec
window partition by, u64_wide, aggregate functions                1.06   584.7±83.86ms        ? ?/sec    1.00   550.3±82.97ms        ? ?/sec
window partition by, u64_wide, built-in functions                 1.01   561.4±48.41ms        ? ?/sec    1.00   553.4±52.97ms        ? ?/sec

Resource Usage

window_query_sql — base (merge-base)

Metric Value
Wall time 1405.3s
Peak memory 1.4 GiB
Avg memory 399.4 MiB
CPU user 4246.8s
CPU sys 37.0s
Peak spill 0 B

window_query_sql — branch

Metric Value
Wall time 1415.3s
Peak memory 1.4 GiB
Avg memory 404.9 MiB
CPU user 4147.2s
CPU sys 36.6s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

Comparing perf/batch-memory-accounting (890be61) to 8c099dc (merge-base) diff

Run configuration
run benchmark window_query_sql
CPU Details (lscpu)
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

group                                                             HEAD                                    perf_batch-memory-accounting
-----                                                             ----                                    ----------------------------
window empty over, aggregate functions                            1.10     15.5±0.52ms        ? ?/sec     1.00     14.2±0.65ms        ? ?/sec
window empty over, built-in functions                             1.01    171.7±1.62ms        ? ?/sec     1.00    170.0±1.58ms        ? ?/sec
window order by, aggregate functions                              1.00    914.6±4.17ms        ? ?/sec     1.00    911.5±4.68ms        ? ?/sec
window order by, built-in functions                               1.01    852.1±6.12ms        ? ?/sec     1.00    841.8±4.41ms        ? ?/sec
window partition and order by, u64_narrow, aggregate functions    1.00    281.2±1.44ms        ? ?/sec     1.01    283.5±2.64ms        ? ?/sec
window partition and order by, u64_narrow, built-in functions     1.00    202.3±0.84ms        ? ?/sec     1.01    203.4±0.91ms        ? ?/sec
window partition and order by, u64_wide, aggregate functions      1.01  1008.6±135.12ms        ? ?/sec    1.00  995.0±107.48ms        ? ?/sec
window partition and order by, u64_wide, built-in functions       1.04  950.2±137.09ms        ? ?/sec     1.00  914.3±132.92ms        ? ?/sec
window partition by, u64_narrow, aggregate functions              1.03     11.3±0.14ms        ? ?/sec     1.00     11.0±0.07ms        ? ?/sec
window partition by, u64_narrow, built-in functions               1.00     41.4±0.49ms        ? ?/sec     1.00     41.3±0.38ms        ? ?/sec
window partition by, u64_wide, aggregate functions                1.02  616.1±100.13ms        ? ?/sec     1.00   602.8±81.05ms        ? ?/sec
window partition by, u64_wide, built-in functions                 1.02   582.0±61.06ms        ? ?/sec     1.00   571.7±58.83ms        ? ?/sec

Resource Usage

window_query_sql — base (merge-base)

Metric Value
Wall time 1325.3s
Peak memory 1.4 GiB
Avg memory 437.9 MiB
CPU user 4386.7s
CPU sys 38.8s
Peak spill 0 B

window_query_sql — branch

Metric Value
Wall time 1385.3s
Peak memory 1.5 GiB
Avg memory 406.3 MiB
CPU user 4299.4s
CPU sys 36.4s
Peak spill 0 B

File an issue against this benchmark runner

@alamb

alamb commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Looks like a small but real improvement to me -- thank you @ryux1

@alamb

alamb commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

run benchmarks

@alamb alamb added the performance Make DataFusion faster label Aug 14, 2026
@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5294668724-1599-t7cn2 6.12.85+ #1 SMP Wed Jun 17 20:31:55 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing perf/batch-memory-accounting (db959c3) to 8c099dc (merge-base) diff

Run configuration
run benchmark tpcds

Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5294668724-1598-d9hxt 6.12.85+ #1 SMP Wed Jun 17 20:31:55 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing perf/batch-memory-accounting (db959c3) to 8c099dc (merge-base) diff

Run configuration
run benchmark clickbench_partitioned

Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c5294668724-1600-m8ldf 6.12.85+ #1 SMP Wed Jun 17 20:31:55 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
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

Comparing perf/batch-memory-accounting (db959c3) to 8c099dc (merge-base) diff

Run configuration
run benchmark tpch

Results will be posted here when complete


File an issue against this benchmark runner

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ryux1 and @comphead -- this looks good to me except for the unimplemented! (aka panic). Otherwise I think it is a nice improvement and ready to go

group.finish();
}

criterion_group!(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to keep this benchmark, can you please add some comments explaining what it is testing (specifically the overhead of measuring memory usage in record batches)?

fn count_array_data_memory_size(
array_data: &ArrayData,
counted_buffers: &mut HashSet<NonZero<usize>>,
/// Tracks a small number of buffers inline, avoiding a heap allocation for

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}
}

fn count_buffer_memory_size(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it could be a method on RecordBatchMemoryCounter as it is taking two mut fields from it and updating them (I think it is logically part of that logic). Not required, just a suggestion

total_size,
);
},
_ => unreachable!(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this unreachable? An unreachable results in a panic at runtime

I suggest:

  1. explicitly list out all array types that are not uspported (rather than _ catch all) so it is explict what is not being handled
  2. (probably) implement support for the relevant types (or leave a TODO comment referencing a ticket to support them)


fn count_byte_array_memory_size<T: ByteArrayType>(
array: &arrow::array::GenericByteArray<T>,
counted_buffers: &mut BufferIdSet,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly I think this could be a method on RecordBatchMemoryCounter

count_buffer_memory_size(array.values(), counted_buffers, total_size);
}

fn count_list_array_memory_size<O: arrow::array::OffsetSizeTrait>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list view and byte view arrays also probably need special handling

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

Comparing perf/batch-memory-accounting (db959c3) to 8c099dc (merge-base) diff

Run configuration
run benchmark tpch
CPU Details (lscpu)
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 HEAD and perf_batch-memory-accounting
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃     HEAD ┃ perf_batch-memory-accounting ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 38.22 ms │                     37.58 ms │     no change │
│ QQuery 2  │ 18.89 ms │                     18.99 ms │     no change │
│ QQuery 3  │ 32.91 ms │                     30.26 ms │ +1.09x faster │
│ QQuery 4  │ 17.12 ms │                     17.17 ms │     no change │
│ QQuery 5  │ 39.30 ms │                     36.79 ms │ +1.07x faster │
│ QQuery 6  │ 15.84 ms │                     15.75 ms │     no change │
│ QQuery 7  │ 42.94 ms │                     43.08 ms │     no change │
│ QQuery 8  │ 41.88 ms │                     41.94 ms │     no change │
│ QQuery 9  │ 48.07 ms │                     48.00 ms │     no change │
│ QQuery 10 │ 41.52 ms │                     41.40 ms │     no change │
│ QQuery 11 │ 13.26 ms │                     12.91 ms │     no change │
│ QQuery 12 │ 23.73 ms │                     23.74 ms │     no change │
│ QQuery 13 │ 31.92 ms │                     31.95 ms │     no change │
│ QQuery 14 │ 23.04 ms │                     22.77 ms │     no change │
│ QQuery 15 │ 30.87 ms │                     30.19 ms │     no change │
│ QQuery 16 │ 13.48 ms │                     13.30 ms │     no change │
│ QQuery 17 │ 68.80 ms │                     69.13 ms │     no change │
│ QQuery 18 │ 58.44 ms │                     56.70 ms │     no change │
│ QQuery 19 │ 32.15 ms │                     31.96 ms │     no change │
│ QQuery 20 │ 31.28 ms │                     30.88 ms │     no change │
│ QQuery 21 │ 54.69 ms │                     53.41 ms │     no change │
│ QQuery 22 │ 13.33 ms │                     13.40 ms │     no change │
└───────────┴──────────┴──────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                           ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                           │ 731.70ms │
│ Total Time (perf_batch-memory-accounting)   │ 721.30ms │
│ Average Time (HEAD)                         │  33.26ms │
│ Average Time (perf_batch-memory-accounting) │  32.79ms │
│ Queries Faster                              │        2 │
│ Queries Slower                              │        0 │
│ Queries with No Change                      │       20 │
│ Queries with Failure                        │        0 │
└─────────────────────────────────────────────┴──────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and perf_batch-memory-accounting
--------------------
Benchmark tpch_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                           HEAD ┃   perf_batch-memory-accounting ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │ 38.22 / 39.69 ±1.27 / 41.54 ms │ 37.58 / 38.58 ±1.04 / 40.39 ms │     no change │
│ QQuery 2  │ 18.89 / 19.60 ±0.66 / 20.85 ms │ 18.99 / 19.23 ±0.20 / 19.60 ms │     no change │
│ QQuery 3  │ 32.91 / 33.31 ±0.31 / 33.74 ms │ 30.26 / 31.96 ±1.38 / 33.58 ms │     no change │
│ QQuery 4  │ 17.12 / 17.41 ±0.43 / 18.27 ms │ 17.17 / 17.60 ±0.55 / 18.68 ms │     no change │
│ QQuery 5  │ 39.30 / 40.43 ±1.21 / 42.78 ms │ 36.79 / 39.05 ±2.10 / 42.52 ms │     no change │
│ QQuery 6  │ 15.84 / 16.02 ±0.11 / 16.12 ms │ 15.75 / 16.06 ±0.34 / 16.72 ms │     no change │
│ QQuery 7  │ 42.94 / 45.81 ±1.55 / 47.44 ms │ 43.08 / 45.98 ±2.16 / 49.27 ms │     no change │
│ QQuery 8  │ 41.88 / 42.17 ±0.20 / 42.51 ms │ 41.94 / 42.15 ±0.11 / 42.22 ms │     no change │
│ QQuery 9  │ 48.07 / 49.00 ±0.50 / 49.53 ms │ 48.00 / 49.94 ±1.43 / 52.18 ms │     no change │
│ QQuery 10 │ 41.52 / 42.08 ±0.86 / 43.79 ms │ 41.40 / 42.04 ±0.93 / 43.90 ms │     no change │
│ QQuery 11 │ 13.26 / 14.05 ±0.91 / 15.39 ms │ 12.91 / 13.12 ±0.21 / 13.51 ms │ +1.07x faster │
│ QQuery 12 │ 23.73 / 24.22 ±0.35 / 24.74 ms │ 23.74 / 23.99 ±0.33 / 24.65 ms │     no change │
│ QQuery 13 │ 31.92 / 33.09 ±1.32 / 35.61 ms │ 31.95 / 33.68 ±1.03 / 34.99 ms │     no change │
│ QQuery 14 │ 23.04 / 23.21 ±0.17 / 23.53 ms │ 22.77 / 23.47 ±0.93 / 25.30 ms │     no change │
│ QQuery 15 │ 30.87 / 31.36 ±0.62 / 32.57 ms │ 30.19 / 30.54 ±0.22 / 30.87 ms │     no change │
│ QQuery 16 │ 13.48 / 13.75 ±0.16 / 13.94 ms │ 13.30 / 13.47 ±0.21 / 13.88 ms │     no change │
│ QQuery 17 │ 68.80 / 69.75 ±0.79 / 70.71 ms │ 69.13 / 70.68 ±1.69 / 73.63 ms │     no change │
│ QQuery 18 │ 58.44 / 59.03 ±0.43 / 59.61 ms │ 56.70 / 59.27 ±1.39 / 60.47 ms │     no change │
│ QQuery 19 │ 32.15 / 32.46 ±0.36 / 33.16 ms │ 31.96 / 32.60 ±0.37 / 32.99 ms │     no change │
│ QQuery 20 │ 31.28 / 31.47 ±0.21 / 31.87 ms │ 30.88 / 31.87 ±1.00 / 33.31 ms │     no change │
│ QQuery 21 │ 54.69 / 55.08 ±0.30 / 55.48 ms │ 53.41 / 55.30 ±1.19 / 57.10 ms │     no change │
│ QQuery 22 │ 13.33 / 13.59 ±0.21 / 13.92 ms │ 13.40 / 13.71 ±0.20 / 13.92 ms │     no change │
└───────────┴────────────────────────────────┴────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Benchmark Summary                           ┃          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Total Time (HEAD)                           │ 746.58ms │
│ Total Time (perf_batch-memory-accounting)   │ 744.30ms │
│ Average Time (HEAD)                         │  33.94ms │
│ Average Time (perf_batch-memory-accounting) │  33.83ms │
│ Queries Faster                              │        1 │
│ Queries Slower                              │        0 │
│ Queries with No Change                      │       21 │
│ Queries with Failure                        │        0 │
└─────────────────────────────────────────────┴──────────┘

Resource Usage

tpch — base (merge-base)

Metric Value
Wall time 5.0s
Peak memory 1.2 GiB
Avg memory 527.6 MiB
CPU user 21.4s
CPU sys 1.6s
Peak spill 0 B

tpch — branch

Metric Value
Wall time 5.0s
Peak memory 1.3 GiB
Avg memory 535.7 MiB
CPU user 21.2s
CPU sys 1.6s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

Comparing perf/batch-memory-accounting (db959c3) to 8c099dc (merge-base) diff

Run configuration
run benchmark tpcds
CPU Details (lscpu)
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 HEAD and perf_batch-memory-accounting
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃       HEAD ┃ perf_batch-memory-accounting ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │    5.79 ms │                      6.28 ms │  1.08x slower │
│ QQuery 2  │   80.12 ms │                     80.00 ms │     no change │
│ QQuery 3  │   29.43 ms │                     29.28 ms │     no change │
│ QQuery 4  │  492.80 ms │                    483.96 ms │     no change │
│ QQuery 5  │   55.17 ms │                     52.19 ms │ +1.06x faster │
│ QQuery 6  │   40.11 ms │                     36.09 ms │ +1.11x faster │
│ QQuery 7  │   99.76 ms │                     93.68 ms │ +1.06x faster │
│ QQuery 8  │   39.66 ms │                     36.80 ms │ +1.08x faster │
│ QQuery 9  │   55.72 ms │                     51.46 ms │ +1.08x faster │
│ QQuery 10 │   64.99 ms │                     62.86 ms │     no change │
│ QQuery 11 │  310.97 ms │                    306.75 ms │     no change │
│ QQuery 12 │   29.28 ms │                     29.07 ms │     no change │
│ QQuery 13 │  119.23 ms │                    117.29 ms │     no change │
│ QQuery 14 │  420.50 ms │                    416.71 ms │     no change │
│ QQuery 15 │   57.29 ms │                     68.79 ms │  1.20x slower │
│ QQuery 16 │    6.72 ms │                      7.43 ms │  1.11x slower │
│ QQuery 17 │   80.16 ms │                     84.70 ms │  1.06x slower │
│ QQuery 18 │  122.74 ms │                    131.11 ms │  1.07x slower │
│ QQuery 19 │   41.84 ms │                     42.73 ms │     no change │
│ QQuery 20 │   36.40 ms │                     37.34 ms │     no change │
│ QQuery 21 │   17.32 ms │                     17.99 ms │     no change │
│ QQuery 22 │   62.51 ms │                     66.64 ms │  1.07x slower │
│ QQuery 23 │  346.88 ms │                    341.70 ms │     no change │
│ QQuery 24 │  224.14 ms │                    223.10 ms │     no change │
│ QQuery 25 │  109.56 ms │                    110.39 ms │     no change │
│ QQuery 26 │   58.50 ms │                     57.00 ms │     no change │
│ QQuery 27 │    6.37 ms │                      6.29 ms │     no change │
│ QQuery 28 │   60.51 ms │                     60.06 ms │     no change │
│ QQuery 29 │   97.94 ms │                     97.81 ms │     no change │
│ QQuery 30 │   33.02 ms │                     32.47 ms │     no change │
│ QQuery 31 │  111.69 ms │                    111.24 ms │     no change │
│ QQuery 32 │   20.72 ms │                     20.43 ms │     no change │
│ QQuery 33 │   38.77 ms │                     38.33 ms │     no change │
│ QQuery 34 │   10.80 ms │                     10.05 ms │ +1.07x faster │
│ QQuery 35 │   80.91 ms │                     72.19 ms │ +1.12x faster │
│ QQuery 36 │    6.57 ms │                      6.02 ms │ +1.09x faster │
│ QQuery 37 │    7.60 ms │                      6.92 ms │ +1.10x faster │
│ QQuery 38 │   69.37 ms │                     62.35 ms │ +1.11x faster │
│ QQuery 39 │  104.81 ms │                     90.04 ms │ +1.16x faster │
│ QQuery 40 │   24.98 ms │                     23.34 ms │ +1.07x faster │
│ QQuery 41 │   12.20 ms │                     11.34 ms │ +1.08x faster │
│ QQuery 42 │   25.06 ms │                     23.88 ms │     no change │
│ QQuery 43 │    5.56 ms │                      5.09 ms │ +1.09x faster │
│ QQuery 44 │   10.31 ms │                      9.44 ms │ +1.09x faster │
│ QQuery 45 │   39.12 ms │                     38.83 ms │     no change │
│ QQuery 46 │   12.14 ms │                     11.83 ms │     no change │
│ QQuery 47 │  229.21 ms │                    229.00 ms │     no change │
│ QQuery 48 │   95.45 ms │                     95.97 ms │     no change │
│ QQuery 49 │   76.55 ms │                     81.19 ms │  1.06x slower │
│ QQuery 50 │   59.00 ms │                     60.41 ms │     no change │
│ QQuery 51 │   93.06 ms │                     96.61 ms │     no change │
│ QQuery 52 │   24.15 ms │                     26.28 ms │  1.09x slower │
│ QQuery 53 │   29.30 ms │                     31.33 ms │  1.07x slower │
│ QQuery 54 │   54.58 ms │                     55.27 ms │     no change │
│ QQuery 55 │   23.76 ms │                     24.26 ms │     no change │
│ QQuery 56 │   38.86 ms │                     40.19 ms │     no change │
│ QQuery 57 │  175.36 ms │                    174.94 ms │     no change │
│ QQuery 58 │  113.62 ms │                    112.04 ms │     no change │
│ QQuery 59 │  120.17 ms │                    117.02 ms │     no change │
│ QQuery 60 │   39.17 ms │                     39.54 ms │     no change │
│ QQuery 61 │   12.40 ms │                     12.46 ms │     no change │
│ QQuery 62 │   46.63 ms │                     45.62 ms │     no change │
│ QQuery 63 │   29.56 ms │                     29.28 ms │     no change │
│ QQuery 64 │  406.23 ms │                    405.93 ms │     no change │
│ QQuery 65 │  126.01 ms │                    121.80 ms │     no change │
│ QQuery 66 │   80.58 ms │                     80.56 ms │     no change │
│ QQuery 67 │  242.86 ms │                    240.48 ms │     no change │
│ QQuery 68 │   12.31 ms │                     12.01 ms │     no change │
│ QQuery 69 │   57.82 ms │                     56.38 ms │     no change │
│ QQuery 70 │  106.68 ms │                    106.63 ms │     no change │
│ QQuery 71 │   35.50 ms │                     35.12 ms │     no change │
│ QQuery 72 │ 2009.55 ms │                   1981.57 ms │     no change │
│ QQuery 73 │    9.81 ms │                      9.76 ms │     no change │
│ QQuery 74 │  173.12 ms │                    171.49 ms │     no change │
│ QQuery 75 │  148.54 ms │                    148.45 ms │     no change │
│ QQuery 76 │   35.54 ms │                     34.74 ms │     no change │
│ QQuery 77 │   62.14 ms │                     61.56 ms │     no change │
│ QQuery 78 │  199.53 ms │                    194.25 ms │     no change │
│ QQuery 79 │   66.53 ms │                     66.91 ms │     no change │
│ QQuery 80 │   99.62 ms │                     99.05 ms │     no change │
│ QQuery 81 │   26.40 ms │                     26.27 ms │     no change │
│ QQuery 82 │   16.87 ms │                     16.60 ms │     no change │
│ QQuery 83 │   40.19 ms │                     39.38 ms │     no change │
│ QQuery 84 │   30.28 ms │                     30.20 ms │     no change │
│ QQuery 85 │  106.49 ms │                    105.91 ms │     no change │
│ QQuery 86 │   25.69 ms │                     25.73 ms │     no change │
│ QQuery 87 │   63.03 ms │                     62.12 ms │     no change │
│ QQuery 88 │   65.49 ms │                     62.86 ms │     no change │
│ QQuery 89 │   38.36 ms │                     35.87 ms │ +1.07x faster │
│ QQuery 90 │   18.55 ms │                     17.55 ms │ +1.06x faster │
│ QQuery 91 │   48.40 ms │                     45.99 ms │     no change │
│ QQuery 92 │   32.12 ms │                     29.86 ms │ +1.08x faster │
│ QQuery 93 │   54.39 ms │                     49.96 ms │ +1.09x faster │
│ QQuery 94 │   42.19 ms │                     38.07 ms │ +1.11x faster │
│ QQuery 95 │   85.08 ms │                     81.06 ms │     no change │
│ QQuery 96 │   25.19 ms │                     24.27 ms │     no change │
│ QQuery 97 │   49.66 ms │                     47.20 ms │     no change │
│ QQuery 98 │   48.16 ms │                     43.09 ms │ +1.12x faster │
│ QQuery 99 │   73.32 ms │                     69.84 ms │     no change │
└───────────┴────────────┴──────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Benchmark Summary                           ┃           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ Total Time (HEAD)                           │ 9809.14ms │
│ Total Time (perf_batch-memory-accounting)   │ 9679.24ms │
│ Average Time (HEAD)                         │   99.08ms │
│ Average Time (perf_batch-memory-accounting) │   97.77ms │
│ Queries Faster                              │        21 │
│ Queries Slower                              │         9 │
│ Queries with No Change                      │        69 │
│ Queries with Failure                        │         0 │
└─────────────────────────────────────────────┴───────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and perf_batch-memory-accounting
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃           perf_batch-memory-accounting ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │           5.79 / 6.28 ±0.93 / 8.13 ms │            6.28 / 6.82 ±0.98 / 8.78 ms │  1.09x slower │
│ QQuery 2  │        80.12 / 80.82 ±0.47 / 81.42 ms │         80.00 / 81.33 ±1.19 / 83.51 ms │     no change │
│ QQuery 3  │        29.43 / 29.66 ±0.13 / 29.82 ms │         29.28 / 29.80 ±0.33 / 30.14 ms │     no change │
│ QQuery 4  │    492.80 / 508.19 ±17.79 / 542.61 ms │     483.96 / 514.22 ±20.27 / 543.16 ms │     no change │
│ QQuery 5  │        55.17 / 56.09 ±0.90 / 57.56 ms │         52.19 / 52.55 ±0.38 / 53.28 ms │ +1.07x faster │
│ QQuery 6  │        40.11 / 40.83 ±0.47 / 41.39 ms │         36.09 / 36.50 ±0.28 / 36.89 ms │ +1.12x faster │
│ QQuery 7  │      99.76 / 102.78 ±5.53 / 113.83 ms │        93.68 / 96.28 ±4.22 / 104.68 ms │ +1.07x faster │
│ QQuery 8  │        39.66 / 40.12 ±0.45 / 40.98 ms │         36.80 / 37.33 ±0.51 / 38.08 ms │ +1.07x faster │
│ QQuery 9  │        55.72 / 57.62 ±1.44 / 60.17 ms │         51.46 / 53.56 ±1.14 / 54.61 ms │ +1.08x faster │
│ QQuery 10 │        64.99 / 65.68 ±0.45 / 66.20 ms │         62.86 / 63.13 ±0.19 / 63.46 ms │     no change │
│ QQuery 11 │    310.97 / 343.63 ±21.34 / 378.33 ms │      306.75 / 310.91 ±2.72 / 313.98 ms │ +1.11x faster │
│ QQuery 12 │        29.28 / 29.62 ±0.27 / 30.01 ms │         29.07 / 29.43 ±0.26 / 29.77 ms │     no change │
│ QQuery 13 │     119.23 / 121.04 ±2.39 / 125.72 ms │      117.29 / 118.86 ±1.58 / 121.41 ms │     no change │
│ QQuery 14 │     420.50 / 424.00 ±2.71 / 427.44 ms │     416.71 / 432.43 ±10.88 / 444.99 ms │     no change │
│ QQuery 15 │        57.29 / 58.04 ±0.58 / 58.99 ms │         68.79 / 70.74 ±1.77 / 73.50 ms │  1.22x slower │
│ QQuery 16 │           6.72 / 6.88 ±0.17 / 7.20 ms │            7.43 / 7.57 ±0.09 / 7.68 ms │  1.10x slower │
│ QQuery 17 │        80.16 / 81.95 ±1.91 / 85.48 ms │         84.70 / 87.42 ±2.01 / 89.74 ms │  1.07x slower │
│ QQuery 18 │     122.74 / 123.58 ±0.62 / 124.41 ms │      131.11 / 132.88 ±1.22 / 134.28 ms │  1.08x slower │
│ QQuery 19 │        41.84 / 43.42 ±2.65 / 48.69 ms │         42.73 / 43.08 ±0.30 / 43.62 ms │     no change │
│ QQuery 20 │        36.40 / 36.81 ±0.46 / 37.67 ms │         37.34 / 37.67 ±0.34 / 38.33 ms │     no change │
│ QQuery 21 │        17.32 / 17.67 ±0.26 / 17.99 ms │         17.99 / 18.25 ±0.18 / 18.47 ms │     no change │
│ QQuery 22 │        62.51 / 63.69 ±0.88 / 65.03 ms │         66.64 / 67.87 ±0.76 / 68.74 ms │  1.07x slower │
│ QQuery 23 │     346.88 / 350.86 ±3.12 / 355.72 ms │      341.70 / 347.00 ±4.00 / 350.53 ms │     no change │
│ QQuery 24 │     224.14 / 227.26 ±4.22 / 235.59 ms │      223.10 / 227.41 ±4.93 / 236.99 ms │     no change │
│ QQuery 25 │     109.56 / 112.69 ±4.77 / 122.06 ms │      110.39 / 112.55 ±1.89 / 115.39 ms │     no change │
│ QQuery 26 │        58.50 / 59.33 ±0.66 / 60.12 ms │         57.00 / 57.61 ±0.42 / 58.27 ms │     no change │
│ QQuery 27 │           6.37 / 6.55 ±0.22 / 6.94 ms │            6.29 / 6.43 ±0.17 / 6.76 ms │     no change │
│ QQuery 28 │        60.51 / 61.18 ±0.56 / 62.05 ms │         60.06 / 60.63 ±0.44 / 61.16 ms │     no change │
│ QQuery 29 │      97.94 / 100.49 ±2.68 / 104.63 ms │        97.81 / 99.16 ±1.27 / 101.23 ms │     no change │
│ QQuery 30 │        33.02 / 33.55 ±0.53 / 34.52 ms │         32.47 / 32.91 ±0.35 / 33.38 ms │     no change │
│ QQuery 31 │     111.69 / 113.04 ±0.97 / 114.39 ms │      111.24 / 111.85 ±0.46 / 112.46 ms │     no change │
│ QQuery 32 │        20.72 / 22.58 ±2.98 / 28.52 ms │         20.43 / 20.69 ±0.25 / 21.15 ms │ +1.09x faster │
│ QQuery 33 │        38.77 / 39.68 ±0.85 / 40.78 ms │         38.33 / 38.62 ±0.45 / 39.51 ms │     no change │
│ QQuery 34 │        10.80 / 11.21 ±0.22 / 11.43 ms │         10.05 / 10.25 ±0.15 / 10.44 ms │ +1.09x faster │
│ QQuery 35 │        80.91 / 82.22 ±1.07 / 83.51 ms │         72.19 / 72.70 ±0.48 / 73.56 ms │ +1.13x faster │
│ QQuery 36 │           6.57 / 6.66 ±0.10 / 6.85 ms │            6.02 / 6.13 ±0.18 / 6.50 ms │ +1.09x faster │
│ QQuery 37 │           7.60 / 7.64 ±0.04 / 7.70 ms │            6.92 / 6.97 ±0.04 / 7.01 ms │ +1.10x faster │
│ QQuery 38 │        69.37 / 71.98 ±3.85 / 79.63 ms │         62.35 / 62.95 ±0.71 / 64.30 ms │ +1.14x faster │
│ QQuery 39 │     104.81 / 106.45 ±1.23 / 108.52 ms │         90.04 / 90.98 ±0.64 / 91.72 ms │ +1.17x faster │
│ QQuery 40 │        24.98 / 25.33 ±0.33 / 25.76 ms │         23.34 / 23.75 ±0.24 / 24.10 ms │ +1.07x faster │
│ QQuery 41 │        12.20 / 12.40 ±0.10 / 12.50 ms │         11.34 / 11.51 ±0.22 / 11.94 ms │ +1.08x faster │
│ QQuery 42 │        25.06 / 25.50 ±0.27 / 25.91 ms │         23.88 / 24.24 ±0.30 / 24.70 ms │     no change │
│ QQuery 43 │          5.56 / 7.17 ±1.97 / 10.03 ms │            5.09 / 5.24 ±0.16 / 5.55 ms │ +1.37x faster │
│ QQuery 44 │        10.31 / 10.39 ±0.08 / 10.53 ms │            9.44 / 9.51 ±0.06 / 9.59 ms │ +1.09x faster │
│ QQuery 45 │        39.12 / 41.89 ±2.53 / 46.31 ms │         38.83 / 39.31 ±0.72 / 40.71 ms │ +1.07x faster │
│ QQuery 46 │        12.14 / 12.62 ±0.36 / 13.06 ms │         11.83 / 12.55 ±0.96 / 14.45 ms │     no change │
│ QQuery 47 │     229.21 / 232.41 ±2.39 / 235.25 ms │      229.00 / 236.51 ±6.36 / 244.84 ms │     no change │
│ QQuery 48 │        95.45 / 96.33 ±0.59 / 97.31 ms │         95.97 / 96.60 ±0.48 / 97.39 ms │     no change │
│ QQuery 49 │        76.55 / 77.87 ±1.31 / 80.36 ms │         81.19 / 82.02 ±0.84 / 83.38 ms │  1.05x slower │
│ QQuery 50 │        59.00 / 59.18 ±0.13 / 59.40 ms │         60.41 / 61.51 ±0.66 / 62.18 ms │     no change │
│ QQuery 51 │        93.06 / 95.31 ±2.50 / 99.72 ms │        96.61 / 99.91 ±5.00 / 109.84 ms │     no change │
│ QQuery 52 │        24.15 / 24.51 ±0.31 / 24.91 ms │         26.28 / 27.14 ±0.97 / 29.04 ms │  1.11x slower │
│ QQuery 53 │        29.30 / 29.49 ±0.10 / 29.57 ms │         31.33 / 31.57 ±0.26 / 32.01 ms │  1.07x slower │
│ QQuery 54 │        54.58 / 55.15 ±0.39 / 55.75 ms │         55.27 / 57.27 ±1.46 / 59.07 ms │     no change │
│ QQuery 55 │        23.76 / 23.86 ±0.12 / 24.07 ms │         24.26 / 24.58 ±0.29 / 25.08 ms │     no change │
│ QQuery 56 │        38.86 / 39.73 ±1.20 / 42.12 ms │         40.19 / 40.67 ±0.32 / 41.19 ms │     no change │
│ QQuery 57 │     175.36 / 178.45 ±3.67 / 185.65 ms │      174.94 / 177.59 ±3.72 / 184.79 ms │     no change │
│ QQuery 58 │     113.62 / 114.73 ±0.97 / 116.25 ms │      112.04 / 114.55 ±2.12 / 118.19 ms │     no change │
│ QQuery 59 │     120.17 / 121.36 ±1.07 / 123.21 ms │      117.02 / 117.68 ±0.60 / 118.67 ms │     no change │
│ QQuery 60 │        39.17 / 40.04 ±0.48 / 40.57 ms │         39.54 / 40.18 ±0.81 / 41.57 ms │     no change │
│ QQuery 61 │        12.40 / 12.57 ±0.18 / 12.92 ms │         12.46 / 12.68 ±0.20 / 13.03 ms │     no change │
│ QQuery 62 │        46.63 / 46.94 ±0.22 / 47.23 ms │         45.62 / 46.13 ±0.29 / 46.53 ms │     no change │
│ QQuery 63 │        29.56 / 29.82 ±0.19 / 30.11 ms │         29.28 / 29.48 ±0.15 / 29.72 ms │     no change │
│ QQuery 64 │     406.23 / 411.25 ±3.79 / 417.41 ms │      405.93 / 408.15 ±1.72 / 411.20 ms │     no change │
│ QQuery 65 │     126.01 / 128.53 ±2.85 / 133.65 ms │      121.80 / 124.32 ±1.78 / 127.22 ms │     no change │
│ QQuery 66 │        80.58 / 80.87 ±0.27 / 81.37 ms │         80.56 / 81.21 ±0.50 / 82.01 ms │     no change │
│ QQuery 67 │     242.86 / 246.13 ±3.07 / 251.83 ms │      240.48 / 246.69 ±3.64 / 250.95 ms │     no change │
│ QQuery 68 │        12.31 / 14.76 ±4.17 / 23.06 ms │         12.01 / 13.72 ±2.80 / 19.30 ms │ +1.08x faster │
│ QQuery 69 │        57.82 / 58.08 ±0.23 / 58.49 ms │         56.38 / 57.68 ±0.84 / 59.01 ms │     no change │
│ QQuery 70 │     106.68 / 109.92 ±3.30 / 116.23 ms │      106.63 / 109.18 ±2.00 / 112.09 ms │     no change │
│ QQuery 71 │        35.50 / 39.42 ±4.66 / 48.43 ms │         35.12 / 35.59 ±0.47 / 36.47 ms │ +1.11x faster │
│ QQuery 72 │ 2009.55 / 2167.98 ±82.35 / 2240.72 ms │ 1981.57 / 2151.30 ±130.85 / 2378.83 ms │     no change │
│ QQuery 73 │         9.81 / 10.96 ±1.26 / 13.09 ms │          9.76 / 10.87 ±1.73 / 14.31 ms │     no change │
│ QQuery 74 │     173.12 / 176.64 ±4.00 / 184.39 ms │      171.49 / 174.52 ±3.25 / 180.08 ms │     no change │
│ QQuery 75 │     148.54 / 152.61 ±6.28 / 165.04 ms │      148.45 / 153.65 ±5.27 / 162.22 ms │     no change │
│ QQuery 76 │        35.54 / 35.84 ±0.19 / 36.13 ms │         34.74 / 35.32 ±0.32 / 35.59 ms │     no change │
│ QQuery 77 │        62.14 / 65.77 ±4.36 / 72.57 ms │         61.56 / 61.99 ±0.37 / 62.47 ms │ +1.06x faster │
│ QQuery 78 │     199.53 / 204.61 ±7.19 / 218.84 ms │      194.25 / 198.79 ±3.55 / 205.09 ms │     no change │
│ QQuery 79 │        66.53 / 67.45 ±0.60 / 68.29 ms │         66.91 / 69.13 ±4.05 / 77.22 ms │     no change │
│ QQuery 80 │      99.62 / 100.62 ±0.71 / 101.59 ms │       99.05 / 100.52 ±1.52 / 103.38 ms │     no change │
│ QQuery 81 │        26.40 / 29.55 ±5.16 / 39.85 ms │         26.27 / 26.48 ±0.14 / 26.63 ms │ +1.12x faster │
│ QQuery 82 │        16.87 / 16.96 ±0.07 / 17.07 ms │         16.60 / 16.81 ±0.32 / 17.46 ms │     no change │
│ QQuery 83 │        40.19 / 40.54 ±0.22 / 40.78 ms │         39.38 / 42.78 ±2.88 / 47.62 ms │  1.06x slower │
│ QQuery 84 │        30.28 / 30.43 ±0.11 / 30.62 ms │         30.20 / 30.70 ±0.41 / 31.27 ms │     no change │
│ QQuery 85 │     106.49 / 109.62 ±3.27 / 115.92 ms │      105.91 / 106.76 ±0.66 / 107.94 ms │     no change │
│ QQuery 86 │        25.69 / 26.29 ±0.40 / 26.83 ms │         25.73 / 27.06 ±1.90 / 30.82 ms │     no change │
│ QQuery 87 │        63.03 / 63.71 ±0.62 / 64.82 ms │         62.12 / 64.39 ±1.57 / 66.72 ms │     no change │
│ QQuery 88 │        65.49 / 66.73 ±0.73 / 67.60 ms │         62.86 / 63.52 ±0.39 / 64.08 ms │     no change │
│ QQuery 89 │        38.36 / 40.77 ±2.74 / 45.80 ms │         35.87 / 36.28 ±0.28 / 36.67 ms │ +1.12x faster │
│ QQuery 90 │        18.55 / 18.76 ±0.15 / 18.94 ms │         17.55 / 17.68 ±0.07 / 17.75 ms │ +1.06x faster │
│ QQuery 91 │        48.40 / 49.30 ±0.55 / 49.97 ms │         45.99 / 47.24 ±1.44 / 49.94 ms │     no change │
│ QQuery 92 │        32.12 / 32.58 ±0.41 / 33.29 ms │         29.86 / 30.34 ±0.37 / 30.97 ms │ +1.07x faster │
│ QQuery 93 │        54.39 / 54.91 ±0.38 / 55.54 ms │         49.96 / 50.86 ±0.86 / 52.13 ms │ +1.08x faster │
│ QQuery 94 │        42.19 / 44.33 ±1.71 / 46.56 ms │         38.07 / 38.56 ±0.38 / 39.15 ms │ +1.15x faster │
│ QQuery 95 │        85.08 / 86.87 ±1.96 / 90.25 ms │         81.06 / 82.20 ±1.06 / 83.85 ms │ +1.06x faster │
│ QQuery 96 │        25.19 / 25.31 ±0.09 / 25.43 ms │         24.27 / 24.42 ±0.10 / 24.53 ms │     no change │
│ QQuery 97 │        49.66 / 50.47 ±0.54 / 51.22 ms │         47.20 / 47.66 ±0.48 / 48.50 ms │ +1.06x faster │
│ QQuery 98 │        48.16 / 49.76 ±1.38 / 52.28 ms │         43.09 / 43.49 ±0.22 / 43.74 ms │ +1.14x faster │
│ QQuery 99 │        73.32 / 74.03 ±0.52 / 74.70 ms │         69.84 / 71.10 ±2.26 / 75.61 ms │     no change │
└───────────┴───────────────────────────────────────┴────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                           ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                           │ 10147.19ms │
│ Total Time (perf_batch-memory-accounting)   │ 10016.60ms │
│ Average Time (HEAD)                         │   102.50ms │
│ Average Time (perf_batch-memory-accounting) │   101.18ms │
│ Queries Faster                              │         30 │
│ Queries Slower                              │         10 │
│ Queries with No Change                      │         59 │
│ Queries with Failure                        │          0 │
└─────────────────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 55.0s
Peak memory 2.1 GiB
Avg memory 1.4 GiB
CPU user 228.8s
CPU sys 6.5s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 55.0s
Peak memory 2.1 GiB
Avg memory 1.5 GiB
CPU user 223.7s
CPU sys 6.1s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

Comparing perf/batch-memory-accounting (db959c3) to 8c099dc (merge-base) diff

Run configuration
run benchmark clickbench_partitioned
CPU Details (lscpu)
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 HEAD and perf_batch-memory-accounting
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃       HEAD ┃ perf_batch-memory-accounting ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │    1.24 ms │                      1.24 ms │     no change │
│ QQuery 1  │   11.73 ms │                     12.01 ms │     no change │
│ QQuery 2  │   36.52 ms │                     36.40 ms │     no change │
│ QQuery 3  │   30.92 ms │                     31.09 ms │     no change │
│ QQuery 4  │  223.37 ms │                    227.79 ms │     no change │
│ QQuery 5  │  270.06 ms │                    275.08 ms │     no change │
│ QQuery 6  │    1.30 ms │                      1.31 ms │     no change │
│ QQuery 7  │   13.27 ms │                     13.34 ms │     no change │
│ QQuery 8  │  322.15 ms │                    325.08 ms │     no change │
│ QQuery 9  │  455.56 ms │                    454.93 ms │     no change │
│ QQuery 10 │   69.22 ms │                     69.35 ms │     no change │
│ QQuery 11 │   80.55 ms │                     80.93 ms │     no change │
│ QQuery 12 │  268.53 ms │                    266.51 ms │     no change │
│ QQuery 13 │  363.17 ms │                    362.71 ms │     no change │
│ QQuery 14 │  282.65 ms │                    288.26 ms │     no change │
│ QQuery 15 │  270.46 ms │                    275.02 ms │     no change │
│ QQuery 16 │  611.41 ms │                    621.56 ms │     no change │
│ QQuery 17 │  613.63 ms │                    623.90 ms │     no change │
│ QQuery 18 │ 1252.08 ms │                   1257.39 ms │     no change │
│ QQuery 19 │   27.21 ms │                     27.50 ms │     no change │
│ QQuery 20 │  512.94 ms │                    518.78 ms │     no change │
│ QQuery 21 │  517.68 ms │                    518.14 ms │     no change │
│ QQuery 22 │  984.83 ms │                    984.71 ms │     no change │
│ QQuery 23 │ 3074.57 ms │                   3015.80 ms │     no change │
│ QQuery 24 │   41.10 ms │                     41.13 ms │     no change │
│ QQuery 25 │  110.71 ms │                    109.59 ms │     no change │
│ QQuery 26 │   41.97 ms │                     41.80 ms │     no change │
│ QQuery 27 │  508.73 ms │                    518.88 ms │     no change │
│ QQuery 28 │ 2902.55 ms │                   2882.98 ms │     no change │
│ QQuery 29 │   41.20 ms │                     40.80 ms │     no change │
│ QQuery 30 │  304.30 ms │                    304.75 ms │     no change │
│ QQuery 31 │  282.36 ms │                    279.61 ms │     no change │
│ QQuery 32 │  939.21 ms │                    900.58 ms │     no change │
│ QQuery 33 │ 1468.90 ms │                   1459.77 ms │     no change │
│ QQuery 34 │ 1486.74 ms │                   1477.12 ms │     no change │
│ QQuery 35 │  281.03 ms │                    282.47 ms │     no change │
│ QQuery 36 │   71.08 ms │                     64.35 ms │ +1.10x faster │
│ QQuery 37 │   35.99 ms │                     35.20 ms │     no change │
│ QQuery 38 │   43.02 ms │                     41.07 ms │     no change │
│ QQuery 39 │  144.18 ms │                    132.45 ms │ +1.09x faster │
│ QQuery 40 │   14.72 ms │                     14.59 ms │     no change │
│ QQuery 41 │   13.95 ms │                     13.66 ms │     no change │
│ QQuery 42 │   13.44 ms │                     13.02 ms │     no change │
└───────────┴────────────┴──────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                           ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                           │ 19040.24ms │
│ Total Time (perf_batch-memory-accounting)   │ 18942.64ms │
│ Average Time (HEAD)                         │   442.80ms │
│ Average Time (perf_batch-memory-accounting) │   440.53ms │
│ Queries Faster                              │          2 │
│ Queries Slower                              │          0 │
│ Queries with No Change                      │         41 │
│ Queries with Failure                        │          0 │
└─────────────────────────────────────────────┴────────────┘

Distribution per query (min / mean ±stddev / max):

Comparing HEAD and perf_batch-memory-accounting
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃          perf_batch-memory-accounting ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │          1.24 / 3.89 ±5.24 / 14.38 ms │          1.24 / 3.99 ±5.39 / 14.76 ms │     no change │
│ QQuery 1  │        11.73 / 12.16 ±0.28 / 12.58 ms │        12.01 / 12.22 ±0.14 / 12.42 ms │     no change │
│ QQuery 2  │        36.52 / 36.75 ±0.14 / 36.95 ms │        36.40 / 36.64 ±0.30 / 37.23 ms │     no change │
│ QQuery 3  │        30.92 / 31.34 ±0.62 / 32.58 ms │        31.09 / 31.42 ±0.23 / 31.72 ms │     no change │
│ QQuery 4  │     223.37 / 225.29 ±2.36 / 229.89 ms │     227.79 / 229.18 ±1.09 / 230.92 ms │     no change │
│ QQuery 5  │     270.06 / 273.75 ±2.30 / 276.61 ms │     275.08 / 278.01 ±2.12 / 281.36 ms │     no change │
│ QQuery 6  │           1.30 / 1.45 ±0.22 / 1.88 ms │           1.31 / 1.46 ±0.23 / 1.91 ms │     no change │
│ QQuery 7  │        13.27 / 13.33 ±0.04 / 13.40 ms │        13.34 / 13.42 ±0.07 / 13.56 ms │     no change │
│ QQuery 8  │     322.15 / 326.44 ±2.46 / 329.19 ms │     325.08 / 332.36 ±4.23 / 337.19 ms │     no change │
│ QQuery 9  │     455.56 / 458.36 ±2.47 / 461.34 ms │     454.93 / 461.23 ±4.15 / 467.98 ms │     no change │
│ QQuery 10 │        69.22 / 71.15 ±2.15 / 74.92 ms │        69.35 / 70.34 ±0.77 / 71.51 ms │     no change │
│ QQuery 11 │        80.55 / 82.35 ±1.11 / 83.90 ms │        80.93 / 81.73 ±0.69 / 82.88 ms │     no change │
│ QQuery 12 │     268.53 / 271.97 ±2.50 / 274.75 ms │     266.51 / 274.49 ±9.33 / 292.80 ms │     no change │
│ QQuery 13 │    363.17 / 377.15 ±10.34 / 393.07 ms │    362.71 / 381.15 ±10.91 / 390.10 ms │     no change │
│ QQuery 14 │     282.65 / 286.50 ±4.58 / 295.28 ms │     288.26 / 295.71 ±7.06 / 307.25 ms │     no change │
│ QQuery 15 │    270.46 / 278.24 ±10.37 / 297.49 ms │     275.02 / 277.95 ±1.73 / 279.71 ms │     no change │
│ QQuery 16 │     611.41 / 621.65 ±7.32 / 633.44 ms │     621.56 / 631.15 ±7.98 / 641.27 ms │     no change │
│ QQuery 17 │     613.63 / 625.02 ±8.95 / 637.40 ms │     623.90 / 628.87 ±3.76 / 633.77 ms │     no change │
│ QQuery 18 │ 1252.08 / 1272.05 ±15.87 / 1300.86 ms │ 1257.39 / 1278.71 ±14.00 / 1301.36 ms │     no change │
│ QQuery 19 │        27.21 / 29.50 ±4.01 / 37.51 ms │        27.50 / 28.10 ±0.53 / 28.74 ms │     no change │
│ QQuery 20 │     512.94 / 525.58 ±9.76 / 537.27 ms │     518.78 / 528.41 ±8.98 / 540.80 ms │     no change │
│ QQuery 21 │     517.68 / 521.94 ±3.59 / 527.01 ms │     518.14 / 529.18 ±7.78 / 539.14 ms │     no change │
│ QQuery 22 │    984.83 / 991.41 ±6.80 / 1002.95 ms │  984.71 / 1003.52 ±11.46 / 1018.36 ms │     no change │
│ QQuery 23 │ 3074.57 / 3095.72 ±25.16 / 3136.78 ms │ 3015.80 / 3091.66 ±39.11 / 3123.78 ms │     no change │
│ QQuery 24 │      41.10 / 55.65 ±27.13 / 109.89 ms │      41.13 / 56.87 ±25.90 / 108.30 ms │     no change │
│ QQuery 25 │     110.71 / 112.12 ±0.91 / 113.40 ms │     109.59 / 110.78 ±1.13 / 112.48 ms │     no change │
│ QQuery 26 │        41.97 / 46.54 ±5.42 / 56.89 ms │        41.80 / 45.53 ±4.67 / 54.26 ms │     no change │
│ QQuery 27 │    508.73 / 529.89 ±14.42 / 547.71 ms │    518.88 / 530.28 ±17.63 / 565.43 ms │     no change │
│ QQuery 28 │ 2902.55 / 2926.73 ±23.43 / 2966.61 ms │ 2882.98 / 2912.24 ±26.08 / 2955.73 ms │     no change │
│ QQuery 29 │        41.20 / 45.50 ±6.52 / 58.47 ms │        40.80 / 44.57 ±6.44 / 57.44 ms │     no change │
│ QQuery 30 │     304.30 / 310.29 ±4.74 / 318.34 ms │     304.75 / 311.84 ±6.68 / 323.45 ms │     no change │
│ QQuery 31 │     282.36 / 290.24 ±6.72 / 301.36 ms │    279.61 / 296.36 ±13.28 / 313.84 ms │     no change │
│ QQuery 32 │   939.21 / 965.11 ±25.31 / 1012.14 ms │    900.58 / 951.93 ±28.25 / 987.50 ms │     no change │
│ QQuery 33 │ 1468.90 / 1492.23 ±18.83 / 1526.12 ms │ 1459.77 / 1494.87 ±33.15 / 1553.79 ms │     no change │
│ QQuery 34 │ 1486.74 / 1505.12 ±16.86 / 1532.99 ms │ 1477.12 / 1569.23 ±92.00 / 1693.88 ms │     no change │
│ QQuery 35 │    281.03 / 306.01 ±37.68 / 380.99 ms │    282.47 / 292.61 ±14.74 / 321.76 ms │     no change │
│ QQuery 36 │        71.08 / 79.57 ±7.19 / 90.58 ms │        64.35 / 66.73 ±1.79 / 69.03 ms │ +1.19x faster │
│ QQuery 37 │        35.99 / 38.41 ±3.75 / 45.86 ms │        35.20 / 38.67 ±3.62 / 44.71 ms │     no change │
│ QQuery 38 │        43.02 / 50.18 ±5.47 / 57.13 ms │        41.07 / 47.17 ±6.25 / 57.87 ms │ +1.06x faster │
│ QQuery 39 │     144.18 / 153.24 ±5.96 / 162.99 ms │    132.45 / 152.83 ±11.58 / 164.79 ms │     no change │
│ QQuery 40 │        14.72 / 17.05 ±4.16 / 25.35 ms │        14.59 / 19.84 ±5.75 / 30.31 ms │  1.16x slower │
│ QQuery 41 │        13.95 / 16.36 ±4.26 / 24.87 ms │        13.66 / 16.73 ±3.26 / 21.49 ms │     no change │
│ QQuery 42 │        13.44 / 14.29 ±1.42 / 17.11 ms │        13.02 / 13.31 ±0.18 / 13.57 ms │ +1.07x faster │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                           ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                           │ 19387.55ms │
│ Total Time (perf_batch-memory-accounting)   │ 19473.29ms │
│ Average Time (HEAD)                         │   450.87ms │
│ Average Time (perf_batch-memory-accounting) │   452.87ms │
│ Queries Faster                              │          3 │
│ Queries Slower                              │          1 │
│ Queries with No Change                      │         39 │
│ Queries with Failure                        │          0 │
└─────────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 100.0s
Peak memory 11.3 GiB
Avg memory 4.0 GiB
CPU user 993.6s
CPU sys 70.2s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 100.0s
Peak memory 11.1 GiB
Avg memory 4.6 GiB
CPU user 990.0s
CPU sys 73.5s
Peak spill 0 B

File an issue against this benchmark runner

@comphead comphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to consider adding a bench that reuses a RecordBatchMemoryCounter across N sliced batches (the shared-buffer case), which is the hash-join build-side workload at datafusion/physical-plan/src/joins/hash_join/exec.rs:2134. That's where the inline-16 fast path matters most.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate performance Make DataFusion faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Significant overhead in datafusion_common::utils::memory::get_record_batch_memory_size

5 participants