[Python-Dev] Provide a Python wrapper for any new C extension

Guido van Rossum guido@python.org
Wed, 10 Jul 2002 15:26:55 -0400


> The only obvious objection I can see to this is a performance hit for
> having to go through the Python stub to call the C extension.  But I just
> did a very simple test of calling strftime('%c') 25,000 times from time
> directly and using a Python stub and it was .470 and .490 secs total
> respectively according to profile.run().

If the Python module does "from _Cmodule import *", there should be
*no* difference in performance, since you get the same object in
either case.

--Guido van Rossum (home page: http://www.python.org/~guido/)