psyco, jython, and python speed tests

Sandy Norton sandskyfly at hotmail.com
Fri Mar 15 06:02:38 EST 2002


Hi,

I wanted to repeat Amund Tveit's simple speed tests of jython and
python (see: http://sourceforge.net/mailarchive/message.php?msg_id=705994),
and place them alongside results from Armin Rigo's python optimizing
compiler, psyco. Here are my results for your interest:

METHOD:
------
I ran pystone once with a 1000,000 iterations setting (pretty much
duplicating what Amund did).


CONFIG:
------
Dell 8100 laptop, windoze XP, PIII-700, 512 MB ram, jdk1.4:


TEST RESULTS:
------------

(in decreasing order of performance)
    
psyco 0.4 (cpython22 running psycoized pystone)
    Pystone(1.1) time for 1000000 passes = 16.1721
    This machine benchmarks at 61834.8 pystones/second

jython21 (with -server jvm setting)*
    Pystone(1.1) time for 1000000 passes = 41.739
    This machine benchmarks at 23958.4 pystones/second

cpython22 (with -O optimization setting)
    Pystone(1.1) time for 1000000 passes = 55.4291
    This machine benchmarks at 18041.1 pystones/second

cpython2.1.2 (with -O optimization setting)
    Pystone(1.1) time for 1000000 passes = 57.1236
    This machine benchmarks at 17505.9 pystones/second

cpython22 (default)
    Pystone(1.1) time for 1000000 passes = 61.3202
    This machine benchmarks at 16307.8 pystones/second

cpython2.1.2 (default)
    Pystone(1.1) time for 1000000 passes = 61.7983
    This machine benchmarks at 16181.7 pystones/second

jython21 (default hotspot jvm)
    Pystone(1.1) time for 1000000 passes = 108.046
    This machine benchmarks at 9255.32 pystones/second


* my particular command for running jython21 (with -server setting)
follows from Amund's posting (one line, yours may be different):

"C:\Engines\j2sdk\jre\bin\java.exe" -server -Xmx200m
"-Dpython.home=C:\Engines\jython21" -classpath
"C:\Engines\jython21\jython.jar;%CLASSPATH%" org.python.util.jython
pystone.py


SIDE BY SIDE:
------------
                (1000,000 pystone iterations)

                            pystones        pystones/sec
                secs	    /sec	    relative to cpy22

psyco0.4	16.1721	    61834.8	    3.79
jython21S	41.739	    23958.4	    1.47
cpython22O	55.4291	    18041.1	    1.11
cpython212O	57.1236	    17505.9	    1.07
cpython22	61.3202	    16307.8	    1
cpython212	61.7983	    16181.7	    0.99
jython21	108.046	    9255.32	    0.57


MY COMMENTS:
--------------
o psyco rocks.

o jython's no spring chicken for long running processes
  (with the right JVM setting of course) but is relatively slow
  otherwise.

o Turning on the optimization _does_ extract small but
  definite performance enhancements from your python interpreter.
  
o I'm already more than happy with the everyday performance of 
  python22, but I'm also happy that people are looking into the 
  performance 'problem'... even though, at least in my case, almost 
  all the times I've personally found that an app was running slowly,
  it was due to a mistake in the code, and careful redesign fixed 
  it without having to revert to extension writing.

o Sometimes, it's nice to think I have performance problems, so I can
  go through the exercise of writing python extensions (another 
  learning experience)

o Developments like psyco should be encouraged and supported because
  ultimately accelerating python is a good thing: it takes away one 
  usual criticism of those who have _never tried_ to develop in 
  python. For those who have, the productivity benefits, of course,
  by far outweigh any so-called 'performance' issues.

I don't advise you to read too much into these results as the tests
were only run once for each configuration, and, of course, for all the
other typical reasons one has against benchmarking.
 

ciao,

Sandy



More information about the Python-list mailing list