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
|
beckermr
left a comment
There was a problem hiding this comment.
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 |
beckermr
left a comment
There was a problem hiding this comment.
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. |
|
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
pickleinstead ofdeepcopyfor a faster copy.Split from:
extract_package_and_build_textcall #5253Checklist - did you ...
Add a file to thenewsdirectory (using the template) for the next release's release notes?Add / update necessary tests?Add / update outdated documentation?