Skip to content

Implement _PyStack_UnpackDict() with a single allocation #81085

Closed

Description

@jdemeyer
BPO 36904
Nosy @scoder, @vstinner, @encukou, @methane, @markshannon, @jdemeyer
PRs
  • bpo-36904: new function _PyStack_DictAsVector #13308
  • bpo-36904: Optimize _PyStack_UnpackDict #14517
  • 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 = None
    closed_at = <Date 2019-07-02.13:04:55.023>
    created_at = <Date 2019-05-13.15:22:54.320>
    labels = ['interpreter-core', '3.8', 'performance']
    title = 'Implement _PyStack_UnpackDict() with a single allocation'
    updated_at = <Date 2019-07-02.13:04:55.022>
    user = 'https://github.com/jdemeyer'

    bugs.python.org fields:

    activity = <Date 2019-07-02.13:04:55.022>
    actor = 'jdemeyer'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-02.13:04:55.023>
    closer = 'jdemeyer'
    components = ['Interpreter Core']
    creation = <Date 2019-05-13.15:22:54.320>
    creator = 'jdemeyer'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36904
    keywords = ['patch']
    message_count = 3.0
    messages = ['342339', '342379', '347124']
    nosy_count = 6.0
    nosy_names = ['scoder', 'vstinner', 'petr.viktorin', 'methane', 'Mark.Shannon', 'jdemeyer']
    pr_nums = ['13308', '14517']
    priority = 'normal'
    resolution = 'wont fix'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue36904'
    versions = ['Python 3.8']

    Activity

    1. jdemeyer commented on May 13, 2019

      @jdemeyer
      ContributorAuthor

      _PyStack_UnpackDict() is used to convert from the FastCallDict calling convention to FastCallKeywords. It currently needs two allocations: one for the tuple of keyword names and one for the array of arguments (positional and keyword).

      This can be optimized by using a single allocation, storing everything in a single tuple. That tuple can then be artificially truncated to the required size when done.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      performancePerformance or resource usage
      on May 13, 2019
    3. jdemeyer commented on May 13, 2019

      @jdemeyer
      ContributorAuthor

      Ideally, this would be fixed together with bpo-36907.

    4. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      and removed
      stdlibStandard Library Python modules in the Lib/ directory
      on May 13, 2019
    5. methane commented on Jul 2, 2019

      @methane
      Member

      New changeset d4efd91 by Inada Naoki (Jeroen Demeyer) in branch 'master':
      bpo-36904: Optimize _PyStack_UnpackDict (GH-14517)
      d4efd91

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions