Message263893
> Maybe a new C function can be designed to call a function: it would uses PyEval_EvalCodeEx() to call functions implemented in Python, or create the tuple for functions implemented in C.
I would expect C code to be more optimized that Python functions, but for the specific case of function calls: Python are more optimized with the fast-path fast_function()!
I recall vaguely that Larry Hasting shared me his idea of passing the Python stack to C functions to avoid the creation of a tuple.
Maybe we can add a new API for C functions accepted a C array of PyObject*, a number of positional arguments and a number of (key, value) pairs for keyword arguments. Something similar to PyEval_EvalCodeEx() but for C functions. It means that we should add a new flavor of PyArg_ParseTuple/PyArg_ParseTupleAndKeywords to accepts this format.
Larry's idea was to use the argument clinic to handle that for us. |
|
Date |
User |
Action |
Args |
2016-04-21 07:59:08 | vstinner | set | recipients:
+ vstinner, brett.cannon, rhettinger, ncoghlan, larry, eric.snow, serhiy.storchaka, random832, xiang.zhang |
2016-04-21 07:59:08 | vstinner | set | messageid: <1461225548.05.0.718938181579.issue26811@psf.upfronthosting.co.za> |
2016-04-21 07:59:08 | vstinner | link | issue26811 messages |
2016-04-21 07:59:07 | vstinner | create | |
|