giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.1k stars 1.37k forks source link

Rewrite get_process_open_files() in C for OSX #152

Closed giampaolo closed 10 years ago

giampaolo commented 10 years ago

From g.rodola on February 23, 2011 03:16:10

Patch in attachment reimplements get_process_open_files() in C on OSX instead 
of parsing lsof output.

Before:
real    0m0.420s
user    0m0.137s
sys     0m0.267s

Now:
real    0m0.144s
user    0m0.082s
sys     0m0.056s

That's about 3x faster and far more reliable than current implementation.

Attachment: osx_open_files.patch

Original issue: http://code.google.com/p/psutil/issues/detail?id=152

giampaolo commented 10 years ago

From g.rodola on February 22, 2011 18:20:51

Committed in r937 .

Status: FixedInSVN

giampaolo commented 10 years ago

From g.rodola on February 28, 2011 13:55:27

Labels: Milestone-0.2.1

giampaolo commented 10 years ago

From g.rodola on February 28, 2011 15:15:33

Done also on FreeBSD in r942 .

Summary: Rewrite get_process_open_files() in C for OSX and FreeBSD
Labels: OpSys-FreeBSD

giampaolo commented 10 years ago

From g.rodola on March 03, 2011 07:10:34

It seems kinfo_getfile() is not available on FreeBSD versions < 8.0.
I think we can use kvm_*() calls instead, but I'd rather plan to do this in a 
future version.
As for now I'm going to revert this change and fall back on using lsof 
implementation.

Summary: Rewrite get_process_open_files() in C for OSX
Labels: -OpSys-FreeBSD

giampaolo commented 10 years ago

From g.rodola on March 04, 2011 09:05:51

Reverted in r944 .
giampaolo commented 10 years ago

From g.rodola on March 20, 2011 14:55:37

Status: Fixed

giampaolo commented 10 years ago

From g.rodola on March 02, 2013 03:59:27

Updated csets after the SVN -> Mercurial migration: r937 == revision 
11445175ab4f r942 == revision c404fabfec56 r944 == revision 3d48861f1cf5