Posted by: leppie | August 24, 2007

Benchmarks updated

Earlier I posted some rather non technical benchmarking result. Also, the python times was compared in the interactive console. Here are the results running from the command line:

IronLisp: Build in release mode
time: 326.281ms
time: 303.722ms
time: 313.096ms
time: 304.353ms
time: 305.102ms

IronPython: Latest checkout, build in release mode
Result: 7 Time: 0.763377747731
Result: 7 Time: 0.657344718393
Result: 7 Time: 0.655193607009
Result: 7 Time: 0.664234979585

Python 2.51
C:\Python25>python.exe -O
Result: 7 Time: 1.38913744624
Result: 7 Time: 1.38743890634
Result: 7 Time: 1.37719849869
Result: 7 Time: 1.37393355859

As you can see this paints a different picture. The picture is indeed very good as the DLR compiles most of the code. I tried running IronPython in ‘eval’ mode, but it seem to think about something forever šŸ™‚ (this didnt happen though previously when tested on the interactive console).

Here is the python code:

import time

def tak (x, y, z):
    if not(y < x):
        return z
        return tak(tak(x-1, y, z), tak(y-1, z, x), tak(z-1, x, y))

for i in range(4):
  t = time.clock()
  r = tak(24, 14, 6)
  t2 = time.clock()
  print "Result: ", r, "Time: ", (t2 - t)

dumb theme
And finally the IronLisp code (see that macro!!!):

(using System.Diagnostics)

(= tak (fn (x y z)
  (if (not (< y x))
    (tak (tak (- x 1) y z)
         (tak (- y 1) z x)
         (tak (- z 1) x y) ))))

(= time (macro (x)
      (= sw (startnew stopwatch))
      (= ts (elapsed sw))
      (cwl "time: {0:f3}ms" (totalmilliseconds ts)))))

(to i 4
  (time (tak 24 14 6)))


  1. You can make the CPython version significantly faster by using psyco. On my computer it ran more than 35 times faster than without psyco. Just install the psyco module and add the following lines after the import time statement.

    import psyco

    You can download psyco at


  2. Interesting šŸ™‚

    Here are the comparable numbers:
    Result: 7 Time: 0.0792550449848
    Result: 7 Time: 0.0781764162764
    Result: 7 Time: 0.0818623596016
    Result: 7 Time: 0.0777285939973


    • Well the new HTC Thunderbolt is out now, my buddy just picked one up and while its very slick, it still has nothing on the next droid coming out around June. I think I’m going to wait for the Motorola Droid Bionic. Incase you haven’t heard about the Bioinic you can check out Maggie from Cnet to read more. Awesome is coming in June!

  3. Here are comparative times for C#:

    time: 57.141ms result: 7
    time: 46.176ms result: 7
    time: 46.313ms result: 7
    time: 49.795ms result: 7
    time: 46.579ms result: 7

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: