473,473 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

best gcc version for Python

I've just been testing out Jakob Sievers' speedup of Python 2.5.2 by
compiling on freebsd with gcc-4.3.3 (the standard freebsd 6.1 gcc is 3.4.4).

I'm glad to say that his modification did improve pybench overall by
about 12%, but during the testing I noticed that in fact some of the
pybench results were much worse using gcc-4.3.3 compared to gcc-3.4.4.

Of course it may be that freebsd has put more work into 3.4.4, but when
I did a direct comparison of stock Python-2.5.2 under both compilers I
see the results below which seems to indicate some quite large
differences in how the compilers perform and the older one is better
overall by about 6%. Is there a best version of gcc for python?
-------------------------------------------------------------------------------
PYBENCH 2.0
-------------------------------------------------------------------------------
* using Python 2.5.2
* disabled garbage collection
* system check interval set to maximum: 2147483647
* using timer: time.time

Calibrating tests. Please wait...

Running 10 round(s) of the suite at warp factor 10:

* Round 1 done in 9.697 seconds.
* Round 2 done in 9.746 seconds.
* Round 3 done in 9.631 seconds.
* Round 4 done in 9.646 seconds.
* Round 5 done in 9.727 seconds.
* Round 6 done in 9.649 seconds.
* Round 7 done in 9.759 seconds.
* Round 8 done in 9.660 seconds.
* Round 9 done in 9.661 seconds.
* Round 10 done in 9.671 seconds.

-------------------------------------------------------------------------------
Benchmark: 2008-11-16 12:22:59
-------------------------------------------------------------------------------

Rounds: 10
Warp: 10
Timer: time.time

Machine Details:
Platform ID: FreeBSD-6.1-SECURITY-i386-32bit
Processor: i386

