One of the less fun aspects of process management on POSIX systems is waiting for a process to terminate. The standard library's subprocess module has relied on a busy-loop polling approach since the timeout parameter was added to...
Blog posts tagged "performance"
Preface: the migration to pytest Last year, after 17 years of unittest, I started adopting pytest in psutil (see #2446). The two advantages I cared about most were plain assert statements and pytest-xdist's free parallelism. Tests still inherit...
This is part of the psutil 5.3.0 release (see the changelog for the full list of changes). The old pattern Iterating over processes and collecting attributes requires more boilerplate than it should. A process returned by process_iter() may...
Starting from psutil 5.0.0 you can query multiple Process fields around twice as fast as before (see #799 and Process.oneshot()). It took 7 months, 108 commits, and a massive refactoring of psutil internals (PR-937), and I think it's one of the...
sendfile(2) is a UNIX system call which provides a "zero-copy" way of copying data from one file descriptor (a file) to another (a socket). Because this copying is done entirely within the kernel, sendfile(2) is more efficient than the...