Skip to content

bpo-37017: Make PyObject_CallMethodObjArgs use LOAD_METHOD optimization#13516

Merged
methane merged 6 commits intopython:masterfrom
msullivan:method-opt
May 26, 2019
Merged

bpo-37017: Make PyObject_CallMethodObjArgs use LOAD_METHOD optimization#13516
methane merged 6 commits intopython:masterfrom
msullivan:method-opt

Conversation

@msullivan
Copy link
Copy Markdown
Contributor

@msullivan msullivan commented May 23, 2019

Update PyObject_CallMethodObjArgs and _PyObject_CallMethodIdObjArgs
to use _PyObject_GetMethod to avoid creating a bound method object
in many cases.

On a microbenchmark of PyObject_CallMethodObjArgs calling a method on
an interpreted Python class, this optimization resulted in a 1.7x
speedup.

https://bugs.python.org/issue37017

Update PyObject_CallMethodObjArgs and _PyObject_CallMethodIdObjArgs
to use _PyObject_GetMethod to avoid creating a bound method object
in many cases.

On a microbenchmark of PyObject_CallMethodObjArgs calling a method on
an interpreted Python class, this optimization resulted in a 1.7x
speedup.
Comment thread Objects/call.c Outdated
Comment thread Objects/call.c Outdated
Comment thread Misc/NEWS.d/next/C API/2019-05-22-17-33-52.bpo-37107.8BVPR-.rst Outdated
@methane methane merged commit 47dd2f9 into python:master May 26, 2019
@msullivan msullivan deleted the method-opt branch May 26, 2019 17:35
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…ythonGH-13516)

Update PyObject_CallMethodObjArgs and _PyObject_CallMethodIdObjArgs
to use _PyObject_GetMethod to avoid creating a bound method object
in many cases.

On a microbenchmark of PyObject_CallMethodObjArgs calling a method on
an interpreted Python class, this optimization resulted in a 1.7x
speedup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants