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

GH-26648: [C++] Optimize union equality comparison #26648 #45384

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mcshawn10
Copy link

@mcshawn10 mcshawn10 commented Jan 29, 2025

Rationale for this change

#26648 proposes an optimization in checking sparse array equality by detecting contiguous runs, this PR implements that change

What changes are included in this PR?

previously, sparse array comparison was checked one by one, in this change, contiguous runs are detected and compared by checking equality of current and previous child_ids

Are these changes tested?

already covered by existing unit tests

Are there any user-facing changes?

no

Copy link

⚠️ GitHub issue #26648 has been automatically assigned in GitHub to PR creator.

@mapleFU
Copy link
Member

mapleFU commented Jan 31, 2025

Thanks! By the way is there any benchmark result for this pr?

@mcshawn10
Copy link
Author

Thanks! By the way is there any benchmark result for this pr?

still figuring that part out! 😅

@mcshawn10
Copy link
Author

mcshawn10 commented Jan 31, 2025

overall.json

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Non-regressions: (6)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                              benchmark          baseline          contender  change %                                                                                                                                                                                                   counters
    ArrayRangeEqualsSparseUnion/65536/0 47.119M items/sec 105.533M items/sec   123.973      {'family_index': 0, 'per_family_instance_index': 5, 'run_name': 'ArrayRangeEqualsSparseUnion/65536/0', 'repetitions': 1, 'repetition_index': 0, 'threads': 1, 'iterations': 506, 'null_percent': 0.0}
  ArrayRangeEqualsSparseUnion/65536/100 29.924M items/sec  57.186M items/sec    91.101    {'family_index': 0, 'per_family_instance_index': 1, 'run_name': 'ArrayRangeEqualsSparseUnion/65536/100', 'repetitions': 1, 'repetition_index': 0, 'threads': 1, 'iterations': 326, 'null_percent': 1.0}
ArrayRangeEqualsSparseUnion/65536/10000 30.820M items/sec  57.887M items/sec    87.826 {'family_index': 0, 'per_family_instance_index': 0, 'run_name': 'ArrayRangeEqualsSparseUnion/65536/10000', 'repetitions': 1, 'repetition_index': 0, 'threads': 1, 'iterations': 325, 'null_percent': 0.01}
   ArrayRangeEqualsSparseUnion/65536/10 30.616M items/sec  56.025M items/sec    82.990    {'family_index': 0, 'per_family_instance_index': 2, 'run_name': 'ArrayRangeEqualsSparseUnion/65536/10', 'repetitions': 1, 'repetition_index': 0, 'threads': 1, 'iterations': 331, 'null_percent': 10.0}
    ArrayRangeEqualsSparseUnion/65536/1 46.987M items/sec  82.663M items/sec    75.926    {'family_index': 0, 'per_family_instance_index': 4, 'run_name': 'ArrayRangeEqualsSparseUnion/65536/1', 'repetitions': 1, 'repetition_index': 0, 'threads': 1, 'iterations': 488, 'null_percent': 100.0}
    ArrayRangeEqualsSparseUnion/65536/2 31.326M items/sec  54.119M items/sec    72.760     {'family_index': 0, 'per_family_instance_index': 3, 'run_name': 'ArrayRangeEqualsSparseUnion/65536/2', 'repetitions': 1, 'repetition_index': 0, 'threads': 1, 'iterations': 340, 'null_percent': 50.0}

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

Successfully merging this pull request may close these issues.

2 participants