-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Conversation
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.
This looks mostly good. Aside from a few linting issues, there are only a couple small concerns.
pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
Outdated
Show resolved
Hide resolved
pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
Outdated
Show resolved
Hide resolved
pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
Outdated
Show resolved
Hide resolved
pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
Outdated
Show resolved
Hide resolved
pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Eric Snow <[email protected]>
Co-authored-by: Eric Snow <[email protected]>
a83c0a4
to
a777604
Compare
@ericsnowcurrently Changes made. |
Thanks, @eendebakpt. I'll take a look as soon as I can. |
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.
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.
pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Eric Snow <[email protected]>
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.
LGTM
Thanks for the benchmark, @eendebakpt! |
One python method that is currently not in the pyperformance benchmarks is
deepcopy
. This PRs adds a benchmark that tests performance ofdeepcopy
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