executor: introduce the column buffer allocator for vectorized evaluation#11743
Merged
Conversation
599d62f to
888439d
Compare
Codecov Report
@@ Coverage Diff @@
## master #11743 +/- ##
===========================================
Coverage 81.4601% 81.4601%
===========================================
Files 434 434
Lines 93458 93458
===========================================
Hits 76131 76131
Misses 11879 11879
Partials 5448 5448 |
zz-jason
reviewed
Aug 15, 2019
zz-jason
reviewed
Aug 15, 2019
| r.head = 0 | ||
| } | ||
| r.size-- | ||
| return buf, nil |
Member
There was a problem hiding this comment.
Should we call buf.Reserve() before returning it?
Contributor
Author
There was a problem hiding this comment.
There are multiple ways to initialize a buffer (Resize/Reset/Reserve) and in this method, the allocator doesn't know which way is better.
Therefore it seems more appropriate to let users initialize these buffers themselves.
XuHuaiyu
reviewed
Aug 15, 2019
Contributor
Author
Contributor
|
/run-all-tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
In vectorized evaluation, some expressions need buffers to store their children's data.
This PR introduces an interface
columnBufferAllocatorto do this job.Being compared with adding these buffers as expression's struct fields like
struct someBuiltinFunc{baseBuiltinFunc, buffer1, buffer2}, this way has two advantages:What is changed and how it works?
columnBufferAllocator.localSliceBuffer.Now, the
localSliceBufferis implemented bySlice+Lock, and the slight performance drawback seems acceptable:All changes are new code and unit tests, so it's easy to review.
Check List
Tests