geoffreyclaude commented on PR #11771: URL: https://github.com/apache/arrow-rs/pull/11771#issuecomment-7123343646
I threw Gemini 4 Neon at it (good excuse to test out the latest frontier model) and I believe it cracked the case! Neon's full explanation below for the flaky benchmark results: **Why #11771 isn't actually regressing `Utf8View`:** - Comparing the compiled disassembly (ThinLTO, both `x86_64` and `aarch64`) between the merge-base and this PR, the generated instructions for `decode_binary_view_inner`, `decode_string_view`, `decoded_len`, `decode_nulls_sentinel`, `make_view`, and `RowConverter::convert_raw` are **bit-for-bit identical**. - Changing unrelated code in `arrow-row` still shifts function addresses slightly in the benchmark binary, which can trigger branch-predictor aliasing on the ARM64 Neoverse-V2 runner when a hot loop has lots of poorly predicted branches (like random-length / 50%-null strings). - That also explains why the exact same commit swung between `+74%` and `1.00x` on `convert_rows_parsed` across runs, why #12235 (which has the exact same decode code) shows `1.00x`, and why `string(100, 0.5)` swung ~22% on the baseline in the earlier run. **Follow-up optimization:** - Inspecting the disassembly did surface a few straightforward cleanups in `arrow-row/src/variable.rs` (inlining `decoded_len`, skipping null/empty rows early, constructing `> 12`B `ByteView`s inline instead of calling `#[inline(never)] make_view`, and specializing on `descending`). - I opened a small separate draft PR in #12428 to tighten up that hot loop — the [bot run on #12428](https://github.com/apache/arrow-rs/pull/12428#issuecomment-7117585498) shows **1.11x–1.37x speedups across all 12 `string view` decode benchmarks** (e.g., `string view(1..100, 0.5)` drops from 37.9 µs to 31.7 µs, and `string view(1..100, 0)` from 55.6 µs to 47.6 µs). So from a performance standpoint, #11771 itself looks in the clear, and the `Utf8View` decode improvements can live cleanly in #12428. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