Python:
Executable: /home/rptlab/bin/python25
Version: 2.5.2
Compiler: GCC 3.4.4 [FreeBSD
Bits: 32bit
Build: Nov 16 2008 12:15:52 (#r252:60911)
Unicode: UCS2
-------------------------------------------------------------------------------
Comparing with: pybench.ref.x
-------------------------------------------------------------------------------

Rounds: 10
Warp: 10
Timer: time.time

Machine Details:
Platform ID: FreeBSD-6.1-SECURITY-i386-32bit
Processor: i386

Python:
Executable: /home/rptlab/bin/xpython
Version: 2.5.2
Compiler: GCC 4.3.3 20081106 (prerelease)
Bits: 32bit
Build: Nov 16 2008 11:38:57 (#r252:60911)
Unicode: UCS2
Test minimum run-time average run-time
this other diff this other diff
-------------------------------------------------------------------------------
BuiltinFunctionCalls: 202ms 209ms -3.6% 205ms 213ms -3.7%
BuiltinMethodLookup: 153ms 146ms +5.2% 156ms 146ms +6.7%
CompareFloats: 134ms 149ms -9.6% 134ms 149ms -9.6%
CompareFloatsIntegers: 132ms 147ms -9.9% 132ms 147ms -9.9%
CompareIntegers: 131ms 173ms -24.4% 131ms 173ms -24.4%
CompareInternedStrings: 130ms 142ms -7.8% 131ms 142ms -7.7%
CompareLongs: 113ms 146ms -23.1% 113ms 146ms -23.1%
CompareStrings: 138ms 138ms -0.1% 138ms 138ms -0.5%
CompareUnicode: 126ms 130ms -2.8% 126ms 130ms -3.3%
ConcatStrings: 233ms 422ms -44.9% 254ms 452ms -43.9%
ConcatUnicode: 187ms 300ms -37.5% 193ms 340ms -43.3%
CreateInstances: 147ms 159ms -7.5% 148ms 160ms -7.6%
CreateNewInstances: 132ms 138ms -4.9% 132ms 139ms -4.7%
CreateStringsWithConcat: 176ms 174ms +1.4% 177ms 174ms +1.4%
CreateUnicodeWithConcat: 143ms 154ms -7.3% 147ms 156ms -5.6%
DictCreation: 118ms 150ms -21.1% 119ms 151ms -21.1%
DictWithFloatKeys: 163ms 178ms -8.5% 163ms 178ms -8.4%
DictWithIntegerKeys: 123ms 137ms -10.5% 123ms 138ms -10.7%
DictWithStringKeys: 117ms 136ms -13.7% 118ms 136ms -13.6%
ForLoops: 111ms 122ms -9.0% 111ms 123ms -9.8%
IfThenElse: 121ms 132ms -7.8% 121ms 132ms -8.1%
ListSlicing: 115ms 115ms +0.6% 116ms 115ms +0.8%
NestedForLoops: 138ms 145ms -4.8% 139ms 145ms -4.3%
NormalClassAttribute: 142ms 140ms +1.2% 144ms 141ms +2.3%
NormalInstanceAttribute: 136ms 133ms +2.5% 137ms 134ms +2.2%
PythonFunctionCalls: 128ms 133ms -3.8% 128ms 133ms -4.0%
PythonMethodCalls: 162ms 173ms -6.2% 163ms 174ms -6.7%
Recursion: 175ms 180ms -2.8% 175ms 181ms -3.1%
SecondImport: 222ms 213ms +4.2% 224ms 213ms +5.0%
SecondPackageImport: 230ms 220ms +4.5% 232ms 221ms +5.0%
SecondSubmoduleImport: 279ms 263ms +5.9% 280ms 263ms +6.1%
SimpleComplexArithmetic: 143ms 148ms -3.7% 143ms 148ms -3.6%
SimpleDictManipulation: 132ms 139ms -5.5% 133ms 140ms -5.2%
SimpleFloatArithmetic: 128ms 128ms +0.2% 130ms 129ms +0.6%
SimpleIntFloatArithmetic: 110ms 113ms -2.2% 110ms 113ms -2.2%
SimpleIntegerArithmetic: 110ms 113ms -2.2% 110ms 113ms -2.2%
SimpleListManipulation: 114ms 124ms -7.8% 115ms 125ms -7.5%
SimpleLongArithmetic: 121ms 121ms -0.3% 121ms 122ms -0.5%
SmallLists: 138ms 143ms -3.3% 140ms 149ms -5.9%
SmallTuples: 149ms 159ms -6.1% 153ms 159ms -4.2%
SpecialClassAttribute: 141ms 138ms +2.1% 141ms 139ms +2.0%
SpecialInstanceAttribute: 227ms 216ms +5.2% 227ms 216ms +5.3%
StringMappings: 1827ms 1796ms +1.7% 1828ms 1798ms +1.7%
StringPredicates: 378ms 369ms +2.3% 378ms 369ms +2.3%
StringSlicing: 140ms 179ms -21.7% 145ms 185ms -21.6%
TryExcept: 111ms 112ms -0.7% 111ms 112ms -0.8%
TryRaiseExcept: 130ms 124ms +4.7% 131ms 125ms +4.6%
TupleSlicing: 130ms 134ms -2.9% 133ms 135ms -1.5%
UnicodeMappings: 125ms 123ms +0.8% 126ms 124ms +1.8%
UnicodePredicates: 135ms 132ms +2.3% 136ms 133ms +2.1%
UnicodeProperties: 199ms 201ms -1.2% 199ms 202ms -1.2%
UnicodeSlicing: 156ms 233ms -33.2% 166ms 244ms -32.2%
-------------------------------------------------------------------------------
Totals: 9601ms 10240ms -6.2% 9685ms 10363ms -6.5%

--
Robin Becker
Nov 16 '08 #1
1 2607
Robin Becker wrote:
I've just been testing out Jakob Sievers' speedup of Python 2.5.2 by
compiling on freebsd with gcc-4.3.3 (the standard freebsd 6.1 gcc is
3.4.4).

I'm glad to say that his modification did improve pybench overall by
about 12%, but during the testing I noticed that in fact some of the
pybench results were much worse using gcc-4.3.3 compared to gcc-3.4.4.
I recall some issues with gcc 4.3 during the development of Python 2.6.
We had to add some flags to compile Python correctly. Python 2.5 may not
be compatible with 4.3.

Christian

Nov 16 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rdsteph | last post by:
I am having a lot of fun using the pyGoogle module ( http://pygoogle.sourceforge.net/ ) that uses the Google API. It is about as easy to use as I can imagine, and it is a lot nicer than using my...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
7
by: Frank Millman | last post by:
Hi all Assume a 2-dimensional list called 'table' - conceptually think of it as rows and columns. Assume I want to create a temporary copy of a row called 'row', allowing me to modify the...
18
by: stylecomputers | last post by:
Hi All, What do you find the best IDE for creating web applications in Python is? Preferably FOS IDE. Cheers
8
by: yinglcs | last post by:
Hi, i am using red hat enterprise 4. It has python 2.3 installed. What is the best way to upgrade to python 2.4? I think one way is to compile python 2.4 from the source, but I can't remove...
11
by: macca | last post by:
I know this is a php newsgroup so obviously most people here like using php, but I was just wondering what people's opinnions were on the most diverse/useful and friendly 'scripting' language was....
2
by: Jean-Paul Calderone | last post by:
On Mon, 16 Jun 2008 08:39:52 +1000, Ben Finney <bignose+hates-spam@benfinney.id.auwrote: Maybe. I'm no expert on Debian packaging. However, exarkun@boson:~$ ls -l...
8
by: Palindrom | last post by:
Hi everyone ! I'd like to apologize in advance for my bad english, it's not my mother tongue... My girlfriend (who is a newbie in Python, but knows Perl quite well) asked me this morning why...
12
by: Scott Sharkey | last post by:
Hello all, Our development group at work seems to be heading towards adopting python as one of our standard "systems languages" for internal application development (yeah!). One of the issues...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.