-
Notifications
You must be signed in to change notification settings - Fork 426
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
Use pickle's loads/dumps as a faster deepcopy #5281
Conversation
Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
CodSpeed Performance ReportMerging #5281 will improve performances by 66.17%Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only comment here is as last time. If we encounter a data structure that does not pickle, we will get an error. It might be worth making a separate helper function with a try except block falling back to deepcopy.
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
@kenodegard @dholth Are we worried about errors where something cannot be pickled or shall we merge this one? The test failures appear to be unrelated warnings appearing w/ python 3.12:
I don't follow it totally but it appears to happen in extractions of packages. |
Since this is currently only applied to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a news item and then merge!
Yep, this is the |
do you have an example of this or a link to the docs? I am not following. |
pre-commit.ci autofix |
Thanks for this! I've been testing it out, and with this and #5384 rerender time is reduced by ~90%, from over 30 minutes to about 4 on some recipes with a large variant matrix (petsc4py). FWIW, I spent a little time looking into making I also noticed in conda-forge/conda-smithy#1967 that deepfreeze is quite a lot more expensive than using HashableDict (deepfreeze takes ~10x the time of |
Description
Attempting to use
pickle
instead ofdeepcopy
for a faster copy.Split from:
extract_package_and_build_text
call #5253Checklist - did you ...
Add a file to thenews
directory (using the template) for the next release's release notes?Add / update necessary tests?Add / update outdated documentation?