You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
One idea is to do cache. gopsutil has a function called EnableBoottimeCache that allows the startup time to be cached. This is mainly for Linux.
Also, psutil can use cache. I believe the number of calls can be reduced by introducing this feature. But no plans at the moment, PR is always welcome!
Lomanic
changed the title
: Optimization Request: Reducing the Number of windows.OpenProcess Calls When Gathering Name, CreateTime, and PPID
Optimization Request: Reducing the Number of windows.OpenProcess Calls When Gathering Name, CreateTime, and PPID
Sep 10, 2024
This oneshot feature in psutil is what is proposed in #286, I would suggest closing this current issue in favor of that one. Rewriting gopsutil to achieve that feature is not small work, although a PR was already opened.
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.
The text was updated successfully, but these errors were encountered: