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 builtinExtractDurationSig #13489

Merged
merged 15 commits into from
Dec 20, 2019

Conversation

icditwang
Copy link
Contributor

@icditwang icditwang commented Nov 15, 2019

PCP #12103

What problem does this PR solve?

implement vectorized evaluation for builtinExtractDurationSig

What is changed and how it works?

BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc-8         	   27074	     45984 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc-8      	   17084	     70361 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#01-8      	   29985	     40106 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#01-8   	   17856	     67603 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#02-8      	   32161	     38366 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#02-8   	   18800	     66002 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#03-8      	   41064	     30228 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#03-8   	   21272	     53396 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#04-8      	   17841	     66772 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#04-8   	   12922	    123070 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#05-8      	   16162	     72750 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#05-8   	   12325	     98556 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#06-8      	   22459	     53246 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#06-8   	   15184	     78811 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#07-8      	   20792	     57100 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#07-8   	   12308	     91380 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#08-8      	   25328	     48678 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#08-8   	   13377	     99765 ns/op	       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-VecBuiltinFunc#09-8      	   24108	     48568 ns/op	       8 B/op	       1 allocs/op
BenchmarkVectorizedBuiltinTimeFunc/builtinExtractDurationSig-NonVecBuiltinFunc#09-8   	   16314	     72280 ns/op	       0 B/op	       0 allocs/op

Check List

Tests

  • Unit test

@icditwang icditwang requested a review from a team as a code owner November 15, 2019 06:58
@sre-bot
Copy link
Contributor

sre-bot commented Nov 15, 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 15, 2019
@ghost ghost requested review from SunRunAway and wshwsh12 and removed request for a team November 15, 2019 06:58
@icditwang icditwang force-pushed the builtinExtractDurationSig branch from cb5dc86 to e393d76 Compare November 20, 2019 10:33
@codecov
Copy link

codecov bot commented Nov 20, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@f1c4011). Click here to learn what that means.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13489   +/-   ##
===========================================
  Coverage          ?   80.3859%           
===========================================
  Files             ?        474           
  Lines             ?     117941           
  Branches          ?          0           
===========================================
  Hits              ?      94808           
  Misses            ?      15706           
  Partials          ?       7427

}
unitI := unit.GetString(i)
duration.Duration = durIs[i]
duration.Fsp = int8(types.UnspecifiedFsp)
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be b.args[1].GetType().Decimal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed that while I use gofmt command,the ast.Now's test case changed its style.Is it ok?

@sre-bot
Copy link
Contributor

sre-bot commented Nov 28, 2019

@icditwang, please update your pull request.

@icditwang icditwang force-pushed the builtinExtractDurationSig branch from f9f7726 to 57c3d02 Compare November 28, 2019 03:12
@icditwang
Copy link
Contributor Author

@qw4990 Anything need change in this pr?

@sre-bot
Copy link
Contributor

sre-bot commented Dec 9, 2019

@icditwang, please update your pull request.

1 similar comment
@sre-bot
Copy link
Contributor

sre-bot commented Dec 16, 2019

@icditwang, please update your pull request.

@SunRunAway SunRunAway self-requested a review December 18, 2019 05:53
}
unitI := unit.GetString(i)
duration.Duration = durIs[i]
duration.Fsp = int8(b.args[1].GetType().Decimal)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can cache the result of int8(b.args[1].GetType().Decimal) outside the for loop.

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, please address SunRunAway's comments.

@qw4990 qw4990 added status/LGT1 Indicates that a PR has LGTM 1. and removed status/ReqChange labels Dec 18, 2019
@icditwang icditwang force-pushed the builtinExtractDurationSig branch from fdd80dd to 31870f2 Compare December 18, 2019 12:22
@icditwang icditwang requested a review from SunRunAway December 18, 2019 12:27
Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

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

LGTM

@SunRunAway SunRunAway added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Dec 19, 2019
@SunRunAway SunRunAway removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 19, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 19, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Dec 19, 2019

@icditwang merge failed.

@qw4990
Copy link
Contributor

qw4990 commented Dec 20, 2019

/run-integration-copr-test

@qw4990 qw4990 merged commit 3368645 into pingcap:master Dec 20, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 20, 2019

@icditwang complete task #12103 and get 50 score, currerent score 500.

@sre-bot
Copy link
Contributor

sre-bot commented Dec 20, 2019

Congratulations, you get 500 score from easy level tasks in PCP-S1, and if your PRs in reviewed stage all got merged, the score will be 650, try some medium and hard tasks!(you can not reward from easy and vector tasks now)

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.

6 participants