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 — Inline bytecode caches · Issue #90997 · python/cpython

Inline bytecode caches #90997

New issue
Copy link
New issue
Copy link
Closed
Closed
Inline bytecode caches#90997
Copy link
Assignees
brandtbucher
Labels
3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage

Description

@brandtbucher
brandtbucher
opened on Feb 24, 2022
Issue body actions
BPO 46841
Nosy @markshannon, @corona10, @pablogsal, @brandtbucher, @neonene, @iritkatriel, @penguin-wwy
PRs
  • bpo-46841: Use *inline* caching for BINARY_OP #31543
  • bpo-46841: Add (undocumented) _co_quickened attribute for code object. #31552
  • bpo-46841: Move the cache for LOAD_GLOBAL inline. #31575
  • bpo-46841: Use inline caching for UNPACK_SEQUENCE #31591
  • bpo-46841: Inline cache for BINARY_SUBSCR. #31618
  • bpo-46841: Use inline caching for COMPARE_OP #31622
  • bpo-46841: Use inline caching for attribute accesses #31640
  • bpo-46841: Improve the failure stats for COMPARE_OP #31663
  • bpo-46841: Fix error message hacks in GET_AWAITABLE #31664
  • bpo-46841: Fix BINARY_OP's handling of inline caches #31671
  • bpo-46841: Use inline caching for calls #31709
  • bpo-46841: Don't use an oparg counter for STORE_SUBSCR #31742
  • bpo-46841: Add a _Py_SET_OPCODE macro #31780
  • bpo-46841: Update adaptive.md for inline caching #31817
  • bpo-46841: Quicken code in-place #31888
  • bpo-46841: Don't scan backwards in bytecode. #31901
  • bpo-46841: Don't jump during throw()  #31968
  • gh-90997: bpo-46841: Disassembly of quickened code #32099
  • bpo-46841: remove no-longer-used macro UPDATE_PREV_INSTR_OPARG #32100
  • bpo-46841: Use a bytes object for _co_code_adaptive #32205
  • bpo-46841: Avoid unnecessary allocations in code object comparisons #32222
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/brandtbucher'
    closed_at = None
    created_at = <Date 2022-02-24.02:17:14.449>
    labels = ['interpreter-core', 'deferred-blocker', '3.11', 'performance']
    title = 'Inline bytecode caches'
    updated_at = <Date 2022-04-01.11:29:28.677>
    user = 'https://github.com/brandtbucher'

    bugs.python.org fields:

    activity = <Date 2022-04-01.11:29:28.677>
    actor = 'Mark.Shannon'
    assignee = 'brandtbucher'
    closed = False
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2022-02-24.02:17:14.449>
    creator = 'brandtbucher'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46841
    keywords = ['patch']
    message_count = 29.0
    messages = ['413875', '413901', '413987', '413988', '414188', '414194', '414261', '414277', '414343', '414349', '414358', '414359', '414364', '414371', '414372', '414378', '414391', '414461', '414490', '414523', '414547', '414696', '414763', '414955', '415307', '415676', '415969', '416482', '416483']
    nosy_count = 7.0
    nosy_names = ['Mark.Shannon', 'corona10', 'pablogsal', 'brandtbucher', 'neonene', 'iritkatriel', 'penguin_wwy']
    pr_nums = ['31543', '31552', '31575', '31591', '31618', '31622', '31640', '31663', '31664', '31671', '31709', '31742', '31780', '31817', '31888', '31901', '31968', '32099', '32100', '32205', '32222']
    priority = 'deferred blocker'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue46841'
    versions = ['Python 3.11']

    Linked PRs

    • GH-90997: Shrink the LOAD_GLOBAL caches #102569

    Activity

    Next
    1. brandtbucher commented on Feb 24, 2022

      @brandtbucher
      brandtbucher
      on Feb 24, 2022
      MemberAuthor
      More actions

      ...as discussed in faster-cpython/ideas#263.

      My plan is for this initial PR to lay the groundwork, then to work on porting over the existing opcode caches one-by-one. Once that's done, we can clean up lots of the "old" machinery.

    2. brandtbucher
      added
      3.11only security fixesonly security fixes
      on Feb 24, 2022
    3. brandtbucher
      self-assigned this
      on Feb 24, 2022
    4. brandtbucher
      added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
      performancePerformance or resource usagePerformance or resource usage
      3.11only security fixesonly security fixes
      on Feb 24, 2022
    5. brandtbucher
      self-assigned this
      on Feb 24, 2022
    6. brandtbucher
      added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
      performancePerformance or resource usagePerformance or resource usage
      on Feb 24, 2022
    7. markshannon commented on Feb 24, 2022

      @markshannon
      markshannon
      on Feb 24, 2022
      Member
      More actions

      We need to decide what to do about dis.

      I don't think we should have a show_cache option, as the caches are meaningless junk without quickening (maybe we should drop the CACHE opcode, and just use zeroes).

      Instead we should have a show_quickened option, to show the quickened form, which we need to make clear is very much implementation defined.
      E.g. Cinder might show the machine code as well.

      That way, we can present the cache information as extra data on the quickened form, rather than junk instructions.

    8. markshannon commented on Feb 25, 2022

      @markshannon
      markshannon
      on Feb 25, 2022
      Member
      More actions

      New changeset 0f41aac by Brandt Bucher in branch 'main':
      bpo-46841: Use inline caching for BINARY_OP (GH-31543)
      0f41aac

    9. markshannon commented on Feb 25, 2022

      @markshannon
      markshannon
      on Feb 25, 2022
      Member
      More actions

      Making this a release blocker, as we really cannot leave this half finished for the release.

      Shouldn't be a problem, as we'll have it done in a week or so.

    10. markshannon
      added
      release-blocker
      on Feb 25, 2022
    11. markshannon commented on Feb 28, 2022

      @markshannon
      markshannon
      on Feb 28, 2022
      Member
      More actions

      New changeset 424ecab by Brandt Bucher in branch 'main':
      bpo-46841: Use inline caching for UNPACK_SEQUENCE (GH-31591)
      424ecab

    12. 35 remaining items

    13. pablogsal
      added
      release-blocker
      and removed
      deferred-blocker
      on May 9, 2022
    14. brandtbucher
      removed
      release-blocker
      on May 19, 2022
    15. brandtbucher
      removed this from Release and Deferred blockers 🚫on May 19, 2022
    16. brandtbucher
      added a commit that references this issue on Aug 5, 2022

      GH-90997: Document CACHEs (GH-95694)

      5f3c9fd
    17. miss-islington
      added a commit that references this issue on Aug 5, 2022

      pythonGH-90997: Document CACHEs (pythonGH-95694)

      518b3ad
    18. ambv
      added a commit that references this issue on Aug 5, 2022

      GH-90997: Document CACHEs (GH-95694) (GH-95696)

      07d97c9
    19. iritkatriel
      added a commit that references this issue on Aug 11, 2022

      pythonGH-90997: Document CACHEs (pythonGH-95694)

      ca3ae16
    20. brandtbucher
      added a commit that references this issue on Aug 19, 2022

      GH-90997: Wrap yield from/await in a virtual try/except StopIteration (…

      5bfb3c3
    21. iritkatriel commented on Sep 7, 2022

      @iritkatriel
      iritkatriel
      on Sep 7, 2022
      Member
      More actions

      Is there anything left to do here?

    22. markshannon commented on Sep 7, 2022

      @markshannon
      markshannon
      on Sep 7, 2022
      Member
      More actions

      No. This is done.

    23. markshannon
      closed this as completedon Sep 7, 2022
    24. brandtbucher
      added a commit that references this issue on Sep 15, 2022

      GH-90997: Improve inline cache performance for MSVC (GH-96781)

      a83fdf2
    25. brandtbucher
      added a commit that references this issue on Mar 11, 2023

      GH-90997: Shrink the LOAD_GLOBAL caches (#102569)

      08b67fb
    26. iritkatriel
      added a commit that references this issue on Mar 12, 2023

      pythonGH-90997: Shrink the LOAD_GLOBAL caches (python#102569)

      4c8bbe4
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    • @brandtbucher
      brandtbucher

    Labels

    3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.