Skip to content

improve: use chan *message instead of chan []*message as queueCh - #1283

Merged
RobertIndie merged 2 commits into
apache:masterfrom
nodece:improve-dispatcher
Oct 8, 2024
Merged

RobertIndie merged 2 commits into
apache:masterfrom
nodece:improve-dispatcher

Conversation

@nodece

@nodece nodece commented Sep 11, 2024 •

Copy link
Copy Markdown
Member

Motivation

We currently use chan []*message as queueCh, and use the slice to stage the messages to send the message to the parent consumer, this will result in excessive use of memory.

This PR optimizes potentially reducing overall memory overhead.

Modifications

  • Use chan *message instead of chan []*message.
  • Fix test.

@nodece nodece changed the title improve: use chan *message instead of channel []*message as queueCh improve: use chan *message instead of chan []*message as queueCh Sep 11, 2024
@nodece
nodece marked this pull request as draft September 12, 2024 07:43
@nodece
nodece marked this pull request as ready for review September 13, 2024 08:49
@nodece nodece added this to the v0.14.0 milestone Sep 13, 2024
@RobertIndie RobertIndie modified the milestones: v0.14.0, v0.15.0 Oct 8, 2024
@RobertIndie
RobertIndie merged commit 06f2693 into apache:master Oct 8, 2024
@nodece
nodece deleted the improve-dispatcher branch October 8, 2024 10:57
shibd added a commit to shibd/pulsar-client-go that referenced this pull request Nov 26, 2024
BewareMyPower pushed a commit that referenced this pull request Nov 26, 2024
### Motivation

For the issue please refer to the PR description: #1310

Here have an analysis: #1310 (comment)

### Modifications
- Rever #1283 
- Add test from #1310 to cover `queueCh` never not full.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants