perf(parquet): Optimize DeltaByteArrayEncoder and friends - #10412
perf(parquet): Optimize DeltaByteArrayEncoder and friends#10412MassivePizza wants to merge 17 commits into
Conversation
|
run benchmark arrow_writer |
This comment was marked as duplicate.
This comment was marked as duplicate.
|
🤖 Arrow criterion benchmark completed (GKE) | trigger Instance: CPU Details (lscpu)Details
Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
That bench sure looks noisy. I'm not sure which benches actually use DeltaByteArray encoding, but parquet_2 should generally enable it for byte arrays (i.e. decimals and strings) AFAIK. I'll test again locally to make sure nothing is too broken. |
|
@MassivePizza I'm having issues with flaky benches on #10432 too. Maybe we should focus on pushing #9975 forward? |
|
run benchmark parquet_round_trip env:
BENCH_FILTER: delta |
This comment was marked as duplicate.
This comment was marked as duplicate.
|
🤖 Arrow criterion benchmark completed (GKE) | trigger Instance: CPU Details (lscpu)Details
Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
run benchmark parquet_round_trip env:
BENCH_FILTER: byte_stream |
This comment was marked as duplicate.
This comment was marked as duplicate.
|
🤖 Arrow criterion benchmark completed (GKE) | trigger Instance: CPU Details (lscpu)Details
Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
@MassivePizza I'm trying to run benchmarks on some local hardware. A first pass looked promising, but there was too much background stuff running. I'll try again today on a beefier workstation. In general the microbenches are good at identifying large changes, but smaller signals are hard to distinguish from noise :( |
|
I also found some new changes in ByteStreamSplit coders, but will do a second PR for that. |
|
Diff ended up smaller than expected, so I put it here in the end. |
2aa786d to
9168a04
Compare
9168a04 to
738f4e4
Compare
Jefffrey
left a comment
There was a problem hiding this comment.
do we have some local benchmark results to demonstrate the gains?
There was a problem hiding this comment.
does this doc need to be updated now?
There was a problem hiding this comment.
I moved part of it into decoder, should be more sensible now.
2b79b65 to
10eb9b4
Compare
|
Sorry about the label spam, accidentally merged main into the PR branch :) |
|
Biggest win can probably be attributed to removing the copy in DeltaByteArrayEncoder. This gives up to 10% wins on decimals locally. |
|
Would be nice to modify |
|
would you be able to post the numbers & benchmarks you ran locally for this? itll be easier to review if we can see those, as currently there arent any concrete numbers for this performance PR |
|
Ah right, should be doable. I'll look into new benches that attempt to replicate the usage we have internally. |
Which issue does this PR close?
N/A
Rationale for this change
In our case, improve performance for delta-encoded decimals.
What changes are included in this PR?
Reduce allocs and copies when delta-encoding byte-arrays.
Also removed some suspicious
#[cold]attributes onEncoder::encoding.Are these changes tested?
Encoder correctness should be covered by existing tests.
I can add benchmarks if desired, since the removal of byte array copies is a nice win (especially combined with #10364).
Are there any user-facing changes?
parquet::encodings::encoding::Encoderhas a newflush_tofunction, but the module is gated behind the experimental feature. I can rewrite it to makeflush_toa default method if needed.