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 comprehensions benchmark by carljm · Pull Request #265 · python/pyperformance

Conversation

@carljm

@carljm carljm commented Feb 15, 2023

Copy link
Copy Markdown
Member

This benchmark is loosely based on real code in an internal workload where it makes heaviest use of list comprehensions, obviously simplified and anonymized.

Sorry, something went wrong.

Uh oh!

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

mdboom, itamaro, arhadthedev, and tekknolagi reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
Carl Meyer
add comprehensions benchmark
9e76053
@carljm

carljm commented Feb 15, 2023

Copy link
Copy Markdown
Member Author

The 3.12 failure looks like a greenlet build issue and not related to this PR.

The pre-3.10 failures are expected I guess; I thought putting requires-python = ">=3.10" in the pyproject.toml for the new benchmark would cause it to be skipped on earlier python versions, but apparently not. I guess I will just remove the 3.10-only type annotations from the benchmark (they aren't really relevant or needed anyway) so it can work on 3.7+.

All reactions

Sorry, something went wrong.

Uh oh!

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

Carl Meyer
make annotations 3.7-compatible
58bcf18
@carljm
carljm requested review from markshannon and mdboom February 15, 2023 16:54
mdboom
mdboom approved these changes Feb 15, 2023
View reviewed changes
@carljm

carljm commented Feb 17, 2023

Copy link
Copy Markdown
Member Author

@mdboom is there a particular reviewer you are waiting on before merging this? I requested review from you and @markshannon; happy to have Mark look at it if he has time, but if not, do you feel comfortable going ahead and merging it?

All reactions

Sorry, something went wrong.

Uh oh!

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

@arhadthedev

arhadthedev commented Feb 18, 2023

Copy link
Copy Markdown
Member

@mdboom is a triager, not a core developer so cannot merge.

@kumaraditya303 could you have a look please?

All reactions

Sorry, something went wrong.

Uh oh!

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

@carljm

carljm commented Feb 18, 2023

Copy link
Copy Markdown
Member Author

Ah, makes sense, thanks. For some reason I thought pyperformance had a different maintenance team from core CPython and that @mdboom was on it :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@kumaraditya303

kumaraditya303 commented Feb 18, 2023

Copy link
Copy Markdown
Contributor

LGTM but before merging I would like to see a comparison with one of your PRs which implements comprehensions inlining against main.

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon

markshannon commented Feb 20, 2023

Copy link
Copy Markdown
Member

LGTM.

before merging I would like to see a comparison with one of your PRs which implements comprehensions inlining against main.

That seems backwards. Whether an optimization works on a particular benchmark determines the value of the optimization, not the benchmark.

The question is "does this benchmark represent real-world code?", or the weaker form "does this benchmark make the benchmark suite more closely represent real-world code?"

Answering those question objectively is difficult without a huge amount of real-word data, so we need to apply judgement.

Given that list comprehensions are clearly under represented in the rest of benchmarks, I think that this does improve the benchmark suite overall.

@kumaraditya303 do you have reason to think otherwise?

All reactions

Sorry, something went wrong.

Uh oh!

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

@kumaraditya303

kumaraditya303 commented Feb 20, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

do you have reason to think otherwise?

I don't disagree, I was just curious of how much speedup inlining can make on this benchmark, anyways I'll merge this now.

carljm reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@kumaraditya303
kumaraditya303 merged commit 433550e into python:main Feb 20, 2023
@carljm

carljm commented Feb 20, 2023

Copy link
Copy Markdown
Member Author

@kumaraditya303 Thanks for merging! Preliminary numbers last week showed an 11-12% improvement in this benchmark from full inlining (python/cpython#101441). I haven't measured it yet against python/cpython#101310. Now that it's merged I'll do a careful measurement against both of those PRs.

All reactions

Sorry, something went wrong.

Uh oh!

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

@carljm
carljm deleted the comps branch February 20, 2023 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mdboom mdboom mdboom approved these changes
@markshannon markshannon Awaiting requested review from markshannon

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.

Uh oh!

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

5 participants

@carljm @arhadthedev @kumaraditya303 @markshannon @mdboom
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.