-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Optimize PrestoBatchVectorSerializer [4/7]: Serialize MapVectors #12073
Open
kevinwilfong
wants to merge
6
commits into
facebookincubator:main
Choose a base branch
from
kevinwilfong:export-D68109612
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Optimize PrestoBatchVectorSerializer [4/7]: Serialize MapVectors #12073
kevinwilfong
wants to merge
6
commits into
facebookincubator:main
from
kevinwilfong:export-D68109612
Conversation
This file contains 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
kevinwilfong
requested review from
assignUser and
majetideepak
as code owners
January 13, 2025 18:11
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Jan 13, 2025
✅ Deploy Preview for meta-velox canceled.
|
This pull request was exported from Phabricator. Differential Revision: D68109612 |
kevinwilfong
pushed a commit
to kevinwilfong/velox
that referenced
this pull request
Jan 13, 2025
facebookincubator#12073) Summary: Pull Request resolved: facebookincubator#12073 Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
kevinwilfong
force-pushed
the
export-D68109612
branch
from
January 13, 2025 19:28
d111e4c
to
1afc1ea
Compare
This pull request was exported from Phabricator. Differential Revision: D68109612 |
kevinwilfong
pushed a commit
to kevinwilfong/velox
that referenced
this pull request
Jan 13, 2025
facebookincubator#12073) Summary: Pull Request resolved: facebookincubator#12073 Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
kevinwilfong
force-pushed
the
export-D68109612
branch
from
January 13, 2025 19:39
1afc1ea
to
04c6b11
Compare
This pull request was exported from Phabricator. Differential Revision: D68109612 |
Summary: Context: I plan to update the PrestoBatchVectorSerializer to write directly to the OutputStream rather than going through VectorStreams as I've seen this can greatly improve the speed. However, this ends up with many small writes to the OutputStream, which is typically a ByteOutputStream, so this leads to a lot of small allocations which is counter productive to the optimization I'm trying to make. To address this I add a BufferedOutputStream which wraps around another OutputStream, coalesces writes in a buffer, and flushes those as large writes to the wrapped OutputStream as the buffer fills up, or as needed. In my experiments I've seen the cost of the additional copy is far less then the cost of the tiny allocations. Differential Revision: D67997655
…incubator#12050) Summary: In PrestoSerializer we write the null bits to a ByteOutputStream. Presto's serialization format inverts the null flags from what Velox uses. This change adds an option to ByteOutputStream to do that negation on flush, rather than requiring the user to negate them when calling append. This makes it easier to write ranges of null bits without an additional copy, and reduces the level of mental gymnastics needed to reason about the null flags in the serializer. (It's analogous to the option ByteOutputStream already has to reverse the order of bits within a byte, again because of Presto's serialization format for null flags). Reviewed By: xiaoxmeng Differential Revision: D67994045
…rs (facebookincubator#12060) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing FlatVectors. Differential Revision: D68037258
facebookincubator#12072) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing RowVectors. Note, I will uncomment serializeColumn as I continue to implement the functions it calls. Differential Revision: D68044877
…ors (facebookincubator#12062) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing ArrayVectors. Differential Revision: D68047629
facebookincubator#12073) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
kevinwilfong
force-pushed
the
export-D68109612
branch
from
January 14, 2025 22:12
04c6b11
to
a45849a
Compare
kevinwilfong
pushed a commit
to kevinwilfong/velox
that referenced
this pull request
Jan 14, 2025
facebookincubator#12073) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
kevinwilfong
force-pushed
the
export-D68109612
branch
from
January 14, 2025 22:12
a45849a
to
56a19d5
Compare
This pull request was exported from Phabricator. Differential Revision: D68109612 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D68109612 |
kevinwilfong
pushed a commit
to kevinwilfong/velox
that referenced
this pull request
Jan 14, 2025
facebookincubator#12073) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
kevinwilfong
pushed a commit
to kevinwilfong/velox
that referenced
this pull request
Jan 14, 2025
facebookincubator#12073) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
kevinwilfong
pushed a commit
to kevinwilfong/velox
that referenced
this pull request
Jan 14, 2025
facebookincubator#12073) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
kevinwilfong
pushed a commit
to kevinwilfong/velox
that referenced
this pull request
Jan 14, 2025
facebookincubator#12073) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
kevinwilfong
pushed a commit
to kevinwilfong/velox
that referenced
this pull request
Jan 14, 2025
facebookincubator#12073) Summary: Context: This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream, rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as measured in Presto queries and other use cases). In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize function which will switch it to the new optimized writing path, therefore I will land these changes as a stack. In this diff: I provide the implementations for serializing MapVectors. Differential Revision: D68109612
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
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.
Summary:
Context:
This is a series of diffs in which I reimplement PrestoBatchVectorSerializer to write directly to the output stream,
rather than the indirect route it currently uses via VectorStreams. Reusing VectorStreams and much of the code
for PrestoIterativeVectorSerializer prevented us from capturing all of the performance benefits of writing data in
batches rather than row by row. These changes combined will speed up PrestoBatchVectorSerializer 2-3x (as
measured in Presto queries and other use cases).
In the final diff I will integrate the new serialization functions into PrestoBatchVectorSerializer's serialize
function which will switch it to the new optimized writing path, therefore I will land these changes as a stack.
In this diff:
I provide the implementations for serializing MapVectors.
Differential Revision: D68109612