[Python-Dev] Python 2.6a2 execution times with various compilers

Jeroen Ruigrok van der Werven asmodai at in-nomine.org
Sun Apr 13 10:25:03 CEST 2008

-On [20080413 00:47], Gregory P. Smith (greg at krypto.org) wrote:
>With gcc 4.1.3 i'm finding that profile guided optimization when trained on
>pybench or regrtest does make a measurable difference (2-5% overall time with
>10-20% on some pybench tests).  I haven't run benchmarks enough times to be
>confident in my results yet, I'll report back with data once I have it.  I'm
>testing both pybench and regrtest as profiling training runs.

It seems GCC 4.2.4 yields worse code for Python with the same options as
4.2.1, I measured about ~7%-8% slowdown (~0,5 seconds) on my test.

Granted, in general this might all be nitpicking, but for our friends in the
calculating departments this might be quite useful to know. The differences
are in general not concentrated in specific sections of pybench, but are
uniformly distributed. I know my employer can use such additional free
optimizations since our jobs spawn in many hours of execution. Next to
optimizing the source code, of course, this will also shave off quite a lot
of execution time.

>I will check in a special makefile target for easy gcc profile guided compiles
>shortly so that those who want faster builds easily produce them.

That would be interesting I think.
I went with -fprofile-generate and -fprofile-use in my small test.

Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/
Put your heart, mind, intellect and soul even to your smallest acts. This
is the secret of success...

More information about the Python-Dev mailing list