Major speed change old 2.5 -> latest 2.5 build
Hi, I'm accessing a database through a .NET DLL and I noticed that the initial open/load function is taking 20 times as long in Python.NET 2.6 as it is in my Python.NET 2.5. When I went to check on what 2.5 version I was using I found a newer one on sourceforge; well using pythonnet-2.0-alpha2-clr2.0_py25.zip is giving the same slow speeds as the 2.6 & 2.7 versions I was trying. The 2.5 that is giving me fast times (0.8 - 1.2 seconds) versus (18-24 seconds) I got a few years ago in a package called 'pythonnet-2.0-alpha2.zip' that contained directories for 2.4 & 2.5, UCS2 & UCS4; the Python.Runtime.DLL is dated 6 Sep 2007. Any idea why the speed difference? And is it possible to get back to the fast version for 2.6 & 2.7? I'm running Windows 7, 32 bit. Thanks, Craig.
Sounds like you are running in the interactive mode; ie opened python session interactively in a command prompt and typed import clr In which case; help(clr) # would yield: Help on module clr: NAME clr FILE (built-in) DATA AddReference = <CLRModuleFunction 'AddReference'> FindAssembly = <CLRModuleFunction 'FindAssembly'> ListAssemblies = <CLRModuleFunction 'ListAssemblies'> getPreload = <CLRModuleFunction 'getPreload'> setPreload = <CLRModuleFunction 'setPreload'> The Preload flag is set to True in interactive mode. Its function is to load the entire namespace of the default assemblies into the interpreter's namespace (mostly for debugging). Please confirm that clr.setPreload(False) clears up your concern. Thank you -Barton On 07/03/2011 11:39 PM, Craig Farrow wrote:
Hi,
I'm accessing a database through a .NET DLL and I noticed that the initial open/load function is taking 20 times as long in Python.NET 2.6 as it is in my Python.NET 2.5.
When I went to check on what 2.5 version I was using I found a newer one on sourceforge; well using pythonnet-2.0-alpha2-clr2.0_py25.zip is giving the same slow speeds as the 2.6 & 2.7 versions I was trying. The 2.5 that is giving me fast times (0.8 - 1.2 seconds) versus (18-24 seconds) I got a few years ago in a package called 'pythonnet-2.0-alpha2.zip' that contained directories for 2.4 & 2.5, UCS2 & UCS4; the Python.Runtime.DLL is dated 6 Sep 2007.
Any idea why the speed difference? And is it possible to get back to the fast version for 2.6 & 2.7?
I'm running Windows 7, 32 bit.
Thanks,
Craig.
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
Barton, It is true that getPreload yields True in interactive mode and False in an application, however, that setting has no effect for me. In interactive mode with the old 2.5 whether Preload is set to True or False the db load time is just over 1 second. In the new 2.5 and 2.6 & 2.7 in both interactive mode and application mode the load time is between 14 and 18 seconds. Everything else is the same between runs; and I'm starting a fresh session for each test. Thanks for your help, Craig. 18/07/2011 2:47 a.m. dï, Barton pišdimiš:
Sounds like you are running in the interactive mode; ie opened python session interactively in a command prompt and typed
import clr
In which case;
help(clr) # would yield:
Help on module clr:
NAME clr
FILE (built-in)
DATA AddReference = <CLRModuleFunction 'AddReference'> FindAssembly = <CLRModuleFunction 'FindAssembly'> ListAssemblies = <CLRModuleFunction 'ListAssemblies'> getPreload = <CLRModuleFunction 'getPreload'> setPreload = <CLRModuleFunction 'setPreload'>
The Preload flag is set to True in interactive mode. Its function is to load the entire namespace of the default assemblies into the interpreter's namespace (mostly for debugging).
Please confirm that
clr.setPreload(False)
clears up your concern.
Thank you -Barton
On 07/03/2011 11:39 PM, Craig Farrow wrote:
Hi,
I'm accessing a database through a .NET DLL and I noticed that the initial open/load function is taking 20 times as long in Python.NET 2.6 as it is in my Python.NET 2.5.
When I went to check on what 2.5 version I was using I found a newer one on sourceforge; well using pythonnet-2.0-alpha2-clr2.0_py25.zip is giving the same slow speeds as the 2.6 & 2.7 versions I was trying. The 2.5 that is giving me fast times (0.8 - 1.2 seconds) versus (18-24 seconds) I got a few years ago in a package called 'pythonnet-2.0-alpha2.zip' that contained directories for 2.4 & 2.5, UCS2 & UCS4; the Python.Runtime.DLL is dated 6 Sep 2007.
Any idea why the speed difference? And is it possible to get back to the fast version for 2.6 & 2.7?
I'm running Windows 7, 32 bit.
Thanks,
Craig.
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
participants (2)
-
Barton
-
Craig Farrow