quinn at riyal.ugcs.caltech.edu
Thu Mar 15 10:55:43 CET 2001
On Mon, 12 Mar 2001 15:22:16 -0800, Timothy Grant <tjg at exceptionalminds.com>
>I hope everyone is enjoying there first week back after the
>events of P9.
>I need to create a list of processes and process information. I
>have created a class that contains much of the information in
>It works quite well, however, it takes about four seconds to
>populate a list of 90 procs. This seems a bit long. Is there a
>faster way to get ahold of the information than reading /proc?
You don't say what OS you're using, but from the sig I'm guessing Linux. In
Linux, /proc is the official interface. /bin/ps and friends use it. Try
'cat /proc/[0-9]*/status >/dev/null'. If that takes less than four seconds,
then the slowdown is likely in your code, not /proc. On this linux machine,
it takes a few hundredths of a second for several hundred procs.
More information about the Python-list