[Python-Dev] Re: a serious threat to 2.3's speed?

Skip Montanaro skip at pobox.com
Thu Dec 11 11:06:03 EST 2003


    >> It's not clear to me that his current system supports all the
    >> different types of callables which CPython supports. That alone might
    >> streamline his function call code a lot.

    Alex> How so?  Isn't one "indirecting" through the tp_call slot anyway?
    Alex> Supporting two or two thousand types of callables should make
    Alex> function calls just about the same cost -- or am I missing
    Alex> something...?

Python's function call machinery is complex, mostly in the argument
marshalling area I think.  Take a look in Python/ceval.c at

    call_function
    fast_function
    do_call
    ext_do_call
    update_keyword_args
    update_star_args

If Jim's compiler doesn't yet support any of varargs, keyword args, calling
C functions or calling bound method objects, I suspect his code is more
streamlined.

Skip



More information about the Python-Dev mailing list