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

Redesign PyCodeObject.co_extras to use a single memory block, instead of two #74972

Closed
vstinner opened this issue Jun 28, 2017 · 7 comments
Closed
Labels
3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@vstinner
Copy link
Member

BPO 30789
Nosy @vstinner, @DinoV, @serhiy-storchaka, @1st1
PRs
  • bpo-30789: Use a single memory block for co_extra. #2555
  • 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 2017-07-04.12:18:48.237>
    created_at = <Date 2017-06-28.00:10:41.038>
    labels = ['interpreter-core', '3.7', 'performance']
    title = 'Redesign PyCodeObject.co_extras to use a single memory block, instead of two'
    updated_at = <Date 2017-07-05.15:59:12.046>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2017-07-05.15:59:12.046>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-07-04.12:18:48.237>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2017-06-28.00:10:41.038>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30789
    keywords = []
    message_count = 7.0
    messages = ['297077', '297624', '297648', '297745', '297764', '297769', '297770']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'dino.viehland', 'serhiy.storchaka', 'yselivanov']
    pr_nums = ['2555']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue30789'
    versions = ['Python 3.7']

    @vstinner
    Copy link
    Member Author

    Currently, _PyCode_SetExtra() uses two memory block for code extras. Using a different structure, it would be possible to use a single memory block: less memory fragmentation, better CPU cache usage, less indirections, etc.

    It matters since the long term plan for co_extras is to implement of kind-of JIT compiler insider CPython: see bpo-28158.

    @vstinner vstinner added 3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Jun 28, 2017
    @serhiy-storchaka
    Copy link
    Member

    Since nobody has provided a patch I have made it myself.

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 4, 2017

    New changeset 378ebb6 by Victor Stinner (Serhiy Storchaka) in branch 'master':
    bpo-30789: Use a single memory block for co_extra. (bpo-2555)
    378ebb6

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 5, 2017

    New changeset 8207c17 by Victor Stinner in branch 'master':
    Revert "bpo-30822: Fix testing of datetime module." (bpo-2588)
    8207c17

    @serhiy-storchaka
    Copy link
    Member

    How is this related to datetime module? I hope you didn't reverted too much?

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 5, 2017

    How is this related to datetime module? I hope you didn't reverted too much?

    I'm sorry for the spam. It was the first time that I really used the
    [Revert] button: even if the revert change is correct, the *commit
    message* is completely wrong :-/
    https://mail.python.org/pipermail/python-committers/2017-July/004674.html

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 5, 2017

    I'm sorry for the spam. It was the first time that I really used the
    [Revert] button: even if the revert change is correct, the *commit
    message* is completely wrong :-/
    https://mail.python.org/pipermail/python-committers/2017-July/004674.html

    @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.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants