Commit ba21a83
authored
[Parquet] Optimize appending max level comparison in DefinitionLevelDecoder (#9217)
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->
- Closes #9216.
# Rationale for this change
Profiling showed this loop to be a clear performance hotspot and thanks
to the new `BooleanBufferBuilder::extend_trusted_len` method introduced
in #9137 there is a very simple improvement.
Benchmark results for optional structs after the fix:
```
arrow_array_reader/struct/Int32Array/plain encoded, optional struct, optional data, no NULLs
time: [69.873 µs 69.917 µs 69.970 µs]
change: [−60.075% −60.046% −60.018%] (p = 0.00 < 0.05)
Performance has improved.
arrow_array_reader/struct/Int32Array/plain encoded, optional struct, optional data, half NULLs
time: [136.62 µs 136.66 µs 136.72 µs]
change: [−67.663% −67.536% −67.416%] (p = 0.00 < 0.05)
Performance has improved.
```
This is a big improvement, but still significantly slower than reading
non-nested data. The main hotspot still is the `extend_trusted_len` and
manual simd code for comparing chunks and appending 64-bits at a time
could potentially speed it up even more. But that would require either
architecture specific intrinsics or unstable features.
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
# Are these changes tested?
Tested by existing tests.
# Are there any user-facing changes?
no1 parent ba3446b commit ba21a83
File tree
2 files changed
+11
-5
lines changed- parquet/src/arrow
- array_reader
- record_reader
2 files changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
0 commit comments