I've been benchmarking the Pi on some of my simulation codes, relative to a couple of laptops I have. My codes tend to be floating point intensive, so I've been using Raspbian (which turns out to be much faster) due to its hard-float support. I have the same simple code in several different languages. Obviously python code is slower than C code whatever platform I use, but on the Pi it appears to be relatively more slow, by a factor of around 3. Does anyone know why the python interpreter is likely to be relatively slow on the Pi, and is this something that is likely to be fixed?
Here is the test:
import random,math
def gibbs(N=50000,thin=1000):
x=0
y=0
print "Iter x y"
for i in range(N):
for j in range(thin):
x=random.gammavariate(3,1.0/(y*y+4))
y=random.gauss(1.0/(x+1),1.0/math.sqrt(2*x+2))
print i,x,y
gibbs()
From this blog post about the experiment.