makepy, ADO and dynamic.py

C

Chris Curvey

I'm trying to track down a performance issue in my Windows code, and
hotshot is telling me that the most time and calls are spent in these
methods

ncalls tottime percall cumtime percall filename:lineno(function)
75975 63982.779 0.842 124464.419 1.638
c:\python24\lib\site-packages\win32com\client\dynamic.py:285(_make_method_)
71294 47871.424 0.671 50629.224 0.710
c:\python24\lib\site-packages\win32com\client\__init__.py:444(_ApplyTypes_)

If I understand correctly, running makepy on the appropriate COM class
should get rid of the dynamic stuff and let it be called directly. I
use ADODB to talk to my database server, and I've run makepy for
"Microsoft Active X Data Objects 2.8 Library" [1] and on "Microsoft
ActiveX Data Objects Recordset 2.8 Library", but I'm still seeing the
call to the dynamic.py class.

Am I right that seeing the calls in "dynamic.py" implies that I'm
running "makepy" on the wrong thing? Any idea what I should be running
makepy on?

[1] I seem to have a bunch of versions of "Microsoft ActiveX Data
Objects Library", is there a chance that another ADO library is being
used?
 
R

Roger Upole

Chris Curvey said:
I'm trying to track down a performance issue in my Windows code, and
hotshot is telling me that the most time and calls are spent in these
methods

ncalls tottime percall cumtime percall filename:lineno(function)
75975 63982.779 0.842 124464.419 1.638
c:\python24\lib\site-packages\win32com\client\dynamic.py:285(_make_method_)
71294 47871.424 0.671 50629.224 0.710
c:\python24\lib\site-packages\win32com\client\__init__.py:444(_ApplyTypes_)

If I understand correctly, running makepy on the appropriate COM class
should get rid of the dynamic stuff and let it be called directly. I
use ADODB to talk to my database server, and I've run makepy for
"Microsoft Active X Data Objects 2.8 Library" [1] and on "Microsoft
ActiveX Data Objects Recordset 2.8 Library", but I'm still seeing the
call to the dynamic.py class.

Am I right that seeing the calls in "dynamic.py" implies that I'm
running "makepy" on the wrong thing? Any idea what I should be running
makepy on?

[1] I seem to have a bunch of versions of "Microsoft ActiveX Data
Objects Library", is there a chance that another ADO library is being
used?

The most reliable way to make sure the generated support is used is
to call win32com.client.gencache.EnsureDispatch. If a typelib can
be found, the corresponding python module will be created if it doesn't
already exist.

Roger
 

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
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top