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 — Experimental variant of BINARY_ADD specialization. by markshannon · Pull Request #29059 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Oct 19, 2021

Copy link
Copy Markdown
Member

No description provided.

Sorry, something went wrong.

Uh oh!

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

All reactions
@markshannon
Experimental variant of BINARY_ADD specialization.
763c297
@bedevere-bot bedevere-bot added the awaiting core review label Oct 19, 2021
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Oct 19, 2021
@markshannon markshannon added DO-NOT-MERGE and removed CLA signed awaiting core review labels Oct 19, 2021
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Oct 19, 2021
Fidget-Spinner
Fidget-Spinner reviewed Oct 19, 2021
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.

I wonder if we'll see any speedups from this. I don't see how it will be much faster than PyNumber_Add. If the compiler's smart about it, it'll probably inline PyNumber_Add during PGO, and we'll have almost the same function

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Python/ceval.c
Comment on lines +2205 to +2206
Py_DECREF(sum);
sum = NULL;

@Fidget-Spinner Fidget-Spinner Oct 19, 2021

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.

You may want to consider replacing this with

Suggested change
Py_DECREF(sum);
sum = NULL;
Py_SETREF(sum, NULL);

Sorry, something went wrong.

Uh oh!

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

All reactions

@brandtbucher brandtbucher Oct 27, 2021

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.

Or:

Suggested change
Py_DECREF(sum);
sum = NULL;
Py_CLEAR(sum);

Sorry, something went wrong.

Uh oh!

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

All reactions
@markshannon

markshannon commented Oct 19, 2021

Copy link
Copy Markdown
Member Author

Disappointing results

All reactions

Sorry, something went wrong.

Uh oh!

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

markshannon added 3 commits October 27, 2021 10:16
@markshannon
Merge branch 'main' into alternative-specialize-binary-add
a90f27e
@markshannon
Specialize BINARY_ADD for int+float and float+int.
a8128d1
@markshannon
Merge branch 'main' into alternative-specialize-binary-add
bdb767f
@markshannon

markshannon commented Nov 10, 2021

Copy link
Copy Markdown
Member Author

Will need reworking once #29482 is merged.

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon

markshannon commented Nov 16, 2021

Copy link
Copy Markdown
Member Author

@brandtbucher Maybe something like this will show better results now that the binary and inplace operators have been merged?

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon markshannon closed this Nov 16, 2021
@markshannon
markshannon deleted the alternative-specialize-binary-add branch September 26, 2023 12:51
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 left review comments
@brandtbucher brandtbucher brandtbucher left review comments

Uh oh!

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

Assignees

No one assigned

Labels

DO-NOT-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.

5 participants

@markshannon @Fidget-Spinner @brandtbucher @the-knights-who-say-ni @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 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.