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

chore: store Arc<NodeInner> and Arc<NetworkInner> to reduce cloning and reference counting #1906

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

RolandSherwin
Copy link
Member

  • Currently, we manually put Arc<> on fields inside node and network. And sometimes if we forget to do that, we end up cloning that field way too many times. Also, Arc'ing the entire struct is better than Arc'ing individual fields as it will reduce the number of reference counting vars.
  • Thus, we arc the entire struct and wrap it so that we don't leak the Arc to the caller.

@RolandSherwin RolandSherwin added this pull request to the merge queue Jun 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 19, 2024
@RolandSherwin RolandSherwin added this pull request to the merge queue Jun 19, 2024
Merged via the queue into maidsafe:main with commit bf8b74c Jun 19, 2024
40 checks passed
@RolandSherwin RolandSherwin deleted the outer_arc_3 branch June 19, 2024 11:18
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