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

Use *packets.Packet for outbound chan #176

Merged
merged 3 commits into from
Feb 22, 2023
Merged

Conversation

thedevop
Copy link
Collaborator

@thedevop thedevop commented Feb 22, 2023

This is the minimum change needed to use *packets.Packet for outbound chan. I do suggest more use of point to packets.Packet for internal calls, as it will result in less copy/memory allocation, for example cl.WritePacket. Fix #175.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4240320623

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.589%

Totals Coverage Status
Change from base Build 4226100386: 0.0%
Covered Lines: 5100
Relevant Lines: 5173

💛 - Coveralls

Copy link
Collaborator

@mochi-co mochi-co left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you for opening it! Everything passes as expected so I'll merge it in. Incidentally I noticed a very marginal performance increase in the benchmarks.

@@ -1408,7 +1408,7 @@ func TestPublishToClientExceedClientWritesPending(t *testing.T) {
s.Clients.Add(cl)

for i := int32(0); i < cl.ops.capabilities.MaximumClientWritesPending; i++ {
cl.State.outbound <- packets.Packet{}
cl.State.outbound <- &packets.Packet{}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think new(packets.Packet) would work better here for consistency

@mochi-co mochi-co merged commit a302c9d into mochi-mqtt:master Feb 22, 2023
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.

Large memory consumption with high concurrent connections
3 participants