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

chore(query): improve comparison functions #17032

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

sundy-li
Copy link
Member

@sundy-li sundy-li commented Dec 11, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  1. Introduce Bitmap::collect_bool and MutableBitmap::collect_bool function, which works faster than collect from iterator as it eliminates the conditional Iterator::next
  2. Add register_comparison_2_arg and vectorize_cmp_2_arg in registers

Performance:

  • 20 faster in Bitmap::collect_bool than Bitmap::from_trusted_len_iter
bench_kernels/bitmap_from_arrow2_collect_bool/10240
                        time:   [224.40 ns 224.99 ns 225.67 ns]
bench_kernels/bitmap_from_arrow2/10240
                        time:   [4.9801 µs 4.9809 µs 4.9817 µs]
  • 1.3x faster in comparison functions

1.222 sec --> 0.911 sec

select number > 10000 from numbers(10000000000) ignore_result;  
  • TODO: use default trait impl to refactor from_iterand from_trusted_len_iter functions

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Dec 11, 2024
@sundy-li sundy-li changed the title chore(query): improve comparision functions chore(query): improve comparison functions Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-chore this PR only has small changes that no need to record, like coding styles.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant