[Python-Dev] Building a Faster Python

David Malcolm dmalcolm at redhat.com
Mon Jul 22 17:08:32 CEST 2013


On Mon, 2013-07-22 at 09:32 +0200, Maciej Fijalkowski 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?

How did this thread go from:
  "for OS X, GCC 4.8.1 gives you significantly faster machine code
   than the system GCC 4.2.1"
to
  "let's just use clang"
?

Presumably if you want the faster possible machine code for the platform
the correct approach is to benchmark the available compilers trying
various options and to see which does best.  Note that the meaning of
e.g. "-O3" varies from compiler to compiler (I see someone else already
made the Apples-to-Apples pun).

(I should declare that I've been hacking on GCC for the last few months,
so I have an interest in this)

Hope this is constructive
Dave



More information about the Python-Dev mailing list