Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

nodece
Copy link
Member

@nodece nodece commented Sep 11, 2024

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
7 checks passed
@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