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 'builtinCoalesceJSONSig' #12915

Closed
wants to merge 1 commit into from
Closed

expression: implement vectorized evaluation for 'builtinCoalesceJSONSig' #12915

wants to merge 1 commit into from

Conversation

tsthght
Copy link
Contributor

@tsthght tsthght commented Oct 24, 2019

What problem does this PR solve?

Implement vectorized evaluation for builtinCoalesceJSONSig, for #12104

What is changed and how it works?

BenchmarkVectorizedBuiltinCompareFunc/builtinCoalesceJSONSig-VecBuiltinFunc-8         	   10000	    172660 ns/o   69806 B/op	     837 allocs/op
BenchmarkVectorizedBuiltinCompareFunc/builtinCoalesceJSONSig-NonVecBuiltinFunc-8      	   50000	     28641 ns/o       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinCompareFunc/builtinCoalesceJSONSig-VecBuiltinFunc#01-8      	    5000	    257775 ns/o  117342 B/op	    1034 allocs/op
BenchmarkVectorizedBuiltinCompareFunc/builtinCoalesceJSONSig-NonVecBuiltinFunc#01-8   	   50000	     30344 ns/o       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinCompareFunc/builtinCoalesceJSONSig-VecBuiltinFunc#02-8      	    5000	    276389 ns/o  117744 B/op	    1047 allocs/op
BenchmarkVectorizedBuiltinCompareFunc/builtinCoalesceJSONSig-NonVecBuiltinFunc#02-8   	   50000	     30684 ns/o       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinCompareFunc/builtinCoalesceJSONSig-VecBuiltinFunc#03-8      	  200000	     10548 ns/o       0 B/op	       0 allocs/op
BenchmarkVectorizedBuiltinCompareFunc/builtinCoalesceJSONSig-NonVecBuiltinFunc#03-8   	   50000	     31831 ns/o       0 B/op	       0 allocs/op

Check List

Tests

  • Unit test

@tsthght tsthght requested a review from a team as a code owner October 24, 2019 06:48
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Oct 24, 2019
@ghost ghost requested review from wshwsh12 and removed request for a team October 24, 2019 06:48
@zyxbest
Copy link
Contributor

zyxbest commented Oct 24, 2019

/run-unit-test

Copy link
Contributor

@wshwsh12 wshwsh12 left a comment

Choose a reason for hiding this comment

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

The benchmark result is not really good. It has too much performance regression.

if err != nil {
return err
}
defer b.bufAllocator.put(buf)
Copy link
Contributor

Choose a reason for hiding this comment

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

defer does not execute until the function return. So in this case, there will alloc len(b.getArgs()) columns and will be gc when this function return?

var buf *chunk.Column
var err error
n := input.NumRows()
res := make(map[int]*json.BinaryJSON)
Copy link
Contributor

Choose a reason for hiding this comment

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

Using map to record the reuslt is too slow. Any other idea?

@qw4990
Copy link
Contributor

qw4990 commented Oct 25, 2019

All functions in this document are suggested to be vectorized by using go-gen, and @gtygo is working on using go-gen to generate all Coalesce functions.
So how about waiting @gtygo finish these functions?

@tsthght
Copy link
Contributor Author

tsthght commented Oct 25, 2019

All functions in this document are suggested to be vectorized by using go-gen, and @gtygo is working on using go-gen to generate all Coalesce functions.

OK, I will close this PR~

@tsthght tsthght closed this Oct 25, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants