[python-win32] Can I pass non-VARIANT SAFARRAYs via COM without converting to VA RIANT?

Klaus Nökel Klaus.Noekel at ptv.de
Fri Nov 25 08:54:29 CET 2005


Hi,

I am working on an application where one of our own number crunching
products acts as a COM server. From a Python script which is the COM client
I want to retrieve large matrices, manipulate them with numarray, and store
the result back in the COM server. I currently pass the matrices as VT_ARRAY
| VT_VARIANT objects, but this is a waste of time and space compared to
VT_ARRAY | VT_R8. Tests with a VBA client show that the latter are passed
~20 times faster, and in less memory. For matrices of 3000x3000 elements
this is a concern. Interestingly, win32com accepts matrices of VT_V8 element
type, but actually takes longer (!) than in the case of VT_VARIANT,
presumably because of an extra conversion (instead of one less).

Is there any way that I can configure python-win32 to use VT_V8 as the
element type of a SAFE_ARRAY and suppress any conversion to VT_VARIANT?

Any hints are appreciated!

Cheers,

Klaus Noekel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20051125/4aa5dbe7/attachment.html


More information about the Python-win32 mailing list