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 — bpo-43563 : Introduce dedicated opcodes for super calls by vladima · Pull Request #24936 · python/cpython

Conversation

@vladima

@vladima vladima commented Mar 19, 2021 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Add LOAD_METHOD_SUPER and LOAD_ATTR_SUPER opcodes to optimize method calls and attribute lookups when receiver is super().

https://bugs.python.org/issue43563

Sorry, something went wrong.

Uh oh!

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

All reactions
@vladima
Introduce dedicated opcodes for super calls
ccbb515
@vladima
vladima requested a review from markshannon as a code owner March 19, 2021 20:59
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Mar 19, 2021
@bedevere-bot bedevere-bot added the awaiting review label Mar 19, 2021
@vladima
vladima force-pushed the super_call branch from 31e71a2 to 5aad94c Compare March 19, 2021 21:27
@vladima
Merge remote-tracking branch 'upstream/master' into super_call
b8ab90f
@vladima
vladima force-pushed the super_call branch from 5aad94c to b8ab90f Compare March 20, 2021 05:40
@gvanrossum

gvanrossum commented Mar 22, 2021

Copy link
Copy Markdown
Member

See question on bpo -- why is this important? Do you have performance data to back up that this is an important optimization?

All reactions

Sorry, something went wrong.

Uh oh!

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

@vladima
:Add test with replaced super
66d31ec
@vladima
vladima force-pushed the super_call branch from 8360950 to 66d31ec Compare March 22, 2021 19:40
@github-actions

github-actions Bot commented Apr 22, 2021

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 22, 2021
@gvanrossum

gvanrossum commented Apr 24, 2021

Copy link
Copy Markdown
Member

Unless you come up with some benchmark numbers, unfortunately we will have to close this PR. I'll give you a week to let us know what you'd like to do. If you need more time to benchmark, just let us know -- but if we don't hear from you after a week we'll close it. If you change your mind later or you're on vacation or something like that, I will still be notified of comments added to the issue after it's closed, so don't hesitate to say something!

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Apr 25, 2021
@markshannon

markshannon commented May 28, 2021

Copy link
Copy Markdown
Member

I'm interested to see how this compares with adaptive specialization of PEP 659.

The expression super().attr compiles with this PR as:

          LOAD_DEREF               0 (__class__)
          LOAD_FAST                  0 (self)
          LOAD_ATTR_SUPER   1 ((1, True))

on main this compiles as:

         CALL_FUNCTION            0
         LOAD_ATTR                1 (attr)

So main has a (small) advantage in dispatching.
The question is, can a specialized form of CALL_FUNCTION 0; LOAD_ATTR match the custom opcodes.

Assuming we specialize both CALL_FUNCTION and LOAD_ATTR I think it can.
There will be the overhead of creating the super() object, but the specializer has more context than the static compiler and should be able to do a much better job on the attribute lookup.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner Fidget-Spinner mentioned this pull request Jan 28, 2022
bpo-46564: Optimize super().meth() calls via adaptive superinstructions #30992
Closed
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
@carljm carljm mentioned this pull request Apr 13, 2023
gh-87729: add LOAD_SUPER_ATTR instruction for faster super() #103497
Merged
@vladima vladima mannequin mentioned this pull request Apr 10, 2022
Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver #87729
Closed
@carljm

carljm commented Apr 13, 2023

Copy link
Copy Markdown
Member

This is superseded by #103497.

All reactions

Sorry, something went wrong.

Uh oh!

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

@carljm carljm closed this Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

awaiting review

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.

7 participants

@vladima @gvanrossum @markshannon @carljm @the-knights-who-say-ni @ezio-melotti @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.