gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

Optimization Request: Reducing the Number of windows.OpenProcess Calls When Gathering Name, CreateTime, and PPID

Open vela-security opened this issue 11 months ago • 2 comments

Hello,

I'm currently facing a performance bottleneck in my application due to the need to repeatedly call windows.OpenProcess to obtain information such as the process name, creation time, and parent process ID (PPID) for the same process. This repeated operation significantly impacts the overall performance and efficiency of the process information gathering routine in my application.

I'm looking for a way to optimize this aspect, specifically by minimizing the number of times windows.OpenProcess needs to be invoked for the same process. The goal is to improve the performance of my application by reducing the overhead associated with these repetitive system calls.

Is there a recommended approach or best practice for consolidating these operations or somehow reusing the handle obtained from windows.OpenProcess to get all the required information (name, creation time, PPID) in a more efficient manner? Any suggestions or guidance on how to achieve this optimization would be greatly appreciated.

Thank you for your attention to this issue.

vela-security avatar Mar 06 '24 06:03 vela-security