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

Lazily materialize the null buffer builder of boolean builder #2073

Merged
merged 2 commits into from Jul 15, 2022

Conversation

HaoYang670
Copy link
Contributor

@HaoYang670 HaoYang670 commented Jul 15, 2022

Signed-off-by: remzi 13716567376yh@gmail.com

Which issue does this PR close?

Closes #2058 .

Rationale for this change

Improve the performance when there is no null in the array.

Benchmark result

Tested on M1 Pro Mac

bench_bool/bench_bool   time:   [664.02 us 683.00 us 705.62 us]                                  
                        thrpt:  [708.60 MiB/s 732.06 MiB/s 752.99 MiB/s]
                 change:
                        time:   [-66.725% -66.281% -65.716%] (p = 0.00 < 0.05)
                        thrpt:  [+191.68% +196.57% +200.52%]
                        Performance has improved.
Found 20 outliers among 100 measurements (20.00%)
  1 (1.00%) low severe
  2 (2.00%) low mild
  1 (1.00%) high mild
  16 (16.00%) high severe

What changes are included in this PR?

Lazily materialize the null buffer builder, just as what we have done in the primitive builder.

Are there any user-facing changes?

No.

Signed-off-by: remzi <13716567376yh@gmail.com>
@github-actions github-actions bot added the arrow Changes to the arrow crate label Jul 15, 2022
Signed-off-by: remzi <13716567376yh@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #2073 (4f06db3) into master (86543a4) will increase coverage by 0.00%.
The diff coverage is 93.61%.

@@           Coverage Diff           @@
##           master    #2073   +/-   ##
=======================================
  Coverage   83.61%   83.62%           
=======================================
  Files         223      223           
  Lines       58539    58559   +20     
=======================================
+ Hits        48947    48969   +22     
+ Misses       9592     9590    -2     
Impacted Files Coverage Δ
arrow/src/array/builder/primitive_builder.rs 92.57% <ø> (-0.55%) ⬇️
arrow/src/array/builder/boolean_builder.rs 87.25% <93.61%> (+11.49%) ⬆️
...row/src/array/builder/string_dictionary_builder.rs 90.64% <0.00%> (-0.72%) ⬇️
parquet/src/encodings/encoding.rs 93.43% <0.00%> (-0.20%) ⬇️
arrow/src/datatypes/datatype.rs 64.41% <0.00%> (+0.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86543a4...4f06db3. Read the comment docs.

@tustvold tustvold merged commit 7fff23f into apache:master Jul 15, 2022
@ursabot
Copy link

ursabot commented Jul 15, 2022

Benchmark runs are scheduled for baseline = 474dc14 and contender = 7fff23f. 7fff23f 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

@HaoYang670
Copy link
Contributor Author

Thank you @tustvold for your review!

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

Successfully merging this pull request may close these issues.

Lazily materialize the null buffer builder of BooleanBuilder
4 participants