Skip to content

perf(variant): compare batched bracket escape handling - #11924

Closed
sdf-jkl wants to merge 11 commits into
apache:mainfrom
sdf-jkl:codex/variant-path-span-copy-comparison
Closed

sdf-jkl wants to merge 11 commits into
apache:mainfrom
sdf-jkl:codex/variant-path-span-copy-comparison

Conversation

@sdf-jkl

@sdf-jkl sdf-jkl commented Oct 26, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Relates to #11232. This experimental draft is stacked on its head, 4431da4087eeac53f7d15e12def5d2ae8d0a3250, and includes that PR's changes. Incremental comparison.

Rationale for this change

Compare an alternative bracket-path escape loop against #11232 on the benchmark runner. Local x86-64 measurements were sensitive to instruction alignment, so this draft does not claim a portable performance improvement.

What changes are included in this PR?

Copy each nonempty literal span, append the escaped character immediately, and consume adjacent escapes together. Resume span copying at CharIndices::offset(). Fields without escapes retain #11232's borrowing behavior.

The bot comparison will use 4431da4087eeac53f7d15e12def5d2ae8d0a3250 as the baseline and this draft's commit as the changed version. The existing six-case variant_path benchmark is identical on both sides; it does not cover the longer strings used in the local investigation.

Are these changes tested?

Existing path parsing and ownership tests pass. Added cases cover adjacent escapes containing multibyte characters and a trailing backslash inside an escape run. All parquet-variant tests and doctests, crate Clippy, formatting, spelling, and the six benchmark smoke cases pass.

A separate differential check matched parsed values and error messages against the PR baseline for 3,333,567 inputs. Full-workspace tests and Clippy could not run offline because crc32fast 1.5.3 was not cached; fork CI remains to be checked.

Are there any significant user-facing changes?

No intended semantic or public API changes. Performance remains under evaluation.

AI usage

Codex reconstructed and applied the earlier parser prototype, added the focused test cases, ran validation, and prepared this description.

DKER2 and others added 11 commits September 27, 2026 23:23
Covers dot notation, bracket fields, indexes, wildcards and escaped
bracket fields so changes to the path parser can be measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Moved to a separate PR (apache#11508) so the benchmark lands on main first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address review feedback: instead of pushing each char into the
unescaped buffer, track where the current run of literal chars starts
and copy it with `push_str` on each escape and at the closing bracket.

Also collapse the bracket field ownership asserts into one and cover
multiple escapes between multi-byte chars.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sdf-jkl

sdf-jkl commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

run benchmark variant_path

baseline:
ref: 4431da4
changed:
ref: f9b8981

@adriangbot

Copy link
Copy Markdown

🤖 Benchmark starting (GKE) | trigger

Target: variant_path

Sharding factor: 1 (1 workers).

Comparing f9b8981 (f9b8981) to 4431da4 diff

Run configuration
run benchmark variant_path
baseline:
  ref: 4431da4087eeac53f7d15e12def5d2ae8d0a3250
changed:
  ref: f9b89811115243b10e84d757e8aba8bc4d95f967
shards: 1

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

Comparing f9b8981 (f9b8981) to 4431da4 diff

Run configuration
run benchmark variant_path
baseline:
  ref: 4431da4087eeac53f7d15e12def5d2ae8d0a3250
changed:
  ref: f9b89811115243b10e84d757e8aba8bc4d95f967
shards: 1
Details
group                                       base                                   changed
-----                                       ----                                   -------
variant_path_parse/bracket_escaped_field    1.05     71.0±0.22ns        ? ?/sec    1.00     67.9±0.48ns        ? ?/sec
variant_path_parse/bracket_indexes          1.00     42.3±0.20ns        ? ?/sec    1.05     44.2±0.20ns        ? ?/sec
variant_path_parse/bracket_quoted_fields    1.00     52.5±0.23ns        ? ?/sec    1.03     53.9±0.78ns        ? ?/sec
variant_path_parse/bracket_wildcards        1.00     38.1±0.29ns        ? ?/sec    1.00     38.2±0.18ns        ? ?/sec
variant_path_parse/dot_fields               1.00     31.2±0.31ns        ? ?/sec    1.00     31.1±0.10ns        ? ?/sec
variant_path_parse/mixed                    1.00     86.2±0.20ns        ? ?/sec    1.05     90.4±0.76ns        ? ?/sec

Per-runner information
variant_path — shard 1/1

Node: gk3-benchmark-cluster-nap-s8dlj0s2-9e66c073-76t2

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

uname:

Linux bench-c6424852232-3885-spbp8 6.12.105+ #1 SMP Sat Sep  5 07:54:11 UTC 2026 aarch64 GNU/Linux

BENCH_COMMAND:

cargo bench --features=arrow,async,test_common,experimental,object_store --bench variant_path
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 65.0s
Peak memory 9.4 MiB
Avg memory 7.6 MiB
CPU user 59.6s
CPU sys 0.0s
Peak spill 0 B

branch

Metric Value
Wall time 60.0s
Peak memory 9.9 MiB
Avg memory 8.0 MiB
CPU user 57.1s
CPU sys 0.0s
Peak spill 0 B

File an issue against this benchmark runner

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

Labels

parquet-variant parquet-variant* crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants