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

Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c #58591

Closed
vstinner opened this issue Mar 22, 2012 · 3 comments
Closed

Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c #58591

vstinner opened this issue Mar 22, 2012 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@vstinner
Copy link
Member

BPO 14383
Nosy @loewis, @pitrou, @vstinner, @benjaminp
Files
  • identifier.patch
  • 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 2012-03-26.20:19:19.085>
    created_at = <Date 2012-03-22.01:08:10.367>
    labels = ['interpreter-core', 'performance']
    title = 'Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c'
    updated_at = <Date 2012-03-26.20:19:19.084>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2012-03-26.20:19:19.084>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-03-26.20:19:19.085>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2012-03-22.01:08:10.367>
    creator = 'vstinner'
    dependencies = []
    files = ['24988']
    hgrepos = []
    issue_num = 14383
    keywords = ['patch']
    message_count = 3.0
    messages = ['156529', '156532', '156865']
    nosy_count = 5.0
    nosy_names = ['loewis', 'pitrou', 'vstinner', 'benjamin.peterson', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue14383'
    versions = ['Python 3.3']

    @vstinner
    Copy link
    Member Author

    Attached patch adds the followig functions:

    • _PyDict_GetItemId()
    • _PyDict_SetItemId()
    • _PyType_LookupId() (private)

    And it uses identifiers in ceval.c and typeobject.c where it is revelant.

    I expect a small speedup.

    The patch does also simplify the code: use the new identifier API instead of an explicit static keyword and call to PyUnicode_InternXXX.

    I can split the patch into smaller parts if you prefer.

    @vstinner vstinner added interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Mar 22, 2012
    @vstinner
    Copy link
    Member Author

    Oops, my patch contained an unrelated change. I attach a new patch. I commited the change:

    changeset: 75866:
    tag: tip
    user: Victor Stinner <victor.stinner@gmail.com>
    date: Thu Mar 22 02:09:08 2012 +0100
    files: Objects/object.c
    description:
    Micro-optimize PyObject_GetAttrString()

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 26, 2012

    New changeset c67f3681e032 by Victor Stinner in branch 'default':
    Issue bpo-14383: Add _PyDict_GetItemId() and _PyDict_SetItemId() functions
    http://hg.python.org/cpython/rev/c67f3681e032

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

    No branches or pull requests

    1 participant