Process details
Quinn Dunkan
quinn at riyal.ugcs.caltech.edu
Thu Mar 15 04:55:43 EST 2001
On Mon, 12 Mar 2001 15:22:16 -0800, Timothy Grant <tjg at exceptionalminds.com>
wrote:
>Hi all,
>
>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
>/proc/'pid'/status.
>
>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
mailing list