Skip to content

golang: Use pointer receiver where appropriate#578

Merged
mjpt777 merged 1 commit intoaeron-io:masterfrom
lkramer:optimize_functions
Jul 31, 2018
Merged

golang: Use pointer receiver where appropriate#578
mjpt777 merged 1 commit intoaeron-io:masterfrom
lkramer:optimize_functions

Conversation

@lkramer
Copy link

@lkramer lkramer commented Jul 31, 2018

  • In order to avoid copying the whole structure functions should use pointer receiver when possible.
  • One exception is for enums, where it makes more sense to keep the copy receivers.

- In order to avoid copying the whole structure functions should use pointer receiver when possible.
- One exception is for enums, where it makes more sense to keep the copy receivers.
@mjpt777
Copy link
Contributor

mjpt777 commented Jul 31, 2018

Maybe @billsegall can comment on this?

@billsegall
Copy link
Contributor

I'm happy with this. It's 100% compatible and benchmarks faster on Encode. Good stuff.

@mjpt777 mjpt777 merged commit fe5a25d into aeron-io:master Jul 31, 2018
@lkramer lkramer deleted the optimize_functions branch August 1, 2018 04:21
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.

3 participants