COM access sooo slow !?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kowald@molgen.mpg.de

    #1

    COM access sooo slow !?

    Hi everybody,

    I'm using win32com.client .Dispatch() to access a COM object (a
    database) from Python and in principle is works fine.

    However, it is unbelievably slow :-(
    It is 70 times slower than a C++ version of the same program !

    Is this a well known problem of the Python COM interface or could it be
    specific to this special COM object?

    Any ideas?

    Many thanks,

    Axel

  • Do Re Mi chel La Si Do

    #2
    Re: COM access sooo slow !?

    Hi !

    I use a COM server, made with Python & Win32all (PyWin32). The speed of
    function's call is : 5 seconds, for 100 000 calls.
    Only the first call is slow (due to time to load Python...)

    Config : W-XP, P.2.4.1, 1.6 GHz, 512MB RAM

    @-salutations & sorry for my bad english

    Michel Claveau


    Comment

    • nicolas_riesch

      #3
      Re: COM access sooo slow !?

      I also use Python to access database on Windows.
      You can speed up your program by doing that:

      Open PythonWin, then click on the "Tools" menu and the item "COM Makepy
      Utility".
      It will display all libraries available.
      Then, select "Microsoft ActiveX Data Objects 2.7 Library" or whatever
      last version of ADO you have.
      You just need to do it once, as it registers the objects of the library
      in the registry ( I think. I don't completely understand the mechanism.
      )

      If you use another library, do the same thing with the library you use.

      Comment

      Working...