COM access sooo slow !?

K

kowald

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
 
D

Do Re Mi chel La Si Do

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
 
N

nicolas_riesch

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top