[python-uk] Python Programming on Win32

Tim Diggins subscribed at red56.co.uk
Fri Mar 5 04:14:33 EST 2004

Duncan Booth wrote:

> Python.Net makes .Net classes available to the standard Python 2.3 
> interpreter. 

> The main drawback though is that any call 
> to .Net is *slow*. I tried a simple program that filled a dictionary 
> with strings, or filled a .Net hashtable with the same strings. The 
> calls to .Net worked out slower by a factor of 100. So, if you want 
> to use this, try to keep tight loops either entirely in Python or 
> entirely in .Net, don't cross the bridge too often.

Do you think this is slower than with COM returns? I've found that the
latency of COM-calls is much more significant than the data throughput,
which is (I guess) saying the same thing as you did for .NET, and is (I
suppose, thinking about DB connections and so on) generally true for any
inter-application communications.

Although the only time one has a choice between .NET and COM is (I suppose)
when you're building "both sides" of a cross-application/cross-component
connection... as I'm about to do, I suddenly remember. So your answer is
more than academically interesting!



PS - I learned not only the python but a lot about COM theory and Office
(particularly Excel) Object model as well from the Python Programming on
Win32 - would heartily recommend it (especially as most intros & reference
to office object models assume you're programming in VBA within an office
application environment - which changes the way you have to worry about
synchronisation (or total lack of) & object reference issues...)

  Tim Diggins

More information about the python-uk mailing list