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

Use pickle's loads/dumps as a faster deepcopy #5281

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kenodegard
Copy link
Contributor

@kenodegard kenodegard commented Apr 12, 2024

Description

Attempting to use pickle instead of deepcopy for a faster copy.

Split from:

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

Signed-off-by: Marcel Bargull <marcel.bargull@udo.edu>
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Apr 12, 2024
Copy link

codspeed-hq bot commented Apr 12, 2024

CodSpeed Performance Report

Merging #5281 will improve performances by 32.33%

Comparing kenodegard:pickle-vs-deepcopy (380a41c) with main (6982cbd)

Summary

⚡ 1 improvements
✅ 2 untouched benchmarks

Benchmarks breakdown

Benchmark main kenodegard:pickle-vs-deepcopy Change
test_pin_subpackage_benchmark 118.7 s 89.7 s +32.33%

@kenodegard kenodegard marked this pull request as ready for review April 12, 2024 20:14
@kenodegard kenodegard requested a review from a team as a code owner April 12, 2024 20:14
Copy link
Contributor

@beckermr beckermr left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

None yet

4 participants