mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
darwin: lazily set process TTY name
Fetching the TTY name of a process is extremely expensive on darwin and the call to devname accounts for 95% of htop's CPU usage when there is high process turnover (this is mostly due to devname calling lstat, which is incredibly slow). This can make htop unresponsive. To mitigate this only set the process TTY name if the it is being actively displayed (PROCESS_FLAG_TTY), which by default it is not on darwin.
This commit is contained in:
@ -13,6 +13,8 @@ in the source distribution for its full text.
|
||||
#include "darwin/DarwinProcessList.h"
|
||||
|
||||
|
||||
#define PROCESS_FLAG_TTY 0x00000100
|
||||
|
||||
typedef struct DarwinProcess_ {
|
||||
Process super;
|
||||
|
||||
|
Reference in New Issue
Block a user