-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Do not pre-allocate memory when init vector stream #11211
Conversation
✅ Deploy Preview for meta-velox canceled.
|
@tanjialiang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
8773f2a
to
e4ec3be
Compare
@tanjialiang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tanjialiang nice catch. Maybe shadow in batch production for 1hr duration to see if there is any regression. Please help @kevinwilfong take a look. Thanks!
@@ -350,6 +350,9 @@ void ByteOutputStream::extend(int32_t bytes) { | |||
ranges_.emplace_back(); | |||
current_ = &ranges_.back(); | |||
lastRangeEnd_ = 0; | |||
if (bytes == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we check this early right after the check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. We need above code to initialize the above members.
@tanjialiang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@tanjialiang merged this pull request in daeff59. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
When creating and initializing vector streams we pre-allocate memory for all rows. This will cause unnecessary memory waste when the actual serialized row have many nulls. The null rows will not be serialized as payload, hence make use of the pre-allocated memory. Remove the pre-allocation to increase memory efficiency.
Memory usage of presto serializer decreased by up to 10x for some meta internal data.