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

expression: implement vectorized evaluation for builtinConvSig #13642

Closed
wants to merge 2 commits into from
Closed

expression: implement vectorized evaluation for builtinConvSig #13642

wants to merge 2 commits into from

Conversation

AerysNan
Copy link
Contributor

Signed-off-by: AerysNan [email protected]

PCP #12106

What problem does this PR solve?

Implement vectorized evaluation for builtinConvSig.

What is changed and how it works?

BenchmarkVectorizedBuiltinMathFunc/builtinConvSig-VecBuiltinFunc-4                167650              6874 ns/op               0 B/op          0 allocs/op
BenchmarkVectorizedBuiltinMathFunc/builtinConvSig-NonVecBuiltinFunc-4              36576             34687 ns/op               0 B/op          0 allocs/op

Check List

Tests

  • Unit test

@AerysNan AerysNan requested a review from a team as a code owner November 20, 2019 14:33
@sre-bot
Copy link
Contributor

sre-bot commented Nov 20, 2019

Thanks for your contribution. If your PR get merged, you will be rewarded 50 points.

@sre-bot sre-bot added the contribution This PR is from a community contributor. label Nov 20, 2019
@ghost ghost requested review from qw4990 and SunRunAway and removed request for a team November 20, 2019 14:33
if negative && ignoreSign {
s = "-" + s
}
res := strings.ToUpper(s)
Copy link
Contributor

Choose a reason for hiding this comment

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

I've noticed that the most code is copied from builtinConvSig.evalString, could you warp a method and avoiding code copying?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

ast.Conv: {
{
retEvalType: types.ETString,
childrenTypes: []types.EvalType{types.ETString, types.ETInt, types.ETInt},
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to limit the rune in arg[0] because the range of each rune should be [A-Z]|[0-9].
We may need to limit the bound of the arg[1] and arg[2] because the valid number is 2 to 36, maybe a range of [-1, 40] is ok.

@AerysNan AerysNan closed this Nov 25, 2019
@AerysNan AerysNan deleted the vectorize/builtinConvSig branch November 25, 2019 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression contribution This PR is from a community contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants