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

feat: re-generate protobufs with gogofaster #422

Closed
wants to merge 1 commit into from

Conversation

Stebalien
Copy link
Member

This removes the pointer indirection from all values and saves us an allocation. We never actually try to distinguish between a field being missing and the "zero" value anyways.

This removes the pointer indirection from all values and saves us an
allocation. We never actually try to distinguish between a field being
missing and the "zero" value anyways.
@Stebalien Stebalien requested a review from vyzo May 11, 2021 02:38
@Stebalien
Copy link
Member Author

Motivation: pubsub does a noticeable amount of allocation. We were noticing this on a gateway due to pubsub handshake messages.

@Stebalien
Copy link
Member Author

It looks like this is changing the number of messages we're sending, possibly because we're sending "zero values"? We shouldn't be doing that, but it looks like that might be the case.

@vyzo
Copy link
Collaborator

vyzo commented May 11, 2021

yeah, the test failure is interesting -- rerunning to see if it is a fluke.

Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

I am in favor of this, but we have to double check for nil checks that would indicate the missing value.
I think that's what might be happening with the test failure.

@Stebalien
Copy link
Member Author

Stebalien commented May 11, 2021

I think that's what might be happening with the test failure.

Ah... we're likely checking "is this slice nil". Unfortunately, if I change:

var x *[]byte
if x == nil
var x []byte
if x == nil

Nothing will break. Will check.

@Stebalien
Copy link
Member Author

Ok, found it. It's because the topic ID will always be encoded now, even if unset. This is more complicated than it's worth for now.

@Stebalien Stebalien closed this May 11, 2021
@Stebalien Stebalien deleted the feat/remove-allocations branch August 6, 2024 20:47
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