This is based on https://github.com/giampaolo/psutil/issues/2366#issuecomment-2381646555. On Windows, we now determine process unique identity by using process' fast create time method. This has more chances to fail with AccessDenied for ADMIN owned processes, but it shouldn't matter because if we have no rights to get process ctime we'll also have no rights to accidentally kill() the wrong process PID anyway. This should drastically speedup process_iter() when used for retrieving process info one time instead of in a loop (e.g. htop like apps).
Summary
Description
This is based on https://github.com/giampaolo/psutil/issues/2366#issuecomment-2381646555. On Windows, we now determine process unique identity by using process' fast create time method. This has more chances to fail with
AccessDenied
for ADMIN owned processes, but it shouldn't matter because if we have no rights to get process ctime we'll also have no rights to accidentallykill()
the wrong process PID anyway. This should drastically speedupprocess_iter()
when used for retrieving process info one time instead of in a loop (e.g. htop like apps).