On 28 October 2012 18:22, Stefan Behnel <stefan_ml@behnel.de> wrote:
How much of an
effect would it have on startup times and these benchmarks if
Cython-compiled extensions were used?

Depends on what and how much code you use. If you compile everything into one big module that "imports" all of the stdlib when it gets loaded, you'd likely loose a lot of time because it would take a while to initialise all that useless code on startup. If you keep it separate, it would likely be a lot faster because you avoid the interpreter for most of the module startup.

I was specifically thinking in terms of the tests Brett ran (that was the full set on speed.python.org, wasn't it?), and having each stdlib module be its own extension i.e. no big import module. A literal 1:1 replacement where possible.
I'm thinking here of elimination of .pyc interpretation and execution (stat
calls would be similar, probably slightly higher).

CPython checks for .so files before looking for .py files and imports are absolute by default in Py3, so there should be a slight reduction in stat calls. The net result then obviously also depends on how fast your shared library loader and linker is, etc., but I doubt that that path is any slower than loading and running a .pyc file.

D'oh. I knew that and still got it backwards.
To be clear - I'm *not* suggesting Cython become part of the required build
toolchain. But *if* the Cython-compiled extensions prove to be
significantly faster I'm thinking maybe it could become a semi-supported
option (e.g. a HOWTO with the caveat "it worked on this particular system").

Sounds reasonable.

I think a stdlib compile script + pre-packaged hints for the 3.3 release would likely help both 3.3 and Cython acceptance.

Putting aside my development interest and looking at it purely from the PoV of a Python *user*, I'd really like to see Cython on speed.python.org eventually (in two modes - one without hints as a baseline and one with hints). Of course the ideal situation would be to have every implementation of Python 3.3 that is capable of running on the hardware contributing numbers e.g. if/when Jython achieves 3.3 compatibility I'd love to see numbers for it.

Tim Delaney