Skip to content

do not use transfer map generated by protobuf - #17656

Merged
mergify[bot] merged 10 commits into
matrixorigin:mainfrom
w-zr:reduce-transfer-page-memory-usage
Jul 24, 2024
Merged

mergify[bot] merged 10 commits into
matrixorigin:mainfrom
w-zr:reduce-transfer-page-memory-usage

Conversation

@w-zr

@w-zr w-zr commented Jul 22, 2024

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #16653

What this PR does / why we need it:

The Protobuf-generated api.TransDestPos structure consumes 48 bytes of memory, despite the fact that we only utilize 3 int32 fields within it. To address this inefficiency and reduce memory consumption, in this pull request, I've implemented a hand-crafted api.TransDestPos structure that requires only 12 bytes.

In the previous codebase, during the merging process on the CN, large transfer maps would be marshaled into binary format using Protobuf and then written to an S3 file. In this pull request, I use batches with 5 columns to write down.

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Jul 22, 2024
@w-zr w-zr mentioned this pull request Jul 22, 2024
1 of 7 tasks
@w-zr
w-zr requested a review from LeftHandCold as a code owner July 24, 2024 03:34
@w-zr
w-zr force-pushed the reduce-transfer-page-memory-usage branch from 866a2f1 to 2b51f1e Compare July 24, 2024 04:02
@mergify
mergify Bot merged commit 3b77d12 into matrixorigin:main Jul 24, 2024
mergify Bot pushed a commit that referenced this pull request Aug 1, 2024
Reduce transfer page memory usage on 1.2 dev
cherry pick #17656

Approved by: @LeftHandCold, @zhangxu19830126, @XuPeng-SH, @sukki37
@w-zr
w-zr deleted the reduce-transfer-page-memory-usage branch August 8, 2024 07:44
iamlinjunhong pushed a commit to iamlinjunhong/matrixone that referenced this pull request Jun 25, 2025
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
The Protobuf-generated api.TransDestPos structure consumes 48 bytes of memory, despite the fact that we only utilize 3 int32 fields within it. To address this inefficiency and reduce memory consumption, in this pull request, I've implemented a hand-crafted api.TransDestPos structure that requires only 12 bytes.

In the previous codebase, during the merging process on the CN, large transfer maps would be marshaled into binary format using Protobuf and then written to an S3 file. In this pull request, I use batches with 5 columns to write down.

Approved by: @zhangxu19830126, @XuPeng-SH, @LeftHandCold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants