Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement _PyStack_UnpackDict() with a single allocation #81085

Closed
jdemeyer opened this issue May 13, 2019 · 3 comments
Closed

Implement _PyStack_UnpackDict() with a single allocation #81085

jdemeyer opened this issue May 13, 2019 · 3 comments
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@jdemeyer
Copy link
Contributor

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']

    @jdemeyer
    Copy link
    Contributor Author

    _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.

    @jdemeyer jdemeyer added stdlib Python modules in the Lib dir 3.8 only security fixes performance Performance or resource usage labels May 13, 2019
    @jdemeyer
    Copy link
    Contributor Author

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

    @jdemeyer jdemeyer added interpreter-core (Objects, Python, Grammar, and Parser dirs) and removed stdlib Python modules in the Lib dir labels May 13, 2019
    @methane
    Copy link
    Member

    methane commented Jul 2, 2019

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

    @jdemeyer jdemeyer closed this as completed Jul 2, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants