Hi Göran,<div><br></div><div>    is it possible to repeat the runs with a much higher iteration count so that we get less temporal quantization?  The numbers below are extremely round simply because the number of iterations are so low (on modern hardware).  Also, is the source available?  URL?  Ta!</div>
<div><br></div><div>thanks; this has brightened my day!!</div><div><br></div><div>best</div><div>Eliot<br><br><div class="gmail_quote">2011/2/7 Göran Krampe <span dir="ltr">&lt;<a href="mailto:goran@krampe.se">goran@krampe.se</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi folks!<br>
<br>
Since we are on the verge of 4.2, and we have a brand new Cog VM to play with I felt like dusting off my old Pystone port to Squeak - Sqystone, which I wrote back in 2004.<br>
<br>
At that time Squeak was around 5 times faster than CPython. How do we stack up today? Yeah, I know - hardly a good benchmark, they all lie etc etc. :)<br>
<br>
I am using Ubuntu 10.10 on a corei7, so this is running on a 64 bit CPU.<br>
<br>
<br>
Cog!<br>
====<br>
Squeak 4.2-10966 (soon to be released) + latest Cog r2361 (binary download):<br>
Pystone(1.1) time for 50000 passes = 0.06<br>
This machine benchmarks at 833333.3 pystones/second<br>
<br>
NOTE: AFAICT running with more passes does not improve it. Also, not sure if I could get more out of this if I built from source on my box.<br>
<br>
<br>
Regular Squeak<br>
==============<br>
Squeak 4.2-10966 (soon to be released) + regular Squeak VM 4.4.7-2357 (built from src):<br>
Pystone(1.1) time for 50000 passes = 0.503<br>
This machine benchmarks at 99403.6 pystones/second<br>
<br>
<br>
Regular CPython<br>
===============<br>
CPython 3.1.2 (newest in Ubuntu Meerkat, minimal):<br>
gokr@quigon:/usr/lib/python3.1/test$ python3.1 pystone.py<br>
Pystone(1.1) time for 50000 passes = 0.57<br>
This machine benchmarks at 87719.3 pystones/second<br>
<br>
NOTE: 3.2 is reportedly a teeny bit faster. Also not built from source.<br>
<br>
<br>
Pypy 1.4<br>
========<br>
wget <a href="http://pypy.org/download/pypy-1.4.1-linux64.tar.bz2" target="_blank">http://pypy.org/download/pypy-1.4.1-linux64.tar.bz2</a><br>
gokr@quigon:~/python/pypy-1.4.1-linux64$ ./bin/pypy ./lib-python/2.5.2/test/pystone.py<br>
Pystone(1.1) time for 50000 passes = 0.15<br>
This machine benchmarks at 333333 pystones/second<br>
gokr@quigon:~/python/pypy-1.4.1-linux64$ ./bin/pypy ./lib-python/2.5.2/test/pystone.py 5000000<br>
Pystone(1.1) time for 5000000 passes = 4.8<br>
This machine benchmarks at 1.04167e+06 pystones/second<br>
<br>
NOTE: Also not built from source. Here we run pystone a second time with 100x more loops and get a substantially better number.<br>
<br>
<br>
Shedskin 0.7<br>
============<br>
sudo apt-get install g++ libpcre3-dev libgc-dev python-dev<br>
sudo dpkg -i shedskin_0.7_all.deb<br>
wget <a href="http://shedskin.googlecode.com/files/shedskin-examples-0.7.tgz" target="_blank">http://shedskin.googlecode.com/files/shedskin-examples-0.7.tgz</a><br>
shedskin pystone.py<br>
gokr@quigon:~/python/shedskin-examples-0.7$ make<br>
g++  -O2 -march=native -fomit-frame-pointer -Wno-deprecated  -I. -I/usr/share/shedskin/lib /usr/share/shedskin/lib/builtin.cpp pystone.cpp /usr/share/shedskin/lib/time.cpp /usr/share/shedskin/lib/re.cpp -lgc -lpcre  -o pystone<br>

gokr@quigon:~/python/gokr@quigon:~/python/shedskin-examples-0.7$ ls -la pystone*<br>
-rwxr-xr-x 1 gokr gokr 297329 2011-02-07 23:01 pystone<br>
-rw-r--r-- 1 gokr gokr   9193 2011-02-07 23:00 pystone.cpp<br>
-rw-r--r-- 1 gokr gokr   1893 2011-02-07 23:00 pystone.hpp<br>
-rw-r--r-- 1 gokr gokr   5774 2010-12-11 11:40 pystone.py<br>
gokr@quigon:~/python/shedskin-examples-0.7$ ./pystone<br>
This machine benchmarks at 2500000.000000 pystones/second<br>
<br>
NOTE: I am wondering a bit about this. It tells the same whatever loops I give it... But ok, perhaps it is all fine.<br>
<br>
<br>
Summary<br>
=======<br>
<br>
- The regular Squeak VM has not been overrun by CPython in these 6 years time. When I wrote Sqystone Squeak was 5x faster IIRC (can&#39;t find the post anymore). Now they are equal more or less, Squeak still a teeny bit faster.<br>

<br>
- Cog is brutally fast on this one. Compared to CPython and regular Squeak almost 10x faster.<br>
<br>
- Pypy is about 20% faster than Cog if given enough time to actually start jitting. Cool for the Pypy project! And cool that they aren&#39;t that much faster than Cog. :)<br>
<br>
- Shedskin is the &quot;state of the art&quot; of statically compiling Python via C++ using type inferencing etc etc - so I hear. It is said to be faster than Cython and Psyco. It ends up beating Cog, but &quot;only&quot; by a factor of 3x. I say &quot;only&quot; because that seems pretty good to me given that Cog is a JIT and still pretty young and that Shedskin can only run a subset of Python.<br>

<br>
<br>
regards, Göran<br>
<br>
</blockquote></div><br></div>