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

Add benchmark for deepcopy #201

Merged
merged 6 commits into from
Jun 7, 2022

Conversation

eendebakpt
Copy link
Contributor

One python method that is currently not in the pyperformance benchmarks is deepcopy. This PRs adds a benchmark that tests performance of deepcopy on a nested dictionary and a dataclass.

The dictionary and dataclass have been chosen as example of structures can are often copied and then modified. (e.g. passing configuration settings to a method that modifies one of the settings before passing it on)

Fixes #199

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks mostly good. Aside from a few linting issues, there are only a couple small concerns.

@eendebakpt
Copy link
Contributor Author

This looks mostly good. Aside from a few linting issues, there are only a couple small concerns.

@ericsnowcurrently Changes made.

@ericsnowcurrently
Copy link
Member

Thanks, @eendebakpt. I'll take a look as soon as I can.

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM. There are a few really minor things that I won't even bother mentioning. 😄 The only thing worth looking at is the overhead of everything going on the in the various loops in the one benchmark. My recommendation doesn't impact readability all that much so you might as well apply it, just in case.

@ericsnowcurrently ericsnowcurrently self-requested a review June 7, 2022 13:43
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericsnowcurrently ericsnowcurrently merged commit 259edee into python:main Jun 7, 2022
@ericsnowcurrently
Copy link
Member

Thanks for the benchmark, @eendebakpt!

@eendebakpt eendebakpt deleted the deepcopy_benchmark branch June 7, 2022 18:26
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.

Benchmark suggestion: deepcopy
2 participants