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

remove redundant if/clamp_min/abs #1428

Merged
merged 1 commit into from
Mar 17, 2022
Merged

remove redundant if/clamp_min/abs #1428

merged 1 commit into from
Mar 17, 2022

Conversation

jackwener
Copy link
Member

Which issue does this PR close?

Closes #1427.

Rationale for this change

None

What changes are included in this PR?

There are some redundant code for control flow

if is control flow will break the cpu pipeline, we should reduce the useless if.
bbs() should remove, and replace with code in the if
clamp_min is useless

Are there any user-facing changes?

None

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 11, 2022
@jackwener
Copy link
Member Author

jackwener commented Mar 13, 2022

@jameslamb @jimexist PTAL❤

It's a small change, remove some redundant function-call

@HaoYang670
Copy link
Contributor

I think it is a good refactor.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks fine to me. I suspect this doesn't make any practical difference as the overhead of actually calling concat will dominate any control flow or arithmetic overhead, but one might also argue that this logic is clearer

thank you @jackwener

@jackwener
Copy link
Member Author

Yes, It don't have big performance impact because key performance overhead is in concat.

@alamb alamb merged commit c5b4ab1 into apache:master Mar 17, 2022
@alamb
Copy link
Contributor

alamb commented Mar 17, 2022

Thanks again @jackwener

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.

Redundant if and abs in shift()
3 participants