A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-February/042807.html below:

[Python-Dev] Idea for a fast calling convention

[Python-Dev] Idea for a fast calling conventionRaymond Hettinger raymond.hettinger at verizon.net
Fri Feb 27 03:20:17 EST 2004
I've been working on ways to speedup parameter passing for function
calls.  It's somewhat expensive to pull parameters off of the stack,
assemble them into a new tuple, have the function disassemble the tuple,
and ultimately free the tuple.

METH_NOARGS and METH_O show nice speed-ups by skipping the tuple packing
and unpacking.  Since they are handled as special cases, that approach
doesn't handle the general case with multiple or optional arguments.

My idea is for a new flag, METH_STACK, that generalizes (and potentially
replaces) METH_NOARGS AND METH_O.

When CALL_FUNCTION sees the flag, it dispatches (*meth)(self, &stack,
numargs).

On the receiving end, the arguments get retrieved with analogues to
PyArg_ParseTuple() and PyArg_UnpackTuple() which access the parameters
directly and do not need a tuple as a carrier.


Raymond Hettinger


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4