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 "builtinCastIntAsStringSig" #12425

Merged
merged 19 commits into from
Oct 1, 2019
Merged

expression: implement vectorized evaluation for "builtinCastIntAsStringSig" #12425

merged 19 commits into from
Oct 1, 2019

Conversation

tsthght
Copy link
Contributor

@tsthght tsthght commented Sep 26, 2019

What problem does this PR solve?

Implement vectorized evaluation for builtinCastIntAsStringSig, for #12106

What is changed and how it works?

goos: darwin
goarch: amd64
pkg: github.com/pingcap/tidb/expression
BenchmarkVectorizedBuiltinCastFunc/builtinCastIntAsStringSig-VecBuiltinFunc-8         	   20000	     78350 ns/op	   25872 B/op	     809 allocs/op
BenchmarkVectorizedBuiltinCastFunc/builtinCastIntAsStringSig-NonVecBuiltinFunc-8      	   20000	     87173 ns/op	   25872 B/op	     809 allocs/op

Check List

Tests

  • Unit test

@sre-bot sre-bot added the contribution This PR is from a community contributor. label Sep 26, 2019
@qw4990 qw4990 requested review from Reminiscent and qw4990 and removed request for Reminiscent September 26, 2019 13:07
@codecov
Copy link

codecov bot commented Sep 26, 2019

Codecov Report

Merging #12425 into master will increase coverage by 0.0297%.
The diff coverage is 59.375%.

@@               Coverage Diff                @@
##             master     #12425        +/-   ##
================================================
+ Coverage   79.8676%   79.8974%   +0.0297%     
================================================
  Files           460        460                
  Lines        102467     102360       -107     
================================================
- Hits          81838      81783        -55     
+ Misses        14698      14665        -33     
+ Partials       5931       5912        -19

@qw4990
Copy link
Contributor

qw4990 commented Sep 27, 2019

/run-unit-test

@qw4990
Copy link
Contributor

qw4990 commented Sep 27, 2019

/run-unit-test

Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

LGTM

@qw4990 qw4990 requested a review from SunRunAway September 27, 2019 08:02
@qw4990 qw4990 requested a review from zz-jason September 28, 2019 10:10
expression/builtin_cast_vec.go Outdated Show resolved Hide resolved
expression/builtin_cast_vec.go Outdated Show resolved Hide resolved
@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 28, 2019
@qw4990
Copy link
Contributor

qw4990 commented Sep 29, 2019

/run-unit-test

@qw4990
Copy link
Contributor

qw4990 commented Sep 29, 2019

/run-all-tests

@qw4990
Copy link
Contributor

qw4990 commented Sep 29, 2019

/run-common-test

@qw4990
Copy link
Contributor

qw4990 commented Sep 29, 2019

/run-integration-common-test

@qw4990
Copy link
Contributor

qw4990 commented Sep 29, 2019

/run-all-tests

if !isUnsigned {
str = strconv.FormatInt(i64s[i], 10)
} else {
u64, err := types.ConvertIntToUint(b.ctx.GetSessionVars().StmtCtx, i64s[i], types.IntergerUnsignedUpperBound(b.tp.Tp), b.tp.Tp)
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, it's my fault.
It seems that we don't need ConvertIntToUint after reviewing the row-based implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, i will change ConvertIntToUint() to uint()

}
str, err = types.ProduceStrWithSpecifiedTp(str, b.tp, b.ctx.GetSessionVars().StmtCtx, false)
if err != nil {
result.AppendNull()
Copy link
Contributor

Choose a reason for hiding this comment

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

We should throw this error here like the row-based implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

var d bool
str, d, err = padZeroForBinaryType(str, b.tp, b.ctx)
if err != nil {
result.AppendNull()
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto, we should throw this err here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@qw4990 qw4990 removed the status/LGT1 Indicates that a PR has LGTM 1. label Sep 29, 2019
@SunRunAway SunRunAway removed their request for review September 30, 2019 09:28
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

lgtm

@qw4990 qw4990 requested a review from zz-jason September 30, 2019 23:38
@qw4990 qw4990 added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 30, 2019
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 1, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Oct 1, 2019

/run-all-tests

@sre-bot sre-bot merged commit 4b1a43e into pingcap:master Oct 1, 2019
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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants