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 builtinRepeatSig #12014

Merged
merged 12 commits into from
Sep 4, 2019

Conversation

qw4990
Copy link
Contributor

@qw4990 qw4990 commented Sep 3, 2019

What problem does this PR solve?

Implement vectorized evaluation for builtinRepeatSig.

What is changed and how it works?

Almost 1.5s faster than before:

BenchmarkVectorizedBuiltinFunc/builtinRepeatSig-VecBuiltinFunc-12                          50000             29567 ns/op
BenchmarkVectorizedBuiltinFunc/builtinRepeatSig-NonVecBuiltinFunc-12                       30000             45092 ns/op

Check List

Tests

  • Unit test

@codecov
Copy link

codecov bot commented Sep 3, 2019

Codecov Report

Merging #12014 into master will decrease coverage by 0.0389%.
The diff coverage is 64.1025%.

@@               Coverage Diff               @@
##             master     #12014       +/-   ##
===============================================
- Coverage   81.3794%   81.3405%   -0.039%     
===============================================
  Files           446        447        +1     
  Lines         95658      95646       -12     
===============================================
- Hits          77846      77799       -47     
- Misses        12287      12310       +23     
- Partials       5525       5537       +12

expression/bench_test.go Outdated Show resolved Hide resolved
expression/bench_test.go Show resolved Hide resolved
expression/bench_test.go Show resolved Hide resolved
expression/bench_test.go Outdated Show resolved Hide resolved
expression/bench_test.go Show resolved Hide resolved
expression/bench_test.go Outdated Show resolved Hide resolved
expression/bench_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

expression/bench_test.go Show resolved Hide resolved
expression/builtin_string_vec.go Outdated Show resolved Hide resolved
expression/builtin_string_vec.go Show resolved Hide resolved
@qw4990 qw4990 added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 4, 2019
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. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 4, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 4, 2019

/run-all-tests

@qw4990 qw4990 merged commit ba8461d into pingcap:master Sep 4, 2019
@zz-jason
Copy link
Member

zz-jason commented Sep 9, 2019

to #12058

@js00070
Copy link
Contributor

js00070 commented Oct 12, 2019

i find a TODO at line 34 in expression/builtin_string_vec.go

// TODO: introduce vectorized null-bitmap to speed it up.
if buf.IsNull(i) || buf2.IsNull(i) {
    result.AppendNull()
    continue
}

I'm curious about how this should be done.

Is it right to use function MergeNulls directly? like this

buf.MergeNulls(buf2) // before the for loop
for i := 0; i < n; i++ {
	if buf.IsNull(i) { // reduce a IsNull call here
		result.AppendNull()
		continue
	}

I tried to run benchmark test but didn't find a significant performance improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression 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