[Python-checkins] r46438 - in python/trunk: Include/pyport.h Python/ceval.c

"Martin v. Löwis" martin at v.loewis.de
Sat May 27 14:35:24 CEST 2006


A.M. Kuchling wrote:
> I've attached a patch that makes Py_LOCAL use a GCC attribute on x86
> that supposedly passes some parameters in registers.  On my machine
> the difference seems to be in the noise (sometimes faster, sometimes
> slower), but perhaps Fredrik or Andrew would like to try it; they're
> probably very good at benchmarking the string types by now.

It doesn't make any difference at all for 4.0: the assembly files are
identical.

Most of the functions declared regparm get inlined, anyway, either
because they are small, or because they are called only once.

For the functions that don't get inlined (e.g. fastsearch), gcc 4.0
will automatically apply regparm to a function if it is "local" (i.e. it
is static and its address is never taken).

So at least for gcc 4, the patch is redundant. Not sure how long
gcc has been doing that, but it must have been a few years.

Regards,
Martin


More information about the Python-checkins mailing list