How does python.exe compare directly to ipy.exe? That is, try running "date +%M:%S;ipy.exe interpolate.py;date +%M:%S" instead of using the DLR hosting APIs.
Thanks, Dave From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfredo Lugo Sent: Wednesday, November 12, 2008 8:32 AM To: [email protected] Subject: [IronPython] Performance Issue Hi All, I have a Python interpolation script which basically reads data from a file and perform a linear interpolation of the data present on the file. I have been using this script for some time. Right now I am working on a C# application that also performs linear interpolation, so I decided to use IronPython to call my script. However, I am havving a huge performance difference from running the script on common python and running it on IronPython. Here is an output of the following command using normal python (Cygwin under windows Vista): $ date +%M:%S;python interpolate.py;date +%M:%S 15:27 WARNING: desired starting time (Tue Jan 1 00:00:21 2008) prior to time of first data point (Tue Jan 1 00:00:32 2008), current line: 9411 series: 3D force==False, exiting.. 15:31 ----------------------------------------------------------------------------- It basically took 4 seconds to complete. Now if I run it on IronPython using VS and C# (Release mode) here is the output: 11/12/2008 12:16:34 PM WARNING: desired starting time (Tue Jan 01 00:00:21 2008) prior to time of first data point (Tue Jan 01 00:00:32 2008), current line: 9411 series: 3D force==False, exiting.. 0 11/12/2008 12:19:07 PM ----------------------------------------------------------------------------- The same script is taking more than 3 minutes and a half. Here is the C# Code: ----------------------------------------------------------------------------- static void Main(string[] args) { ScriptRuntime runtime = Python.CreateRuntime(); ScriptEngine engine = Python.CreateEngine(); ScriptSource source = engine.CreateScriptSourceFromFile("interpolate.py"); ScriptScope scope = engine.CreateScope(); Console.WriteLine(DateTime.Now); source.Execute(scope); Microsoft.Func<string, string, string, string, int, int> func = scope.GetVariable<Microsoft.Func<string, string, string, string, int, int>>("interpolate_start"); Console.WriteLine(func("3-day-data.txt", "3-day-output.txt", "2008-01-01 00:00:21","2008-01-03 23:59:08",60).ToString()); Console.WriteLine(DateTime.Now); Console.ReadLine(); } I am using IronPython 2.0B5 and Visual Studio 2003 running on .Net3.0 Windows Vista. The script and the C# code were run on the same machine. If there is something I am doing wrong? I really don't understand the performance difference. regards, wilfredo
_______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
