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

Unsafe merge #485

Merged
merged 3 commits into from
Jan 22, 2021
Merged

Unsafe merge #485

merged 3 commits into from
Jan 22, 2021

Conversation

omry
Copy link
Owner

@omry omry commented Jan 22, 2021

Closes #482

Add support for another variant of merge which is about 15 times faster in a benchmark.
The difference is that this version destroys the input configs, so it should only used if the input configs should not be used after the merge call.
It's working by not copying input nodes on set, this making the input configs inconsistent (their nodes parent no longer points to the original config, so interpolations and other things will fail for them.
Another difference than the normal merge is that this merge variant is merging directly into the first config node, eliminating the need for another whole deepcopy.

pytest benchmark/benchmark.py --benchmark-sort=name -k merge:
image

@omry omry merged commit dff91d2 into master Jan 22, 2021
@omry omry deleted the unsafe_merge branch January 22, 2021 18:37
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.

Optimization: support unsafe_merge.
1 participant