Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Avoid allocating for wantlist entries #79

Merged
merged 2 commits into from
Feb 21, 2019
Merged

Conversation

Stebalien
Copy link
Member

This is probably a drop in the bucket but we allocate quite a few of these so we might as well make this as efficient as possible.

Each one is about 4 words wide (two for the CID, one for the priority, one for
the trash flag).
@ghost ghost assigned Stebalien Feb 20, 2019
@ghost ghost added the status/in-progress In progress label Feb 20, 2019
@hannahhoward
Copy link
Contributor

Makes sense. I have to admit I am a bit inexperienced with pass by value and slices in go, so I'm not sure I'd catch every potential error in reviewing this.

Copy link
Contributor

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

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

LGTM

@Stebalien Stebalien merged commit 39b96ac into master Feb 21, 2019
@ghost ghost removed the status/in-progress In progress label Feb 21, 2019
@Stebalien Stebalien deleted the feat/fewer-allocations branch February 21, 2019 01:03
@Stebalien
Copy link
Member Author

Personally, I pass by value for anything that's "plain old data" and reasonably small.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants