makepy, ADO and dynamic.py

Roger Upole rupole at hotmail.com
Sun Sep 10 15:02:37 EDT 2006


"Chris Curvey" <ccurvey at gmail.com> wrote in message news:1157833453.539654.197000 at i42g2000cwa.googlegroups.com...
> 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





More information about the Python-list mailing list