*: reduce object allocation by reuse chunk column#29064
*: reduce object allocation by reuse chunk column#29064ti-chi-bot merged 5 commits intopingcap:masterfrom
Conversation
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
|
LGTM. But I noticed we only reusing the chunks for result set. Is it necessary to reuse them for intermediate executors? |
|
LGTM, but I'm not reviewer. :( |
Yes, we can, but it would affect another 300 lines, because there are so many place call the |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 0433c3f |
|
@tiancaiamao: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
)" This reverts commit 36bc41a.
)" This reverts commit 36bc41a.
What problem does this PR solve?
Reduce object allocation by reuse the chunk column.
Close #28340
Problem Summary:
For every query, we will create the chunk...
This is unnecessary, after the chunk data is drained by the MySQL client, nobody will use the chunk again, so it should be safe to reuse the chunk.
What is changed and how it works?
Many changes... maybe I should split the PR to the lib and the use of the lib?
chunkAllocfor each client connection, allocate chunks from it, and reset for reuse after chunk sent to the clientNewChunkFromAllocatormethod to theResultSetinterfaceFor the chunk Allocator implementation, I decouple the chunk object into chunk column objects for reuse, because the Chunk differs a lot, while the chunk column are fix sized.
Allocating chunk will try to take a empty
Chunkobject from thefreelist, and fill the columns from thecolumnAlloc,and after reset,
allocatedchunks will turn intofreewith their columns collected into the poolColumnAllocator:Check List
Tests
Side effects
Documentation
Release note