Skip to content

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

Closed

Description

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

    Activity

    1. vstinner commented on Mar 22, 2012

      @vstinner
      MemberAuthor

      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.

    2. vstinner commented on Mar 22, 2012

      @vstinner
      MemberAuthor

      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()

    3. python-dev commented on Mar 26, 2012

      python-devmannequin
      Mannequin

      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

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

      interpreter-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