GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add benchmark for deepcopy by eendebakpt · Pull Request #201 · python/pyperformance

Conversation

@eendebakpt

@eendebakpt eendebakpt commented May 15, 2022

Copy link
Copy Markdown
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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
eendebakpt added 2 commits May 15, 2022 20:53
@eendebakpt
Add benchmark for deepcopy
c95912f
@eendebakpt
fix typo
9a96b75
@ericsnowcurrently
ericsnowcurrently self-requested a review May 16, 2022 16:25
@eendebakpt eendebakpt mentioned this pull request May 18, 2022
Benchmark suggestion: deepcopy #199
Closed
ericsnowcurrently
ericsnowcurrently requested changes May 24, 2022
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

eendebakpt and others added 3 commits May 24, 2022 20:35
@eendebakpt @ericsnowcurrently
Update pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
1c432b5
Co-authored-by: Eric Snow <[email protected]>
@eendebakpt @ericsnowcurrently
Update pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
c78237a
Co-authored-by: Eric Snow <[email protected]>
@eendebakpt
address review comments
a777604
@eendebakpt
eendebakpt force-pushed the deepcopy_benchmark branch from a83c0a4 to a777604 Compare May 24, 2022 20:05
@eendebakpt
eendebakpt requested a review from ericsnowcurrently May 28, 2022 20:40
@eendebakpt

eendebakpt commented May 31, 2022

Copy link
Copy Markdown
Contributor Author

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

@ericsnowcurrently Changes made.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently

ericsnowcurrently commented May 31, 2022

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ericsnowcurrently
ericsnowcurrently requested changes Jun 6, 2022
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@eendebakpt @ericsnowcurrently
Update pyperformance/data-files/benchmarks/bm_deepcopy/run_benchmark.py
5e9c47d
Co-authored-by: Eric Snow <[email protected]>
@ericsnowcurrently
ericsnowcurrently self-requested a review June 7, 2022 13:43
ericsnowcurrently
ericsnowcurrently approved these changes Jun 7, 2022
View reviewed changes

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ericsnowcurrently
ericsnowcurrently merged commit 259edee into python:main Jun 7, 2022
@ericsnowcurrently

ericsnowcurrently commented Jun 7, 2022

Copy link
Copy Markdown
Member

Thanks for the benchmark, @eendebakpt!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

Reviewers

@ericsnowcurrently ericsnowcurrently ericsnowcurrently approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Benchmark suggestion: deepcopy

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@eendebakpt @ericsnowcurrently
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.