Skip to content

Conversation

@kolyshkin
Copy link
Contributor

Config and Process types are quite big (currently 554 and 368 bytes on a 64 bit Linux),
so using non-pointer receivers in its methods results in copying which
is totally unnecessary.

Change their methods to use pointer receivers.

The Config type is quite big (currently 554 bytes on a 64 bit Linux)
and using non-pointer receivers in its methods results in copying which
is totally unnecessary.

Change the methods to use pointer receivers.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The Process type is quite big (currently 368 bytes on a 64 bit Linux)
and using non-pointer receivers in its methods results in copying which
is totally unnecessary.

Change the methods to use pointer receivers.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Copy link
Member

@rata rata left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Just curious, is there some metric you care about that is improved with this or it's just a "Looking at the code I realized we are doing this, this is wasteful, let's avoid it"?

About the linter, do as you think it is best, fixing it doesn't seem hard... Although not sure I like the suggestion 😂

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