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 — gh-100165: Add BINARY_OP_AND_INT for integer & operation. by corona10 · Pull Request #100166 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Dec 11, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Add BINARY_AND_INT to specialize BINARY_AND for int #100165

According to stats, BINARY_AND_INT will cover 50.7% of failures.

Sorry, something went wrong.

Uh oh!

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

All reactions
@corona10
corona10 requested a review from markshannon December 11, 2022 04:24
@bedevere-bot bedevere-bot mentioned this pull request Dec 11, 2022
Add BINARY_AND_INT to specialize BINARY_AND for int #100165
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Dec 11, 2022
@netlify

netlify Bot commented Dec 11, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

✅ Deploy Preview for python-cpython-preview canceled.

Name Link
🔨 Latest commit bc11c05
🔍 Latest deploy log https://app.netlify.com/sites/python-cpython-preview/deploys/6396bb1824f6370008b6aceb
All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10
pythongh-100165: Add BINARY_OP_AND_INT for integer & operation.
382e3af
@corona10
corona10 force-pushed the gh-100165 branch from 8f70e0b to 382e3af Compare December 11, 2022 04:25
@corona10 corona10 changed the title gh-100165: Add BINARY_OP_AND_INT for integer & operation. [WIP] gh-100165: Add BINARY_OP_AND_INT for integer & operation. Dec 11, 2022
@corona10
Implement specializer
52897f5
@corona10 corona10 changed the title [WIP] gh-100165: Add BINARY_OP_AND_INT for integer & operation. gh-100165: Add BINARY_OP_AND_INT for integer & operation. Dec 11, 2022
@corona10

corona10 commented Dec 11, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Stats

  • Specialization attempts success ratio for BINARY_OP: 33.3% -> 62.7%
  • Specialization attempts failure ratio for BINARY_OP: 66.7% -> 37.3%
  • AS-IS: https://gist.github.com/corona10/c2393fac9604716026087804172e21a5
  • TO-BE: https://gist.github.com/corona10/962ec4c447cfeec584bc0da0f956468c
All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10
corona10 requested a review from brandtbucher December 11, 2022 06:09
@corona10
nit
307bfad
Fidget-Spinner
Fidget-Spinner approved these changes Dec 12, 2022
View reviewed changes

@Fidget-Spinner Fidget-Spinner 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. Thanks Dong-hee.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Misc/NEWS.d/next/Core and Builtins/2022-12-11-13-22-59.gh-issue-100165.GE1Iui.rst Resolved

Uh oh!

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

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Dec 12, 2022
@corona10 @Fidget-Spinner
Update Misc/NEWS.d/next/Core and Builtins/2022-12-11-13-22-59.gh-issu…
bc11c05
…e-100165.GE1Iui.rst

Co-authored-by: Ken Jin <[email protected]>
@Fidget-Spinner

Fidget-Spinner commented Dec 12, 2022

Copy link
Copy Markdown
Member

Let's wait for Mark before merging this.

corona10 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@brandtbucher

brandtbucher commented Dec 13, 2022

Copy link
Copy Markdown
Member

Does this improve the pyperformance results at all? If not, I'd suggest that we take a different approach (discussed with @markshannon this morning):

Rather than try to add more and more non-performance-improving BINARY_OP specializations to get stats up (with diminishing returns), one idea I'm starting to work on this week is a single specialization that covers, for example, all remaining operations between int or float operands, by pre-populating a table of function pointers that handle each lhs_type x rhs_type x op combination, and having a single specialization that handles all of those by dispatching from the table.

Once we get that working, the mechanism could be extended to cache the results of recent operator lookups (like the method cache) or even allow extensions like NumPy to register custom specializations.

I'd be happy to run the pyperformance numbers for you if you want. I also have a small hunch that the pyperformance suite over-represents how often integer & actually occurs in real code (similar to how it over-represents subscripting array.array).

All reactions

Sorry, something went wrong.

Uh oh!

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

@brandtbucher

brandtbucher commented Dec 13, 2022

Copy link
Copy Markdown
Member

Also, see our previous rejection of this idea: #94109.

All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10

corona10 commented Dec 13, 2022

Copy link
Copy Markdown
Member Author

Rather than try to add more and more non-performance-improving BINARY_OP specializations to get stats up (with diminishing returns)

Ah, I agree that what we have to go.

I'd be happy to run the pyperformance numbers for you if you want

Same result with Mark's last running: #94109 (comment)

Well, I agree that this PR is not worth to merge.

All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10 corona10 closed this Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Fidget-Spinner Fidget-Spinner Fidget-Spinner approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
@brandtbucher brandtbucher Awaiting requested review from brandtbucher

Uh oh!

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

Assignees

No one assigned

Labels

awaiting merge

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.

4 participants

@corona10 @Fidget-Spinner @brandtbucher @bedevere-bot
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 01402520 — 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.