-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data retrieved from powershell can be huge (and time consuming) #650
Comments
@xavier-deryckere thats a good finding. Will think of reducing the needed columns! The second problem is, that spinnig up powershell is quite intense ... so there is (currently undocumented - still in progress of improving it) another option to start up powershell only once. To enable this you need to run But maybe you already have seen that ;-) |
Yes I have seen that but did not try. |
@xavier-deryckere ... only when having multiple calls, than I experienced much better numbers but you are right, the amount of data is something I will have a look on! Thank you so much. |
@xavier-deryckere ... thank you once again. I now reduces all data retrieved from powerShell commands to the minimum and I see on my windows machines good improvements in the speed of
Version 5.11.2 just released. Thank you once again! |
Hello
On Windows since wmic has been replaced with powershell some calls take a lot of time.
Selecting only the actually used data seems to reduce that time a lot.
calling:
si.processes()
with wmi:
0.5 second
0.5 MB of data
with powershell:
5 seconds
1 MB of data
Can be checked by just running both commands in a prompt
wmic process get /value > wmic.txt
=> quick
powershell "Get-WmiObject Win32_Process | fl *" > ps.txt
=> takes ages
instead of getting everything:
util.powerShell('Get-WmiObject Win32_Process | fl *').then((stdout, error) => {
I tested with
const fields = [ 'ProcessId', 'ParentProcessId', 'ExecutionState', 'Caption', 'CommandLine', 'ExecutablePath', 'UserModeTime', 'KernelModeTime', 'WorkingSetSize', 'Priority', 'PageFileUsage', 'CreationDate' ];
util.powerShell('Get-WmiObject Win32_Process | select ' + fields.join(',')).then((stdout, error) => {
=>
1.6 seconds
0.2 MB of data
Still not as good as before, but still :-)
I guess the same applies to some extent to other powershell calls as well.
The text was updated successfully, but these errors were encountered: