Repository navigation
Conversation
Measures reads of single leaves at depth 1-3 of a wide nested struct against struct and whole-struct selections, and logs bytes read per op so pruning regressions show up even when local timing does not. Generated-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bytes per op only reached the log, so the JMH results file carried timing alone and the number averaged the warmup runs in. Pass an @AuxCounters state to each arm so the value lands in the results, warn once when /proc/self/io is unreadable, and fail the run when an arm records implausibly few bytes. State the pruning oracle in type-matched terms while here: a depth-3 long leaf against the top-level long, not against a 64-char string. Drop the fork's --add-opens, which every arm runs without on JDK 17. Generated-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a JMH benchmark that reads single leaves at depth 1-3 of a wide nested struct, plus struct+child and whole-struct selections, and reports bytes read per op as a JMH counter. Before #18336 a deep leaf read its whole intermediate struct; this makes that visible, and it matters because local timing barely moves when the extra columns are fetched but not decoded. The #18336 results are in that PR.
Results (Spark 4.1, JDK 17, local FS, 10 files x 100k rows, 690 MB, SingleShotTime, 5 measured invocations;
cd3ae3c80before #18336 vs843d36deafter):idperson.nameperson.home_address.cityperson.l2.l3.leafperson.l2,person.l2.xpersonTiming is only comparable within a run pair: the same commit drifted 24% on the slowest arm (2.48 to 3.08 s/op) between two runs, while its bytes moved 0.3%. Anything smaller than that drift has to be argued in bytes, not seconds.
Reading it: pruned arms are compared against same-type baselines, so
readDepth3Leaf(a long at depth 3) is expected to cost about whatreadId(a long at the top level) costs, andreadDepth1Leafabout whatreadDepth2Leafdoes; every leaf is orders of magnitude belowreadWholeStruct. Before the fix, the depth-3 leaf read exactly whatperson.l2, person.l2.xreads, which is the wholel2subtree.bytesis a@AuxCounters(AuxCounters.Type.EVENTS)column, so it appears next to the timing in the JMH results file and excludes warmup. Each measured invocation resets it and reads one op, so the score is the sum over the five measured invocations andscorePercentilescarries the per-op bytes.Type.OPERATIONSis not usable here: in SingleShotTime mode it drops the column entirely. The value is read from/proc/self/iorchar, which counts read syscalls rather than Hadoop FS statistics (those miss Parquet reads entirely); it is Linux-only, and elsewhere the counter logs once and reports nothing. A per-op floor fails the run when the counter sees an implausibly small read, so a blind counter cannot be mistaken for a pruned read.Test plan: ran the benchmark on main and on the parent of
843d36de, and re-ran it on this branch.AI Disclosure