[Python-Dev] Special-casing "O"

Jeremy Hylton jeremy@digicool.com
Sun, 27 May 2001 14:55:36 -0400 (EDT)


>>>>> "TP" == Tim Peters <tim.one@home.com> writes:

  TP> Do METH_O, convert every "O" function to use it, declare
  TP> victory, and enjoy the weekend <wink>.

  TP> 1%-of-the-work-for-80%-of-the-gain-and-an-overall-decrease-in-code-
  TP>     size-ly y'rs - tim

How is METH_O different than METH_OLDARGS?  

The old-style argument passing is definitely the most efficient for
functions of a zero or one arguments.  There's special-case code in
ceval to support it these cases -- fast_cfunction() -- primarily
because in these cases the function can be invoked by using arguments
directly from the Python stack instead of copying them to a tuple
first.

Jeremy