473,804 Members | 3,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Performance (pystone) of python 2.4 lower then python 2.3 ???

Hi,

Just installed Python 2.4 on a machine (RH8.0 Linux) that also has python 2.3
and python 2.2 installed. The latter came with the linux distribution, the other
are compiled from source tarballs.

Comparing them gives the following unexpected result:

[lucas@oslwb03 test]$ /usr/bin/python pystone.py
Pystone(1.1) time for 50000 passes = 1.86
This machine benchmarks at 26881.7 pystones/second
[lucas@oslwb03 test]$ /usr/local/bin/python2.3 pystone.py
Pystone(1.1) time for 50000 passes = 1.22
This machine benchmarks at 40983.6 pystones/second

This is ok, a 52% speed increase, but:

lucas@oslwb03 test]$ /usr/local/bin/python2.4 pystone.py
Pystone(1.1) time for 50000 passes = 1.31
This machine benchmarks at 38167.9 pystones/second

A 7% speed DECREASE??? According to the documentation it should be a 5% increase?

The machine is a 3.0 GHz Xeon box.

Both python 2.3 and 2.4 where configure without any options.

Anyone who understands what is going on?

Regards, Lucas

Jul 18 '05 #1
13 2099
Lucas Hofman wrote:
lucas@oslwb03 test]$ /usr/local/bin/python2.4 pystone.py
Pystone(1.1) time for 50000 passes = 1.31
This machine benchmarks at 38167.9 pystones/second

A 7% speed DECREASE??? According to the documentation it should be a 5% increase?

The machine is a 3.0 GHz Xeon box.

Both python 2.3 and 2.4 where configure without any options.


For comparison, I do get a decent speedup. Machine is an
AMD Athlon XP 2500+ (1.82GHz) running Win XP Pro SP2.

Python 2.3.4: 36393 pystones.
Python 2.4: 39400 pystones.

....about an 8% speedup.
Jul 18 '05 #2
Lucas Hofman wrote:
Anyone who understands what is going on?


It is difficult to measure a speedup that might be
well within your measurement error.

Run the same pystone benchmark repeatedly and
see what variation you get.

Istvan.
Jul 18 '05 #3
Peter Hansen <pe***@engcorp. com> wrote:
For comparison, I do get a decent speedup. Machine is an
AMD Athlon XP 2500+ (1.82GHz) running Win XP Pro SP2.

Python 2.3.4: 36393 pystones.
Python 2.4: 39400 pystones.

...about an 8% speedup.


On my 2.6 GHz P4 running debian testing I got the following results :-

$ for p in 2.1 2.2 2.3 2.4; do echo $p; python$p pystone.py 1000000 ; done

2.1
Pystone(1.1) time for 1000000 passes = 40.67
This machine benchmarks at 24588.1 pystones/second
2.2
Pystone(1.1) time for 1000000 passes = 39.64
This machine benchmarks at 25227 pystones/second
2.3
Pystone(1.1) time for 1000000 passes = 32.49
This machine benchmarks at 30778.7 pystones/second
2.4
Pystone(1.1) time for 1000000 passes = 29.88
This machine benchmarks at 33467.2 pystones/second

Showing that 2.4 is the fastest so far! (And is also a good advert
for AMD ;-)

--
Nick Craig-Wood <ni**@craig-wood.com> -- http://www.craig-wood.com/nick
Jul 18 '05 #4
Istvan Albert <ialbert <at> mailblocks.com> writes:

Lucas Hofman wrote:
Anyone who understands what is going on?


It is difficult to measure a speedup that might be
well within your measurement error.

Run the same pystone benchmark repeatedly and
see what variation you get.

Istvan.


Very little variation actually. The system measured is only lightly loaded (and
it is a 2 processor box). I ran the benchmark > 4 times and got 3 results that
are within 1% of each other.

Lucas
Jul 18 '05 #5
Nick Craig-Wood <nick <at> craig-wood.com> writes:

Peter Hansen <peter <at> engcorp.com> wrote:
For comparison, I do get a decent speedup. Machine is an
AMD Athlon XP 2500+ (1.82GHz) running Win XP Pro SP2.

Python 2.3.4: 36393 pystones.
Python 2.4: 39400 pystones.

