[IronPython] Speed test

Dino Viehland dinov at exchange.microsoft.com
Mon Apr 17 17:10:37 CEST 2006

IronPython is slower to get things going the first time (because we end up compiling to IL and then JITing the code); it's after that when we really start to shine.

The first time you run this we will take longer to execute it, but if you do it a second time we'll report zero.  When I run it the first time I get ~.20 seconds, the second time I get 0 seconds - which is just below the precision of the clock.

Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox
Sent: Sunday, April 16, 2006 8:07 AM
To: Discussion of IronPython
Subject: [IronPython] Speed test

Am I doing this speed test correctly using the script and process below?

I have unpp.py on a usb jumpdrive E
import time

def unpp(pp):
    toks = pp.strip(' ()\n').split()
    pred = toks[0]
    args = ' '.join(toks[1:])[1:-1].split('" "')
    f,i = map(lambda x:int(x.split('=')[1]),args.pop().split(';')[:2])
    print pred,args[0],args[1],f,i
    print time1
    print time2
    print "-- unpp took",str(round(time2-time1,6)),'seconds. --\n'

===== I run a test in IDLE
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
IDLE 1.1.2      ==== No Subprocess ====
>>> import sys
>>> sys.path.append('E/')
>>> import unpp
>>> p=unpp
>>> p.unpp('(CapableOf \"red bicycle\" \"pump\" \"f=2;i=1;\")')
CapableOf red bicycle pump 2 1
-- unpp took 2.8e-005 seconds. --
===== END of IDLE test 2.8e-005 = 0.000028

====== I run same test in IronPythonConsole
IronPython 1.0.2280 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> import sys
>>> sys.path.append('E:/')
>>> import unpp
>>> p=unpp
>>> p.unpp('(CapableOf \"red bicycle\" \"pump\" \"f=2;i=1;\")')
CapableOf red bicycle pump 2 1
-- unpp took 0.046867 seconds. --
===== END of IronPythonConsole test

If I am doing this correctly, there seems to be a big process time
difference, does this seem to be correct, or I am missing something or
doing the time() incorrectly?
users mailing list
users at lists.ironpython.com

More information about the Ironpython-users mailing list