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

Speed up bound checking in take #281

Merged
merged 6 commits into from
May 11, 2021
Merged

Speed up bound checking in take #281

merged 6 commits into from
May 11, 2021

Conversation

Dandandan
Copy link
Contributor

@Dandandan Dandandan commented May 10, 2021

Which issue does this PR close?

Closes #280

Rationale for this change

>2x speed up for common case (non-null indices) when using TakeOptions {check_bounds: true}

take check bounds i32 512                        
                        time:   [618.35 ns 619.16 ns 620.08 ns]
                        change: [-55.905% -55.474% -55.115%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild

Benchmarking take check bounds i32 1024: Collecting 100 samples in estimated 5.0026 s (4.7M iteratio                                                                                                    take check bounds i32 1024                        
                        time:   [1.0389 us 1.0409 us 1.0430 us]
                        change: [-57.474% -57.278% -57.093%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

What changes are included in this PR?

Speed up kernel with bound checking option on.

Are there any user-facing changes?

No

@Dandandan
Copy link
Contributor Author

FYI @jorgecarleitao

Copy link
Contributor

@nevi-me nevi-me left a comment

Choose a reason for hiding this comment

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

nice catch!

Copy link
Member

@jorgecarleitao jorgecarleitao left a comment

Choose a reason for hiding this comment

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

LGTM :)

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

Successfully merging this pull request may close these issues.

Improve performance of bound checking option
3 participants