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

perf: Remove sorting to yield sorted_rank #3693

Merged
merged 1 commit into from
Feb 11, 2023
Merged

perf: Remove sorting to yield sorted_rank #3693

merged 1 commit into from
Feb 11, 2023

Conversation

askoa
Copy link
Contributor

@askoa askoa commented Feb 11, 2023

Which issue does this PR close?

Rationale for this change

I was looking through arrow_ord module for adding run array. I noticed the function sorted_rank was doing unnecessary sorting. The function can do its job in O(N) time. The changes resulted in non-trivial performance improvement in sort_kernel for dictionary.

dict string 2^12        time:   [33.434 µs 33.549 µs 33.695 µs]
                        change: [-13.791% -11.994% -10.202%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  2 (2.00%) high mild
  10 (10.00%) high severe

Note: Thanks to the documentation of the function. Wouldn't have noticed this otherwise.

/// e.g. [2, 4, 3, 1, 0] -> [4, 3, 0, 2, 1]

What changes are included in this PR?

Remove unnecessary sorting in sorted_rank function.

Are there any user-facing changes?

No.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Feb 11, 2023
@Dandandan Dandandan merged commit 3cf64df into apache:master Feb 11, 2023
@ursabot
Copy link

ursabot commented Feb 11, 2023

Benchmark runs are scheduled for baseline = 5261009 and contender = 3cf64df. 3cf64df 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

@Dandandan
Copy link
Contributor

Thanks @askoa 😎

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.

4 participants