[opt] avoid memcpy when building page#9727
Closed
dataroaring wants to merge 2 commits intoapache:masterfrom
Closed
[opt] avoid memcpy when building page#9727dataroaring wants to merge 2 commits intoapache:masterfrom
dataroaring wants to merge 2 commits intoapache:masterfrom
Conversation
yiguolei
reviewed
May 23, 2022
yiguolei
reviewed
May 23, 2022
e5ce453 to
803d9ec
Compare
PageBuilder finishes a page when the page is full, when the page is full, its size is greater than page size, so the last row would trigger an memcpy due to there is not enough space in faststring. The patch fix the problem by 2 changes: 1. PageBuilder reserves extra bytes If the last row is less than extra bytes, then no memory copy is triggered. 2. faststring uses malloc/realloc/free rather than new/delete realloc can avoid memcopy some times.
803d9ec to
6ca0ee9
Compare
Contributor
|
We're closing this PR because it hasn't been updated in a while. |
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.
PageBuilder finishes a page when the page is full, when the page is
full, its size is greater than page size, so the last row would
trigger an memcpy due to there is not enough space in faststring.
The patch fix the problem by 2 changes:
If the last row is less than extra bytes, then no memory copy is
triggered.
realloc can avoid memcopy some times.
The patch is not tested, so please do not merge.
Proposed changes
Issue Number: close #xxx
Problem Summary:
Describe the overview of changes.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...