...about an 8% speedup.


On my 2.6 GHz P4 running debian testing I got the following results :-

$ for p in 2.1 2.2 2.3 2.4; do echo $p; python$p pystone.py 1000000 ; done

2.1
Pystone(1.1) time for 1000000 passes = 40.67
This machine benchmarks at 24588.1 pystones/second
2.2
Pystone(1.1) time for 1000000 passes = 39.64
This machine benchmarks at 25227 pystones/second
2.3
Pystone(1.1) time for 1000000 passes = 32.49
This machine benchmarks at 30778.7 pystones/second
2.4
Pystone(1.1) time for 1000000 passes = 29.88
This machine benchmarks at 33467.2 pystones/second

Showing that 2.4 is the fastest so far! (And is also a good advert
for AMD

I got this list on a single processor P4 1.6 Ghz:
2.1
Pystone(1.1) time for 100000 passes = 6.74
This machine benchmarks at 14836.8 pystones/second
2.2
Pystone(1.1) time for 100000 passes = 6.36
This machine benchmarks at 15723.3 pystones/second
2.3
Pystone(1.1) time for 100000 passes = 4.92
This machine benchmarks at 20325.2 pystones/second
2.4
Pystone(1.1) time for 100000 passes = 4.51
This machine benchmarks at 22172.9 pystones/second

Which shows the expected speedup.

On a dual Xeon 3.0 Ghz:
2.2
Pystone(1.1) time for 1000000 passes = 37.45
This machine benchmarks at 26702.3 pystones/second
2.3
Pystone(1.1) time for 1000000 passes = 25.28
This machine benchmarks at 39557 pystones/second
2.4
Pystone(1.1) time for 1000000 passes = 25.94
This machine benchmarks at 38550.5 pystones/second

Which shows a decrease in performance. Could this have anything to do with the
fact that is is a dual processor box?

Lucas

Jul 18 '05 #6
> Which shows a decrease in performance. Could this have anything to do with the
fact that is is a dual processor box?


Doubtful. I'm running dual Pentium 4 2.8 Ghz (Win XP) and get the
following results:

C:\>python23\py thon Python23\lib\te st\pystone.py
Pystone(1.1) time for 50000 passes = 1.43068
This machine benchmarks at 34948.3 pystones/second

C:\>python24\py thon Python24\lib\te st\pystone.py
Pystone(1.1) time for 50000 passes = 1.28359
This machine benchmarks at 38953.2 pystones/second

Sw.
Jul 18 '05 #7
Hi Lucas,
On a dual Xeon 3.0 Ghz:
[...]
Which shows a decrease in performance. Could this have anything to do with the
fact that is is a dual processor box?


Maybe. But my 3Gh P4/HT is also detected as a dual processor machine
(Kernel 2.6), so it might be a general problem with the Xeon?

BTW: The discussion got me interested so I compiled Python 2.4 myself
with different compiler switches and different compilers, just to find
that generating machine dependant code doesn't speed up the pystone
benchmark in any way (with gcc 3.3.4) and using intel's icc V8 only
results in a small speedup (from approx. 40000 with gcc to approx. 41500
with icc).

So python performance doesn't seem to be that dependant on machine code
representation. Maybe you're running into a different problem like cache
size.

In addition: running python2.3 with psyco 1.2 proxying all 8 Procs of
pystone resulted in approx 155000 pystones, while python2.4 with psyco
1.3 resulted in approx 200000 pystones ...

Mark
Jul 18 '05 #8
"Lucas Hofman
This machine benchmarks at 38167.9 pystones/second


Pystone is an abyssmally bad benchmark for comparing the relative speeds of
different versions of python (it nets out all eval loop improvements and it
exercises only a microscopic portion of the language).

I would be interested in seeing other people's comparitive results for pybench,
test_decimal, and parrotbench.

To run test_decimal.py , you first have to copy Lib/test/decimal.py into Py2.3's
lib directory. On an old PentiumIII running WinMe, I get 48.940 sec in Py2.3
and 44.820 sec in Py2.4, a 8.4% improvement.

For pybench, I get 7418.90ms in Py2.3 and 6320.07 ms in Py2.4, a 14.8%
improvement.

For parrotbench, I get 54.517 seconds in Py2.3 and 45.009 seconds in Py2.4, a
17.4% improvement.

It is also interesting to time specific features not covered by the above
benchmarks. For example, list comprehensions got a nice 60% boost on my
machine:

C:\py24\Lib>\py thon23\python timeit.py -r9 "[i for i in xrange(1000)]"
100 loops, best of 9: 1.11 msec per loop

C:\py24\Lib>\py thon24\python timeit.py -r9 "[i for i in xrange(1000)]"
1000 loops, best of 9: 417 usec per loop
Raymond Hettinger
Jul 18 '05 #9
Mark Asbach wrote:
Hi Lucas,

On a dual Xeon 3.0 Ghz:

[...]

Which shows a decrease in performance. Could this have anything to do with the
fact that is is a dual processor box?

Maybe. But my 3Gh P4/HT is also detected as a dual processor machine
(Kernel 2.6), so it might be a general problem with the Xeon?


Hi Mark,

No,the reason that you see 2 times as many processors as really are
installed is the hyperthreading feature of the Xeon (see
http://www.infoworld.com/infoworld/a...5plxeon_1.html)

I turned it off (in the BIOS). The machine I tested on has 2 (pysical)
processors installed. Turning on or off does not influence the pystone
number significantly..

Regards, Lucas
Jul 18 '05 #10

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

Similar topics

7
5696
by: Christos TZOTZIOY Georgiou | last post by:
Last night I was compiling the latest python snapshot at my home Linux system (a K6-III @420 --the extra 20 Hz is overclocking :); then I tried building a shared version of the interpreter. I did some speed comparisons, and pystone reported ~6090 pystones for the shared and ~7680 pystones for the (default) static build. This is quite a difference, and while I do know what impact position independent code has on libraries, this was the...
13
35568
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
25
3497
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr within a try statement myself, or is there some clever implementation enhancement which makes this a bad idea? i.e. should I prefer: if hasattr(self,"datum"): datum=getattr("datum") else: datum=None
3
2764
by: Nicolas Lehuen | last post by:
Hi, Is it me, or does anyone else get significantly better pystone results under Cygwin versus the standard Win32 build ? CYGWIN 1.5.6 + python 2.3.3-1 : $ time python /usr/lib/python2.3/hotshot/stones.py Pystone(1.1) time for 50000 passes = 2.344 This machine benchmarks at 21331.1 pystones/second 850004 function calls in 4.371 CPU seconds
6
2652
by: Franco Fiorese | last post by:
Hi all, I am relatively new about Python benchmarks. After some experiments I found that Python on my PC Windows XP has a relevant higher performance than on Linux. The simple test using pystone.py shows this: * Windows XP Pro: 16566.7 pystones/second * Linux (kernel 2.6.9 NPTL): 12346.2 pystones/second I have repeated the test, on Linux, also with other distributions and
9
1768
by: Tom Carrick | last post by:
Hi, In my attempted learning of python, I've decided to recode an old anagram solving program I made in C++. The C++ version runs in less than a second, while the python takes 30 seconds. I'm not willing to think it's just python being slow, so I was hoping someone could find a faster way of doing this. Also, I was wondering if there was a more builtin, or just nicer way of converting a string to a list (or using the sort function on a...
8
3274
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run simultaneously 4 similar queries it takes nearly 5 minutes instead of 4 times 9 seconds or something near of that. here is a sample query: select mertido, fomeazon, ertektipus, mertertek from t_me30 where fomeazon in (select distinct fomeazon...
14
7147
by: Bill | last post by:
I've written a small program that, in part, reads in a file and parses it. Sometimes, the file is gzipped. The code that I use to get the file object is like so: if filename.endswith(".gz"): file = GzipFile(filename) else: file = open(filename) Then I parse the contents of the file in the usual way (for line in
1
1723
by: reinsn | last post by:
Hi, I have got a specific question on performance: Is the overhead of object creation in Python lower than in Java? I mean, I would argue, in Java by object creation, the complete class is the model and all methods and attributes are generated for the object. In Python, methods and objects are only generated, if reached: so could this represent a performance advantage for Python? Thanks!
0
9707
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
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 we have to send another system
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.