This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients python-dev, scoder, serhiy.storchaka, vstinner
Date 2016-08-22.21:42:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471902154.99.0.856562500953.issue27809@psf.upfronthosting.co.za>
In-reply-to
Content
Stefan Behnel: "I like the oneArg/noArg etc. macros. We use something similar in Cython."

Oh, nice :-) Since they macros are private, I pushed fastcall_macros.patch. We can still rework them later if needed.


"You can even use them to inline the METH_O and METH_NOARGS call cases (although I use inline functions for that in Cython)."

Hum, I'm not sure that it's worth it.


"I just took a quick look at the fastcall_kwargs-2.patch for now. It looks ok in general, but it also adds quite some special code for the dict-to-locals mapping. Is the keyword argument calling case really that important? I mean, it requires creating a dict and filling it, after all. People would rather avoid that in the first place if they care about performance. I wouldn't object, I'm merely asking..."

Hey, it's nothing new: Python 3.5 does the same in function_call()!? Oh in fact, function_call() code is very short compared to fastcall_kwargs-2.patch and it doesn't require to modify the hot code of Python/ceval.c! So I pushed a very small change (change 1aefb4c4a7b4) which adds support for keyword with the sample function_call() code.

Serhiy already told me that creating a dict is overkill... but please read again my message msg273370. We cannot break all APIs, we need a transition from the existing C APIs using Python dictionaries for keyword arguments.

I reworked my new fastcall APIs to keep the door open for a faster API to pass keyword arguments as pairs of (key, value) in an unique C array.
History
Date User Action Args
2016-08-22 21:42:35vstinnersetrecipients: + vstinner, scoder, python-dev, serhiy.storchaka
2016-08-22 21:42:34vstinnersetmessageid: <1471902154.99.0.856562500953.issue27809@psf.upfronthosting.co.za>
2016-08-22 21:42:34vstinnerlinkissue27809 messages
2016-08-22 21:42:34vstinnercreate