[python-win32] WMI speed (was: How to determine if a process (known pid) is still running ?)

Les Schaffer schaffer at optonline.net
Mon Oct 6 01:08:40 CEST 2008


Tim Golden wrote:
>
> I'm not entirely sure what you're trying to achieve,
> or what "reuse the running process" means. This WMI
> snippet will tell you whether a given pid is running
> or not. As you may know, WMI isn't the fastest thing
> on earth, but it may be fast enough for you.

well, since you raise the issue  ;-)

i am working on a python application that uses WMI to monitor various 
states of the system while the app goes about its business. we have the 
app running on about 10 different machines, and 9 out of 10 of the 
platforms run our WMI queries in milliseconds, whereas on one particular 
machine, the same query takes about 5 seconds.

i am trying to figure out where the delay could be coming from, meaning 
i need to write some profiling code. but i imagine it could be one of 
several things:

1. the one machine has a huge WMI database so takes longer to query (but 
the machine is brand new with little software or special hardware installed)
2. COM code is clunky???, but why so slow on one machine
2. python-COM interface, but whats so special about this one machine...

anyone here have similar experience with WMI?

many thanks

Les Schaffer







More information about the python-win32 mailing list