mirror of https://github.com/shirou/gopsutil
[process][windows] Use win32 API in process.Children() instead of slow WMI call
The CreateToolhelp32Snapshot+Process32First+Process32Next combo already iterates over all processes, so it would be inefficient to enumerate all processes with process.Processes() and then calling p.Ppid() on each of them: we just use this combo to get all processes and their ppid in a single iteration. This is faster by a factor of 25 compared to the previous WMI call.pull/609/head
parent
48177ef5f8
commit
6b539051d2
Loading…
Reference in New Issue