[Python-Dev] Building a Faster Python

Ronald Oussoren ronaldoussoren at mac.com
Mon Jul 22 09:50:53 CEST 2013


On 22 Jul, 2013, at 9:32, Maciej Fijalkowski <fijall at gmail.com> wrote:

> On Mon, Jul 22, 2013 at 9:32 AM, Maciej Fijalkowski <fijall at gmail.com> wrote:
>> On Mon, Jul 22, 2013 at 8:15 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>>> On Sun, 21 Jul 2013 16:36:35 -0700
>>> Raymond Hettinger <raymond.hettinger at gmail.com> wrote:
>>>> Our current Mac OS X builds use GCC-4.2.
>>>> 
>>>> On Python2.7, I ran a comparison of gcc-4.2.1 builds
>>>> versus gcc-4.8.1 and found that the latter makes a much
>>>> faster Python.  PyBench2.0 shows the total running time
>>>> dropping from 5653ms to 4571ms.  The code is uniformly
>>>> better in just about every category.
>>> 
>>> You could try running the benchmarks suite to see what that gives:
>>> http://hg.python.org/benchmarks/
>>> 
>>> Regards
>>> 
>>> Antoine.
>> 
>> or pypy benchmark suite which is more comprehensive for python 2.7
>> (http://bitbucket.org/pypy/benchmarks)
> 
> Besides, is there any reason not to use clang by default on OS X?

The 32-bit installer contains binaries that work on PPC, that's why those are built using
an older version of Xcode. I'd have to check if that version of Xcode supports clang,
and if that version of clang is good enough.

The "intel" installer can, and should, be build with clang (and preferably with the most
recent Xcode release to ensure that the latest supported compiler is used). 

Note that the CPython configure script, and distutils, already use clang by
default if you a recent Xcode but that's primarily because gcc is llvm-gcc when you use
Xcode and llvm-gcc is broken (it miscompiles at least the unicode implementation in Python 3.3),
this overrides the default behavior of configure (using gcc whenever it is available unless
the user explictly overrides).

Ronald



More information about the Python-Dev mailing list