pingcap / pingcap/tiflash

exchange sender should aovid memory copy with all bests

Open
#3,842 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/enhancement
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Enhancement

  • CHBlockChunkCodec->encode() applies for a block of continues memory (as string) to hold the data from a block. However, encode() resizes many times to achieve the goal size, this costs cannot be ignored.
    in detail, the resize starts from 15, then 30 ...

  • as gRPC recommend to resuse objects to send or receive data, we should reuse the MPPDataPacket when sending. (done in receiver)

  • to benefit from 2, we should limit the size of sending data at a range, thus the reused objects will work.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating CHBlockChunkCodec::encode() and the sender-side MPPDataPacket handling; compare the latter with the receiver reuse mentioned in the issue. Review the gRPC guidance linked in the issue and trace how outgoing blocks are sized and sent. Done means reducing repeated encode() resizing, reusing MPPDataPacket objects for sending, and constraining send sizes as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, grpc
Domain
backend, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.