Skip to content

perf(parquet): count fitting values before scanning def levels - #11997

Merged
etseidl merged 9 commits into
apache:mainfrom
pydantic:perf-byte-budget-precheck
Nov 25, 2026
Merged

etseidl merged 9 commits into
apache:mainfrom
pydantic:perf-byte-budget-precheck

Conversation

@adriangb

@adriangb adriangb commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

ByteBudgetChunker::byte_budget_sub_batch calls chunk_def.value_count(...) before it asks the encoder whether the chunk's values fit the page budget. For nullable columns (Materialized def levels) that call is an O(chunk_size) scan, and it runs on every chunk of every nullable byte-array column, even chunks far below the page limit.

What changes are included in this PR?

The chunker now asks the encoder first, about the next chunk_size values. That window always contains the chunk's values as a prefix, because a chunk holds at most chunk_size values.

count_values_within_byte_budget[_gather] counts how many leading values fit, so its answer for the window also answers for the chunk:

  • The whole window fits: the chunk fits too. Return None without scanning def levels. This is the common case, and it uses the existing stage-1 bounds. Those cost O(1) for view arrays and one ordered pass over the indices for offset arrays.
  • The count stops at k, the first value that overflows: only now run value_count. If k >= vals_in_chunk the overflow is past this chunk, so the chunk fits. Otherwise k is the same answer the current code computes.

The lookahead is used only on the gather path (value_indices), which the arrow writer always uses, because every gather index names a real value. A contiguous values slice from a raw ColumnWriter caller may be padded with placeholder ByteArrays past the values its levels reference, and those can't be sized. That path keeps counting the chunk's values first, as on main.

There are no new trait methods. An earlier revision of this PR added a byte-array-only values_fit_within_byte_budget_gather hook to ColumnValueEncoder. This version reuses the existing count instead, and benchmarked the same.

Are these changes tested?

New unit tests in byte_budget_chunker call pick_sub_batch directly, through both the contiguous and the gather entry points:

  • a small chunk is not split;
  • an overflow past the chunk, inside the lookahead window, does not split it;
  • an overflow inside the chunk splits it, with the same Levels window as on main;
  • an all-null chunk is not split;
  • a contiguous slice padded with placeholder values past the chunk is never read (test_write_statistics_not_arrow in tests/geospatial.rs caught this in CI).

They pass on main as well, so they pin the behaviour to main's. The second test fails if the k >= vals_in_chunk check is removed. The existing writer and page-size tests also pass.

Benchmarks: arrow_writer, /default props, on a quiet GCE c3-standard-8. Each variant ran twice, interleaved, and the numbers below are the two runs:

case main this PR
byte_array_sparse_99pct_null 10.6 / 10.7 ms 9.3 / 9.3 ms (−13%)
string_and_binary_view 52.9 / 52.6 ms 51.7 / 51.5 ms
string 150.9 / 152.9 ms 149.6 / 149.5 ms
string_dictionary 74.4 / 74.4 ms 73.8 / 73.6 ms
string_ree_95pct_null 31.3 / 31.2 ms 31.1 / 30.9 ms
string_non_null 176.4 / 179.7 ms 175.7 / 176.0 ms
large_string_non_null 58.1 / 58.0 ms 58.1 / 57.9 ms
list_string_ree 137.7 / 137.6 ms 138.9 / 138.9 ms

Every case except the sparse one is within noise. perf on byte_array_sparse_99pct_null: byte_budget_sub_batch (with the inlined def-level scan) drops from 10.2% to 0.6% of samples, and count_values_within_byte_budget_gather rises from 0.9% to 1.6%.

Are there any user-facing changes?

No.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the parquet parquet crate label Oct 30, 2026
@adriangb

Copy link
Copy Markdown
Contributor Author

run benchmark arrow_writer

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: arrow_writer

Sharding factor: 1 (1 workers).

