2018-07-10 14:59 GMT+02:00 INADA Naoki <songofaca...@gmail.com>: > PyObject_CallFunction(func, "n", 42); > > Currently, we create temporary long object for passing argument. > If there is protocol for exposeing format used by PyArg_Parse*, we can > bypass temporal Python object and call myfunc_impl directly.
I'm not sure that it's worth it. It seems complex to implement. I proposed something simpler, but nobody tried to implement it. Instead of calling the long and complex PyArg_Parse...() functions, why not generating C code to parse arguments instead? The idea looks like "inlining" PyArg_Parse...() in its caller, but technically it means that Argument Clinic generates C code to parse arguments. PyArg_Parse...() is cheap and has been optimized, but on very fast functions (less than 100 ns), it might be significant. Well, to be sure, someone should run a benchmark :-) Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com