Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase DeltaBitPackEncoder miniblock size to 64 for 64-bit integers (#2282) #2319

Merged
merged 1 commit into from
Aug 5, 2022

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Aug 4, 2022

Which issue does this PR close?

Part of #2282

Rationale for this change

Following #2278 we can efficiently decode blocks of 64x 64-bit integers, however, the defaults of DeltaBitPackEncoder configure 32-wide miniblocks. #2282 tracks allowing users to configure this, but in the short term we should choose a more optimal default.

arrow_array_reader/Int64Array/binary packed, mandatory, no NULLs                                                                             
                        time:   [25.295 us 25.307 us 25.322 us]
                        change: [-59.630% -59.504% -59.394%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe
arrow_array_reader/Int64Array/binary packed, optional, no NULLs                                                                             
                        time:   [41.864 us 41.871 us 41.878 us]
                        change: [-47.152% -47.076% -46.954%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  2 (2.00%) low mild
  3 (3.00%) high mild
  4 (4.00%) high severe
arrow_array_reader/Int64Array/binary packed, optional, half NULLs                                                                             
                        time:   [46.301 us 46.324 us 46.345 us]
                        change: [-26.069% -25.818% -25.590%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild

What changes are included in this PR?

Changes to using a miniblock size of 64 for 64-bit integers

Are there any user-facing changes?

There should be no breaking user-facing changes, although this may change the way their data is encoded.

@github-actions github-actions bot added the parquet Changes to the parquet crate label Aug 4, 2022
@tustvold
Copy link
Contributor Author

tustvold commented Aug 4, 2022

For comparison the PLAIN encoding is

arrow_array_reader/Int64Array/plain encoded, mandatory, no NULLs                                                                             
                        time:   [8.0204 us 8.1321 us 8.2710 us]

So within a factor of 3, which is cool. It's a shame this encoding isn't one of the more vectorisable delta encodings (despite the docs linking to a paper that explicitly says why they are superior to the one parquet in the end chose), but it is what it is 😅

@alamb
Copy link
Contributor

alamb commented Aug 4, 2022

Can we summarize this PR as "increases performance of reading integers from parquet by 20%-60%"?

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thank you @tustvold

Even though it is a small PR, I think it would be good if someone else with some more expertise in this area like @sunchao or @nevi-me could also give it a look prior to merging

@tustvold
Copy link
Contributor Author

tustvold commented Aug 4, 2022

increases performance of reading integers from parquet by 20%-60%

It only increases the performance for 64-bit integers, encoded with DeltaBitPacking, which in turn is only used when the writer version is 2 and the dictionary encoding is either disabled or has spilled. So whilst technically true, that might be a somewhat misleading way of phrasing it 😅

@tustvold
Copy link
Contributor Author

tustvold commented Aug 5, 2022

I'm going to get this in so that it can make the arrow 20 release

@tustvold tustvold merged commit 297a8fa into apache:master Aug 5, 2022
@ursabot
Copy link

ursabot commented Aug 5, 2022

Benchmark runs are scheduled for baseline = 0af81e8 and contender = 297a8fa. 297a8fa is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants