Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Performance (pystone) of python 2.4 lower then python 2.3 ???

Reply
Thread Tools

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

 
 
Lucas Hofman
Guest
Posts: n/a
 
      12-13-2004
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

 
Reply With Quote
 
 
 
 
Peter Hansen
Guest
Posts: n/a
 
      12-13-2004
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.
 
Reply With Quote
 
 
 
 
Istvan Albert
Guest
Posts: n/a
 
      12-13-2004
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.
 
Reply With Quote
 
Nick Craig-Wood
Guest
Posts: n/a
 
      12-14-2004
Peter Hansen <> 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 <> -- http://www.craig-wood.com/nick
 
Reply With Quote
 
Lucas Hofman
Guest
Posts: n/a
 
      12-14-2004
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


 
Reply With Quote
 
Lucas Hofman
Guest
Posts: n/a
 
      12-14-2004
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

 
Reply With Quote
 
Simon Wittber
Guest
Posts: n/a
 
      12-14-2004
> 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\python Python23\lib\test\pystone.py
Pystone(1.1) time for 50000 passes = 1.43068
This machine benchmarks at 34948.3 pystones/second

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

Sw.
 
Reply With Quote
 
Mark Asbach
Guest
Posts: n/a
 
      12-14-2004
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
 
Reply With Quote
 
Raymond Hettinger
Guest
Posts: n/a
 
      12-14-2004
"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>\python23\python timeit.py -r9 "[i for i in xrange(1000)]"
100 loops, best of 9: 1.11 msec per loop

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


Raymond Hettinger


 
Reply With Quote
 
Lucas Hofman
Guest
Posts: n/a
 
      12-14-2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
StringBuilder's performance lower than that of StringBuffer Raga Java 7 04-05-2007 07:15 AM
Help. SessionID is x then y then x then y BodiKlamph@gmail.com ASP General 0 09-03-2005 03:02 PM
Re: Performance (pystone) of python 2.4 lower then python 2.3 ??? Andreas Kostyrka Python 0 12-17-2004 02:00 PM
greater then / less then =?Utf-8?B?TWlrZQ==?= ASP .Net 2 11-04-2004 06:05 PM
Do accessors lower performance? Zhao Java 3 10-11-2003 07:53 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57