Skip to content

Avoid temporary method object in PyObject_CallMethod() and PyObject_CallMethodObjArgs() #73997

Closed

Description

@vstinner
BPO 29811
Nosy @vstinner, @methane

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 2021-09-21.22:20:34.654>
created_at = <Date 2017-03-14.21:36:22.583>
labels = ['3.7', 'performance']
title = 'Avoid temporary method object in PyObject_CallMethod() and PyObject_CallMethodObjArgs()'
updated_at = <Date 2021-09-21.22:20:34.654>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2021-09-21.22:20:34.654>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2021-09-21.22:20:34.654>
closer = 'vstinner'
components = []
creation = <Date 2017-03-14.21:36:22.583>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 29811
keywords = []
message_count = 2.0
messages = ['289620', '289622']
nosy_count = 2.0
nosy_names = ['vstinner', 'methane']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'performance'
url = 'https://bugs.python.org/issue29811'
versions = ['Python 3.7']

Activity

  1. vstinner commented on Mar 14, 2017

    @vstinner
    MemberAuthor

    call_method() of typeobject.c has been optimized to avoid temporary method object and to avoid temporary tuple in the issue bpo-29507.

    Optimizing callmethod() of call.c was already discussed on issue bpo-29507 but no decision was taken. Since call.c code is more complex, I created a new issue.

  2. changed the title [-]Use FASTCALL in call.c callmethod() to avoid temporary tuple[/-] [+]Avoid temporary method object in PyObject_CallMethod() and PyObject_CallMethodObjArgs()[/+] on Mar 14, 2017
  3. vstinner commented on Mar 14, 2017

    @vstinner
    MemberAuthor

    callmethod3.patch of bpo-29507 implements proposed optimization, but only when there is no positional argument. The patch doesn't apply cleanly since the code evolved, including a major refactoring: new Objects/call.c file.

  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

    3.7 (EOL)end of lifeperformancePerformance or resource usage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions