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

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

Closed
vstinner opened this issue Mar 14, 2017 · 2 comments
Labels
3.7 (EOL) end of life performance Performance or resource usage

Comments

@vstinner
Copy link
Member

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

@vstinner
Copy link
Member Author

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.

@vstinner vstinner added 3.7 (EOL) end of life performance Performance or resource usage labels Mar 14, 2017
@vstinner vstinner changed the title Use FASTCALL in call.c callmethod() to avoid temporary tuple Avoid temporary method object in PyObject_CallMethod() and PyObject_CallMethodObjArgs() Mar 14, 2017
@vstinner
Copy link
Member Author

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.

@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 performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

1 participant