Comparing perf-byte-budget-precheck (3928536) to 9ffd63d (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangb
adriangb force-pushed the perf-byte-budget-precheck branch from 3928536 to f17e631 Compare October 30, 2026 02:34
@adriangb adriangb changed the title perf(parquet): skip def-level scan when a chunk's bytes plainly fit perf(parquet): count fitting values before scanning def levels Oct 30, 2026
@adriangb

Copy link
Copy Markdown
Contributor Author

run benchmark arrow_writer

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: arrow_writer

Sharding factor: 1 (1 workers).

Comparing perf-byte-budget-precheck (f17e631) to 9ffd63d (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 1

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangb

Copy link
Copy Markdown
Contributor Author

run benchmark arrow_writer
shards: 4

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark failed or incomplete (GKE) | trigger

Target: arrow_writer

Comparing perf-byte-budget-precheck (3928536) to 9ffd63d (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 1
Errors / missing shards
arrow_writer — shard 1/1: Benchmark for [this request](https://github.com/apache/arrow-rs/pull/11997#issuecomment-6512736651) hit the 7200s job deadline before finishing.

Benchmarks requested: `arrow_writer`

<details><summary>Kubernetes message</summary>

```
Job was active longer than specified deadline
```

</details>

---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
Per-runner information
arrow_writer — shard 1/1

Node: gk3-benchmark-cluster-nap-1fzug0kq-50073869-jzxw

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

uname:

Linux bench-c6512736651-4131-k6w5t 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

No completed measurement resource samples.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: arrow_writer

Sharding factor: 4 (4 workers).

Comparing perf-byte-budget-precheck (318bf4c) to 9ffd63d (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark failed or incomplete (GKE) | trigger

Target: arrow_writer

Comparing perf-byte-budget-precheck (f17e631) to 9ffd63d (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 1
Errors / missing shards
arrow_writer — shard 1/1: Benchmark for [this request](https://github.com/apache/arrow-rs/pull/11997#issuecomment-6513550211) hit the 7200s job deadline before finishing.

Benchmarks requested: `arrow_writer`

<details><summary>Kubernetes message</summary>

```
Job was active longer than specified deadline
```

</details>

---
[File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
Per-runner information
arrow_writer — shard 1/1

Node: gk3-benchmark-cluster-nap-6uf8krqf-51bf6dd9-z9n6

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

uname:

Linux bench-c6513550211-4132-pq5j2 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

No completed measurement resource samples.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: arrow_writer

Comparing perf-byte-budget-precheck (318bf4c) to 9ffd63d (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Comparison results: View the complete native critcmp output.

The comparison is published in an unlisted Gist because the original inline report exceeded GitHub's comment limit.

Per-runner information
arrow_writer — shard 1/4

Node: gk3-benchmark-cluster-nap-jeel64w1-66f44736-l628

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

uname:

Linux bench-c6513830333-4137-ccmpb 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1745.4s
Peak memory 2.1 GiB
Avg memory 196.1 MiB
CPU user 1708.6s
CPU sys 31.5s
Peak spill 0 B

branch

Metric Value
Wall time 1745.4s
Peak memory 1.9 GiB
Avg memory 193.9 MiB
CPU user 1705.9s
CPU sys 33.2s
Peak spill 0 B
arrow_writer — shard 2/4

Node: gk3-benchmark-cluster-nap-1fzug0kq-50073869-h5nx

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

uname:

Linux bench-c6513830333-4138-pksqp 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1780.4s
Peak memory 2.2 GiB
Avg memory 352.9 MiB
CPU user 1724.6s
CPU sys 53.5s
Peak spill 0 B

branch

Metric Value
Wall time 1805.4s
Peak memory 2.2 GiB
Avg memory 346.0 MiB
CPU user 1748.4s
CPU sys 50.7s
Peak spill 0 B
arrow_writer — shard 3/4

Node: gk3-benchmark-cluster-nap-6uf8krqf-51bf6dd9-z9n6

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

uname:

Linux bench-c6513830333-4139-cnjns 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1925.4s
Peak memory 2.1 GiB
Avg memory 288.7 MiB
CPU user 1877.7s
CPU sys 41.7s
Peak spill 0 B

branch

Metric Value
Wall time 1905.4s
Peak memory 2.1 GiB
Avg memory 286.1 MiB
CPU user 1861.4s
CPU sys 37.9s
Peak spill 0 B
arrow_writer — shard 4/4

Node: gk3-benchmark-cluster-nap-1fzug0kq-c69560ca-b6ps

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

uname:

Linux bench-c6513830333-4140-b5bn4 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1765.4s
Peak memory 2.0 GiB
Avg memory 224.7 MiB
CPU user 1729.3s
CPU sys 30.7s
Peak spill 0 B

branch

Metric Value
Wall time 1740.4s
Peak memory 2.0 GiB
Avg memory 224.4 MiB
CPU user 1707.2s
CPU sys 28.8s
Peak spill 0 B

File an issue against this benchmark runner

@adriangb
adriangb force-pushed the perf-byte-budget-precheck branch from 193e106 to bf51fa4 Compare November 3, 2026 02:55
@adriangb
adriangb marked this pull request as ready for review November 3, 2026 04:06
@adriangb

adriangb commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

run benchmark arrow_writer

shards: 4

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: arrow_writer

Sharding factor: 4 (4 workers).

Comparing perf-byte-budget-precheck (bf51fa4) to b231cf1 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: arrow_writer

Comparing perf-byte-budget-precheck (bf51fa4) to b231cf1 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Comparison results: View the complete native critcmp output.

The comparison is published in an unlisted Gist because the original inline report exceeded GitHub's comment limit.

Per-runner information
arrow_writer — shard 1/4

Node: gk3-benchmark-cluster-nap-17yz8u0s-c78dad10-hp78

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

uname:

Linux bench-c6595202522-4291-f4plb 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1740.4s
Peak memory 2.1 GiB
Avg memory 196.0 MiB
CPU user 1706.6s
CPU sys 32.4s
Peak spill 0 B

branch

Metric Value
Wall time 1735.4s
Peak memory 2.1 GiB
Avg memory 195.2 MiB
CPU user 1700.2s
CPU sys 31.9s
Peak spill 0 B
arrow_writer — shard 2/4

Node: gk3-benchmark-cluster-nap-r5b1bsxo-0e1bca2a-sz8x

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

uname:

Linux bench-c6595202522-4292-2m9bl 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1790.4s
Peak memory 2.1 GiB
Avg memory 353.5 MiB
CPU user 1737.3s
CPU sys 49.8s
Peak spill 0 B

branch

Metric Value
Wall time 1790.4s
Peak memory 2.2 GiB
Avg memory 350.3 MiB
CPU user 1736.5s
CPU sys 47.7s
Peak spill 0 B
arrow_writer — shard 3/4

Node: gk3-benchmark-cluster-nap-17yz8u0s-dc2beb66-4t8b

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

uname:

Linux bench-c6595202522-4293-mpwnj 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1905.4s
Peak memory 2.2 GiB
Avg memory 286.7 MiB
CPU user 1861.7s
CPU sys 37.6s
Peak spill 0 B

branch

Metric Value
Wall time 1905.4s
Peak memory 2.3 GiB
Avg memory 287.2 MiB
CPU user 1861.9s
CPU sys 38.4s
Peak spill 0 B
arrow_writer — shard 4/4

Node: gk3-benchmark-cluster-nap-r5b1bsxo-7fe87dcb-5l4n

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

uname:

Linux bench-c6595202522-4294-5nwgb 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1750.4s
Peak memory 1.9 GiB
Avg memory 224.1 MiB
CPU user 1720.1s
CPU sys 27.0s
Peak spill 0 B

branch

Metric Value
Wall time 1735.4s
Peak memory 2.1 GiB
Avg memory 225.8 MiB
CPU user 1706.0s
CPU sys 27.1s
Peak spill 0 B

File an issue against this benchmark runner

@adriangb

adriangb commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@etseidl this should be ready

@etseidl

etseidl commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Thanks @adriangb. Looked good to me 😅, but my agent found a nit.

Review: changes requested

Reviewed head cf99e7ad168dd9c97f1aa2848ddea799c04498f5 against base b231cf15efa5dbbbe4ae8503849aa6ab3cfc4e0c.

P1 - Lookahead can disable page splitting for ListView strings

Location:
byte_budget_chunker.rs:239-244

The larger gather window can contain reordered or repeated child indices from valid ListView arrays. However, the Arrow offset-array encoder's fast estimate assumes increasing indices and bounds payload using only the first and last offsets.

For a window such as [0, 1, ..., 27, 0, ..., 0], that estimate ignores the large values in the middle and reports that everything fits. The new early return then skips necessary sub-batching.

Confirmed with a production ArrowWriter reproducer:

  • Nullable ListView<Utf8>, PLAIN encoding, dictionary disabled.
  • First 1,024 rows: 28 singleton lists referencing children 0..27, then 996 null lists.
  • Next 996 rows: singleton lists referencing child 0.
  • Child 0 is one byte; the other 27 are 256 KiB.
  • Page budget: 16 KiB; write-batch size: 1,024.
Result Base PR head
Data pages 8 2
Maximum page-body size 1,048,604 bytes 7,078,017 bytes

Both files round-trip, but the PR packs all 27 large strings into one page. These are separate singleton records, not one indivisible oversized record.

Scaling those 27 strings to 76 MiB each would produce 2,151,677,952 payload bytes, exceeding the format's signed 32-bit page-size limit. That large-allocation case was not executed.

Why this belongs to this PR: the faulty span assumption predates the change, but the current chunk's indices are increasing and correctly sized on the base. Looking into later chunks introduces the backwards jump and creates this regression:

  • Base sizes [0, 1, ..., 27] and returns 2, including the first overflowing value.
  • PR sizes [0, 1, ..., 27, 0, ..., 0] and incorrectly returns 1,024.
  • The PR therefore skips splitting the current chunk, violating the newly documented prefix contract.

Suggested correction: use the span shortcut only with a proven strictly increasing index sequence; fall back to cumulative sizing for reordered or repeated gathers. Add an Arrow-encoder regression with an increasing current-chunk prefix followed by reordered lookahead. The new tests use the generic slice encoder with identity indices and miss this case.

Reproducer

Save this as parquet/examples/listview_lookahead_repro.rs and run it on each revision:

# On base b231cf15efa5dbbbe4ae8503849aa6ab3cfc4e0c:
cargo run -p parquet --no-default-features --features arrow \
 --example listview_lookahead_repro -- base /tmp/listview-base.parquet

# On PR head cf99e7ad168dd9c97f1aa2848ddea799c04498f5:
cargo run -p parquet --no-default-features --features arrow \
 --example listview_lookahead_repro -- head /tmp/listview-head.parquet

The same source was tested through external Cargo projects using path dependencies on the two checkouts.

use std::{fs::File, sync::Arc};

use arrow_array::{Array, ListArray, ListViewArray, RecordBatch, StringArray};
use arrow_schema::{DataType, Field, Schema};
use parquet::{
   arrow::{ArrowWriter, arrow_reader::ParquetRecordBatchReaderBuilder},
   basic::{Compression, Encoding},
   file::{
       properties::WriterProperties,
       reader::{FileReader, SerializedFileReader},
   },
};

fn main() -> Result<(), Box<dyn std::error::Error>> {
   let args: Vec<String> = std::env::args().collect();
   let label = args.get(1).expect("revision label");
   let output = args.get(2).expect("output parquet path");

   const LARGE_BYTES: usize = 256 * 1024;
   const PAGE_LIMIT: usize = 16 * 1024;
   const BATCH_SIZE: usize = 1024;
   const ROWS: usize = 2020;

   // Child 0 is small; children 1..27 are large.
   let mut strings = vec!["s".to_owned()];
   for idx in 1..28 {
       strings.push(
           char::from(b'A' + (idx - 1) as u8)
               .to_string()
               .repeat(LARGE_BYTES),
       );
   }
   let children = Arc::new(StringArray::from(strings));
   let child_field = Arc::new(Field::new_list_field(DataType::Utf8, false));
   let schema = Arc::new(Schema::new(vec![Field::new(
       "lists",
       DataType::ListView(child_field.clone()),
       true,
   )]));

   // First chunk: children 0..27, then 996 null lists.
   // Later rows: 996 singleton lists referencing child 0.
   let offsets: Vec<i32> = (0..ROWS)
       .map(|row| if row < 28 { row as i32 } else { 0 })
       .collect();
   let validity: Vec<bool> = (0..ROWS)
       .map(|row| row < 28 || row >= BATCH_SIZE)
       .collect();
   let sizes: Vec<i32> = validity.iter().map(|valid| i32::from(*valid)).collect();

   let lists = ListViewArray::new(
       child_field,
       offsets.into(),
       sizes.into(),
       children.clone(),
       Some(validity.into()),
   );
   assert_eq!(lists.null_count(), 996);
   let batch = RecordBatch::try_new(schema.clone(), vec![Arc::new(lists)])?;

   let properties = WriterProperties::builder()
       .set_dictionary_enabled(false)
       .set_encoding(Encoding::PLAIN)
       .set_compression(Compression::UNCOMPRESSED)
       .set_data_page_size_limit(PAGE_LIMIT)
       .set_write_batch_size(BATCH_SIZE)
       .build();

   let mut writer = ArrowWriter::try_new(File::create(output)?, schema, Some(properties))?;
   writer.write(&batch)?;
   writer.close()?;

   println!(
       "revision={label} rows={ROWS} large_values=27 \
        large_value_bytes={LARGE_BYTES} page_limit={PAGE_LIMIT} \
        write_batch_size={BATCH_SIZE}"
   );

   let file_reader = SerializedFileReader::new(File::open(output)?)?;
   assert_eq!(file_reader.num_row_groups(), 1);
   let row_group = file_reader.get_row_group(0)?;
   let mut pages = row_group.get_column_page_reader(0)?;
   let mut page_count = 0;
   let mut max_page_bytes = 0;

   while let Some(page) = pages.get_next_page()? {
       assert!(page.is_data_page(), "dictionary unexpectedly enabled");
       page_count += 1;
       max_page_bytes = max_page_bytes.max(page.buffer().len());
       println!(
           "page={page_count} level_values={} body_bytes={}",
           page.num_values(),
           page.buffer().len(),
       );
   }

   println!(
       "summary data_pages={page_count} max_page_body_bytes={max_page_bytes}"
   );

   // Check every row's validity, singleton-list length, and string contents.
   let reader = ParquetRecordBatchReaderBuilder::try_new(File::open(output)?)?
       .with_batch_size(BATCH_SIZE)
       .build()?;
   let mut row = 0;

   for decoded in reader {
       let decoded = decoded?;
       let array = decoded.column(0);
       for local in 0..decoded.num_rows() {
           let expected_valid = row < 28 || row >= BATCH_SIZE;
           assert_eq!(!array.is_null(local), expected_valid, "row {row} validity");

           if expected_valid {
               let child = if let Some(lists) = array.as_any().downcast_ref::<ListArray>() {
                   lists.value(local)
               } else if let Some(lists) = array.as_any().downcast_ref::<ListViewArray>() {
                   lists.value(local)
               } else {
                   panic!("unexpected decoded type {:?}", array.data_type());
               };

               assert_eq!(child.len(), 1, "row {row} list length");
               let string = child.as_any().downcast_ref::<StringArray>().unwrap();
               let expected_idx = if row < 28 { row } else { 0 };
               assert_eq!(
                   string.value(0),
                   children.value(expected_idx),
                   "row {row} child value",
               );
           }
           row += 1;
       }
   }

   assert_eq!(row, ROWS);
   println!("roundtrip=OK checked_rows={row}");
   Ok(())
}

Observed page-body sizes:

Base:
page=1 level_values=4 body_bytes=786461
page=2 level_values=4 body_bytes=1048604
page=3 level_values=4 body_bytes=1048604
page=4 level_values=4 body_bytes=1048604
page=5 level_values=4 body_bytes=1048604
page=6 level_values=4 body_bytes=1048604
page=7 level_values=4 body_bytes=1048604
page=8 level_values=1992 body_bytes=4997
summary data_pages=8 max_page_body_bytes=1048604
roundtrip=OK checked_rows=2020

PR head:
page=1 level_values=1024 body_bytes=7078017
page=2 level_values=996 body_bytes=4994
summary data_pages=2 max_page_body_bytes=7078017
roundtrip=OK checked_rows=2020

@adriangb
adriangb force-pushed the perf-byte-budget-precheck branch from cf99e7a to b0057f7 Compare November 4, 2026 22:05
@adriangb

adriangb commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

run benchmark arrow_writer

shards: 4

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: arrow_writer

Sharding factor: 4 (4 workers).

Comparing perf-byte-budget-precheck (b0057f7) to b231cf1 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: arrow_writer

Comparing perf-byte-budget-precheck (b0057f7) to b231cf1 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Comparison results: View the complete native critcmp output.

The comparison is published in an unlisted Gist because the original inline report exceeded GitHub's comment limit.

Per-runner information
arrow_writer — shard 1/4

Node: gk3-benchmark-cluster-nap-1hv4dsl5-32a87493-vc7t

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

uname:

Linux bench-c6729637935-4663-wst2s 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1755.4s
Peak memory 1.9 GiB
Avg memory 196.6 MiB
CPU user 1720.2s
CPU sys 33.0s
Peak spill 0 B

branch

Metric Value
Wall time 1745.4s
Peak memory 2.1 GiB
Avg memory 193.9 MiB
CPU user 1707.4s
CPU sys 32.7s
Peak spill 0 B
arrow_writer — shard 2/4

Node: gk3-benchmark-cluster-nap-1hv4dsl5-32a87493-p9c2

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

uname:

Linux bench-c6729637935-4664-nmznr 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1785.4s
Peak memory 2.2 GiB
Avg memory 342.0 MiB
CPU user 1736.5s
CPU sys 46.7s
Peak spill 0 B

branch

Metric Value
Wall time 1805.4s
Peak memory 2.2 GiB
Avg memory 344.7 MiB
CPU user 1751.0s
CPU sys 49.2s
Peak spill 0 B
arrow_writer — shard 3/4

Node: gk3-benchmark-cluster-nap-1hv4dsl5-32a87493-ch7t

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

uname:

Linux bench-c6729637935-4665-275qz 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1920.4s
Peak memory 2.2 GiB
Avg memory 291.9 MiB
CPU user 1873.1s
CPU sys 44.1s
Peak spill 0 B

branch

Metric Value
Wall time 1915.4s
Peak memory 2.2 GiB
Avg memory 288.8 MiB
CPU user 1872.1s
CPU sys 41.1s
Peak spill 0 B
arrow_writer — shard 4/4

Node: gk3-benchmark-cluster-nap-tnpun609-97f5d8c7-45p8

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

uname:

Linux bench-c6729637935-4666-bkqhk 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1770.4s
Peak memory 2.0 GiB
Avg memory 226.0 MiB
CPU user 1737.0s
CPU sys 31.1s
Peak spill 0 B

branch

Metric Value
Wall time 1790.4s
Peak memory 2.0 GiB
Avg memory 225.6 MiB
CPU user 1757.1s
CPU sys 31.0s
Peak spill 0 B

File an issue against this benchmark runner

@adriangb

adriangb commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@etseidl fixed #11997 (comment) in 6fb0f2e

@adriangb

adriangb commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

run benchmark arrow_writer

shards: 4

1 similar comment
@adriangb

adriangb commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

run benchmark arrow_writer

shards: 4

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: arrow_writer

Sharding factor: 4 (4 workers).

Comparing perf-byte-budget-precheck (b0057f7) to b231cf1 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: arrow_writer

Sharding factor: 4 (4 workers).

Comparing perf-byte-budget-precheck (b0057f7) to b231cf1 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Results will be posted when all workers finish.


File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: arrow_writer

Comparing perf-byte-budget-precheck (b0057f7) to b231cf1 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Comparison results: View the complete native critcmp output.

The comparison is published in an unlisted Gist because the original inline report exceeded GitHub's comment limit.

Per-runner information
arrow_writer — shard 1/4

Node: gk3-benchmark-cluster-nap-1r3q3rn9-5591cf25-2wgf

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

uname:

Linux bench-c6742183341-4672-5jv4j 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1740.4s
Peak memory 2.1 GiB
Avg memory 195.7 MiB
CPU user 1706.8s
CPU sys 29.3s
Peak spill 0 B

branch

Metric Value
Wall time 1740.4s
Peak memory 2.0 GiB
Avg memory 195.2 MiB
CPU user 1706.9s
CPU sys 30.2s
Peak spill 0 B
arrow_writer — shard 2/4

Node: gk3-benchmark-cluster-nap-1r3q3rn9-48c03b01-kcmn

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

uname:

Linux bench-c6742183341-4673-92bbj 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1805.4s
Peak memory 2.2 GiB
Avg memory 342.0 MiB
CPU user 1756.3s
CPU sys 45.8s
Peak spill 0 B

branch

Metric Value
Wall time 1795.4s
Peak memory 2.1 GiB
Avg memory 346.1 MiB
CPU user 1744.2s
CPU sys 46.0s
Peak spill 0 B
arrow_writer — shard 3/4

Node: gk3-benchmark-cluster-nap-1r3q3rn9-48c03b01-phjt

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

uname:

Linux bench-c6742183341-4674-6kkpb 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1915.4s
Peak memory 2.3 GiB
Avg memory 287.2 MiB
CPU user 1867.2s
CPU sys 42.1s
Peak spill 0 B

branch

Metric Value
Wall time 1905.4s
Peak memory 2.1 GiB
Avg memory 286.0 MiB
CPU user 1860.6s
CPU sys 41.6s
Peak spill 0 B
arrow_writer — shard 4/4

Node: gk3-benchmark-cluster-nap-1r3q3rn9-063541a9-vh7j

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

uname:

Linux bench-c6742183341-4675-t7svq 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1755.4s
Peak memory 2.1 GiB
Avg memory 224.9 MiB
CPU user 1720.1s
CPU sys 30.0s
Peak spill 0 B

branch

Metric Value
Wall time 1740.4s
Peak memory 2.1 GiB
Avg memory 224.4 MiB
CPU user 1709.0s
CPU sys 30.1s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Target: arrow_writer

Comparing perf-byte-budget-precheck (b0057f7) to b231cf1 (merge-base) diff

Run configuration
run benchmark arrow_writer
shards: 4

Comparison results: View the complete native critcmp output.

The comparison is published in an unlisted Gist because the original inline report exceeded GitHub's comment limit.

Per-runner information
arrow_writer — shard 1/4

Node: gk3-benchmark-cluster-nap-1r3q3rn9-b7659f46-nzcw

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

uname:

Linux bench-c6742184501-4676-dl6q5 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1740.4s
Peak memory 2.0 GiB
Avg memory 195.2 MiB
CPU user 1704.0s
CPU sys 34.1s
Peak spill 0 B

branch

Metric Value
Wall time 1735.4s
Peak memory 2.1 GiB
Avg memory 196.5 MiB
CPU user 1695.2s
CPU sys 34.8s
Peak spill 0 B
arrow_writer — shard 2/4

Node: gk3-benchmark-cluster-nap-1r3q3rn9-b7659f46-nzcw

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

uname:

Linux bench-c6742184501-4677-n8bfk 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1785.4s
Peak memory 2.2 GiB
Avg memory 344.4 MiB
CPU user 1733.8s
CPU sys 46.4s
Peak spill 0 B

branch

Metric Value
Wall time 1795.4s
Peak memory 2.1 GiB
Avg memory 343.6 MiB
CPU user 1745.7s
CPU sys 46.5s
Peak spill 0 B
arrow_writer — shard 3/4

Node: gk3-benchmark-cluster-nap-1r3q3rn9-5591cf25-2wgf

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

uname:

Linux bench-c6742184501-4678-79tbs 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1915.4s
Peak memory 2.2 GiB
Avg memory 290.3 MiB
CPU user 1870.9s
CPU sys 40.5s
Peak spill 0 B

branch

Metric Value
Wall time 1915.4s
Peak memory 2.2 GiB
Avg memory 286.6 MiB
CPU user 1872.8s
CPU sys 40.6s
Peak spill 0 B
arrow_writer — shard 4/4

Node: gk3-benchmark-cluster-nap-1r3q3rn9-063541a9-vh7j

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

uname:

Linux bench-c6742184501-4679-gsmg8 6.12.105+ #1 SMP Sat Sep 19 07:55:25 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writer
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
Resource Usage

base (merge-base)

Metric Value
Wall time 1765.4s
Peak memory 2.1 GiB
Avg memory 224.4 MiB
CPU user 1730.2s
CPU sys 31.0s
Peak spill 0 B

branch

Metric Value
Wall time 1750.4s
Peak memory 2.0 GiB
Avg memory 224.3 MiB
CPU user 1716.6s
CPU sys 28.5s
Peak spill 0 B

File an issue against this benchmark runner

@adriangb

Copy link
Copy Markdown
Contributor Author

@etseidl could you take another look here?

@etseidl

etseidl commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Yes, sorry, I've been swamped. I'll get to this either later today or first thing tomorrow.

@etseidl etseidl 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.

Confirmed the issue previously raised is addressed. Just one documentation nit.

It seems like some of the benefit may have been lost with the last round of changes. I'd like to benchmark this some more locally.

// common small-value case for both non-null and (sparse) nullable
// columns.
if last >= first {
// Stage 1: span upper bound. The span `offsets[last+1] - offsets[first]`

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.

So the O(1) description is dropped here, but not at the calling site in count_values_within_byte_budget_gather, nor in the PR description.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reworded in in a9ef13a

@adriangb
adriangb requested a review from etseidl November 12, 2026 07:32
@etseidl

etseidl commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@adriangb I had my agent do some benchmarks to verify a fix to the #11996 regression. It's report follows (if you haven't seen "Colossus: The Forbin Project" I highly recommend...I watched it many times as a kid and it's frighteningly still relevant 🤣).

Thanks for this work. I ran a focused comparison and found useful gains, but also two repeatable regression cases worth addressing.

Compared corrected base b231cf15efa5dbbbe4ae8503849aa6ab3cfc4e0c against head a9ef13a92e9272d378ee3fcd173da33635588f4b on an Intel i7-12700K, Linux, Rust 1.99.1. These are mean milliseconds for writer construction + write + close of 1,048,576 rows, one nullable column, 99% nulls, write batch 1,024. Two counterbalanced sweeps and longer repeats agreed on the directions:

Input Base Head Time change
Random-null Utf8, 8-byte values, PLAIN 1.2466 1.3091 +5.0%
Same input, dictionary enabled 1.3092 1.3766 +5.1%
Random-null Utf8View, 8-byte inline values, PLAIN 1.2706 1.1077 −12.8%
Random-null Utf8View, 32-byte values in one shared backing buffer, PLAIN 1.2553 1.6390 +30.6%
Clustered/trailing-null Utf8, 8-byte values, PLAIN 0.6212 0.4345 −30.1%

Base/head output files matched byte-for-byte for these cases. These are bounded one-host results, not universal workload claims; the inline-View and clustered gains are real.

Repair target: repeated work over overlapping lookahead

Please inspect ByteBudgetChunker::byte_budget_sub_batch together with count_within_budget_offsets, count_within_budget_views, and max_view_value_len in parquet/src/arrow/arrow_writer/byte_array.rs.

The gather window contains the next chunk_size values, rather than the values belonging to the current chunk_size levels. At 99% random nulls, successive windows overlap heavily. Separate untimed instrumentation found:

  • Budget value_count calls fall from 1,024 to zero, eliminating a scan of 1,048,576 definition levels.
  • Gather-sizing visits rise from about 10.5k to 998,924; the offset fast path checks 997,900 adjacent index pairs.
  • Inline View passes its cheap bound. For the 32-byte View fixture, the shared backing buffer is 337,152 bytes, making max_view_value_len very loose. Stage 2 repeatedly scans nearly a million view lengths instead of about 10.5k.

Thus avoiding the definition-level scan can replace it with substantially more overlapping estimator work. The offset ordering change and expanded window have coupled costs; this does not isolate all the slowdown to ordering validation.

Could you try avoiding expanded lookahead when estimating it requires a linear scan? A candidate is to retain speculative lookahead when a genuinely cheap conservative bound proves it fits, otherwise count the current chunk and size only its actual gather prefix. This is a direction to test, not a verified fix; please prefer the smallest measured change rather than a broad encoder redesign or unnecessary public API addition. Simply shrinking the speculative window cannot establish that the whole chunk fits.

Preserve correctness and retest

For reproduction, use identical fixed-seed logical values/nulls for Utf8 and Utf8View: 1,048,576 rows, about 1% present (ours has 10,536), a 128-value ASCII alphabet, lengths 8 and 32. Explicit properties: uncompressed, writer version 1.0, page statistics, 1 MiB data/dictionary limits, 20,000-row page limit, write batch 1,024, one row group. Ensure the out-of-line View uses one shared backing buffer, not one small buffer per value. Generate input outside timing and write to a discard sink.

Retest the table cases against the corrected base, plus random sparsity with write batch 64. Validate roundtrip and actual page/dictionary bodies separately, retaining the existing soft-limit/boundary allowances. Keep the chunker/placeholder tests, page/dictionary-cap tests (including clustered nulls), and both test_arrow_writer_list_view_backward_gather* regressions passing. Please report per-representation results and explain any remaining tradeoff. I can share the standalone harness and detailed results if useful.

@Rich-T-kid Rich-T-kid added the performance Speed or memory optimizations label Nov 16, 2026
adriangb and others added 9 commits November 23, 2026 11:57
The byte-budget estimate for offset-buffer byte arrays bounds the payload
by the offsets span from the first gather index to the last. That bound
holds only for strictly increasing indices. A ListView can reference its
child values in any order and more than once, so a gather such as
[0, 1, ..., 8, 0] spans only value 0. The estimate then reports that
everything fits, and the writer packs every large value into one page.

Use the span bound only when the indices are strictly increasing, and
fall back to the per-value walk otherwise. Add ArrowWriter regressions
for a backward jump inside one chunk and for one past the chunk.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Raw ColumnWriter callers may pad a contiguous values slice with
placeholder ByteArrays past the values their levels reference; sizing
them panics. Restrict the lookahead window to gather indices, which
always name real values, and keep counting the chunk's values first on
the contiguous path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The offsets stage-1 check now verifies index order, which is linear in
the number of indices.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The byte-budget chunker decides page boundaries from an estimate of the
value bytes. The estimate has a different code path for each byte array
representation and for sparse, clustered and mixed value sizes. No test
pins the pages that those paths produce, so a change to the estimate can
move page boundaries without a failure.

Write the same logical column as Utf8, LargeUtf8 and Utf8View (one data
buffer and many), with write batch sizes 64 and 1024 and with the
dictionary on and off. Assert the largest page stays within the limit
and that every representation produces the same page layout. The tests
read only the written file, so they do not depend on the estimator.

These tests pass before the following fix. They guard it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
To skip the def-level scan, the chunker sized the next `chunk_size`
gathered values and returned early if they fit the page budget. On a
sparse column a chunk holds a few values, so the windows of consecutive
chunks overlap almost entirely. A 99% null column with 1M rows visited
about 1M indices where counting the values of each chunk first visits
about 10k. A Utf8View column with one shared data buffer always fell
through to the per-view scan and wrote much slower than main.

Prove the fit from the length of the window and a per-value bound, so
the proof reads no values. The encoder reports the bound once per write
call through the new crate-internal `ColumnValueEncoder::max_value_bytes`.
Only view arrays report one: the largest data buffer bounds every value.
An offset array has no bound tighter than its whole payload unless the
code reads every offset. When the encoder has no bound or the bound does
not fit, the chunker counts the values of the chunk first and sizes only
those. That is the control flow of main.

The lookahead still pays off in two cases: a chunk with no values left
to gather, and a view array whose bound fits (inline values or small
data buffers). Random-sparse Utf8 and shared-buffer views get no gain.
The strict-order check on gather indices from the earlier ListView fix
still runs once per chunk, so those columns can stay a few percent
slower than main.

Written files are byte-identical to main and to the previous commit.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@adriangb
adriangb force-pushed the perf-byte-budget-precheck branch from e4ddfef to 908ab98 Compare November 23, 2026 17:58

@etseidl etseidl 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 @adriangb. Just verified the regressions are gone and the benefit remains. No other issues came up. I think this is ready. Maybe do a final check that the PR description matches the final PR contents.

@adriangb

Copy link
Copy Markdown
Contributor Author

Amazing, thanks so much for helping get this across the line!

@adriangb

Copy link
Copy Markdown
Contributor Author

@etseidl ping for merge before we get conflicts :)

@etseidl
etseidl added this pull request to the merge queue Nov 25, 2026
Merged via the queue into apache:main with commit 8befa3c Nov 25, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet parquet crate performance Speed or memory optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants