-
-
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
Twitter coverage #928
Comments
Most of these WMI usages can be replaced by native Win32 APIs giving the same info (for example, to get the free space on a drive, GetDiskFreeSpace). Otherwise, if WMI is really needed, there is a native WMI API that can be used instead of forking out to PowerShell (which is really slow). |
@ovinusreal thank you for pointing me to this discussion. I know (and this is also stated in the docs) that on Windows the situation is far from being optimal. This is mostly related to the absence of easy ways to gather system relevant information in Windows. The first route I took was using I am working on a new version of this library that should make the PowerShell calls more efficient but It will still take some time to finish this new version (6.0) as there are also a lot of new functions that I am planning to finish. My take way is still some improvements mentioned in the twitter chat that I will try to come up with a better solution. |
There is no need to call into WMI for most of these, there are available native APIs. |
@sylveon ... well yes. But this would require some external dependencies (like ffi, node-ffi, sbffi or others) plus some C code ... which I always wanted to avoid. |
I don't think avoiding native code is the best choice here. WMI is already resource intensive, per se. |
hi, as the OP of that tweet i did want to apologise for anything that might've come your way as a result, did not remotely expect the reception it got and had i anticipated that i would've been much less harsh that said, i do echo some of the sentiment here, the correct way to read this information on windows is programmatically via C-based apis, which is effectively what you're doing with powershell, just... slowly. as im sure you well know by now powershell can have a lot of launch and runtime overhead on slower or ultra-low-power processors (as was the case for me), especially when many instances are launched at once (as node's a set of native bindings would likely be a better long-term solution though i very much understand the difficulty that comes with that, maybe for a separate project? |
Recently, the package was criticized on Twitter as a dependency of the Discord native app for unnecessarily many invocations of Powershell. I'm quoting them here in case they are valid feedback:
systeminformation/lib/filesystem.js
Line 197 in 6ffb79a
systeminformation/lib/graphics.js
Lines 387 to 416 in 6ffb79a
systeminformation/lib/util.js
Line 38 in 6ffb79a
The former appears to be already addressed in #927
They also recommend using
GetACP
instead of having to assume codepage 437.systeminformation/lib/util.js
Lines 565 to 595 in 6ffb79a
I am not familiar with Windows development, and some of these don't provide better alternatives, so feel free to close this issue if the claims were baseless or made without context.
Nonetheless, thanks for the work you've put into this project!
The text was updated successfully, but these errors were encountered: