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

Implement improved dup() and copy() #355

Merged
merged 2 commits into from
Nov 9, 2023
Merged

Implement improved dup() and copy() #355

merged 2 commits into from
Nov 9, 2023

Conversation

joente
Copy link
Member

@joente joente commented Nov 9, 2023

Description

When creating a duplicate or copy with a large deep value, potentially many things will be created when a thing contains a self reference. This pull request improves duplicates or copies by using a single copy for the same thing if found by recursion. This can drastically improve the performance and is usually what you want as a user.

Type of change

  • Improvement of existing functionality. While we do not expect existing code depends on the old behavior, the new behavior is different so you might want to check where copy() or dup() is used with a deep level greater or equal to two. For example my_thing.dup(2) might yield a different result.

How Has This Been Tested?

  • Update test code

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

@joente joente merged commit 9118e8e into main Nov 9, 2023
1 check passed
@joente joente deleted the dupcopy branch March 18, 2024 11:07
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.

1 participant