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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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 ------- #unpp.py import time def unpp(pp): time1=time.clock() 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]) time2=time.clock() 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 50.3331431788 50.3331713947 -- 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 63280770878.0 63280770878.0 -- 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? Thanks! -- Joseph _______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
