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

reduce allocations #12

Merged
merged 3 commits into from
Oct 5, 2018
Merged

reduce allocations #12

merged 3 commits into from
Oct 5, 2018

Conversation

Stebalien
Copy link
Member

  1. Change the protobuf code generation to reduce allocations. We get a lot of wantlists.
  2. Avoid allocating task keys.

1. Use a `taskEntryKey` *type* instead of a string (now that both peer IDs and
CIDs are hashable).
2. Get rid of all uses of `cid.KeyString` (mostly just for type safety). This
also means we don't need to parse the CID and allocate to convert it *back* from
a string.
This was showing up as a major source of heap allocations (well, at least when
the DHT is in client-only mode).
@ghost ghost assigned Stebalien Oct 4, 2018
@ghost ghost added the status/in-progress In progress label Oct 4, 2018
@Stebalien
Copy link
Member Author

This is a starting point. We may also want to use a few pools (e.g., for tasks) but we can see what hotspots are left after merging this.

@Stebalien Stebalien requested a review from kevina October 4, 2018 19:39
@Stebalien
Copy link
Member Author

(this isn't going to break anything so I'm going to merge and revert later if we decide this isn't something we want to do)

@Stebalien Stebalien merged commit 5754d5e into master Oct 5, 2018
@ghost ghost removed the status/in-progress In progress label Oct 5, 2018
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.

1 participant