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

feat(opt): Reduce array cloning by initializing refcounts to 0, not 1 #6577

Closed
wants to merge 11 commits into from

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Nov 21, 2024

Description

Problem*

Summary*

I noticed after storing an array in a variable we were always issuing an inc_rc which lead to arrays having an rc of 2 to begin with instead of 1, meaning the first mutation would always be cloned.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Base automatically changed from jf/rearrange-inc-rcs to master November 21, 2024 20:36
@jfecher
Copy link
Contributor Author

jfecher commented Nov 22, 2024

This PR requires #6585 first

@jfecher
Copy link
Contributor Author

jfecher commented Dec 4, 2024

Closing in favor of #6685

@jfecher jfecher closed this Dec 4, 2024
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