Why is wmic so slow




















Closing this for now, as we already seen that the called functions resolves according to all our tests but on some low-end machines this might be slow due to the underlying windows system calls.

Thanks sebhildebrandt , it makes sense. Closed topic but worth noting for future head scratchers that WMIC. We've experienced environments where these calls fail to return entirely because WMIC is blocked. We've also experienced environments where these calls seem to be slowed down presumably by Windows Defender or other security systems:.

Issue Explorer. Windows Intel: sometimes systemInformation. Describe the bug Maybe related to We have been told in comment that: the problem you are describing is due to the fact that windows wmic is super slow!

The latency is due to initialization of WMI the first time. If you re-run the program a second time within a short period you won't see the delay. And it doesn't happen once OSHI is up and running polling periodically.

The delay is outside OSHI: if you try a wmic command line query of the same information you'll get the long delay. If you do this before initializing the processor, the tick query will fail return 0's after 1 second but may work a second time; perhaps you could retry with increasing delays until it works.

You can turn it back to infinite timeout of -1 after you're done. Sorry, something went wrong. So I've been fighting this thing for a few years. See for some even worse examples. Interestingly, Windows 10 and multiples of 20 seconds seem to be commonalities for the one remaining recurring issue.

If this is the case, the strategy I mentioned in the previous comment should work do a query with a short timeout, and if it fails try again. Testing on my Win10 machine I'm getting those second timeouts and it's not the first overall WMI query. The error is in the first tick count query, but it should be getting that from Performance Counters, not WMI except as a backup.

This comment shows I missed removing a debugging query. Seeing if removing that fixes the problem This should be fixed well, the slow WMI query is still there but it shouldn't execute if you haven't disabled performance counters. My testing with the latest snapshot 3. That isn't better than before, in fact, it tends to be slower. I think I also had a user who claimed that it wasn't done after 4 minutes.

This blog will be useful blogs. Really cmd is capturable? Kennedy: well, you can run a "console" program and capture it's output in your application See stackoverflow.

Query updated in question, please help me — Marcus J. Add a comment. Active Oldest Votes. So this ToString ; That should run fairly quick since its only getting the two properties you are using. Improve this answer. Paul G Paul G 1, 5 5 silver badges 14 14 bronze badges. Sign up or log in Sign up using Google.

Quick access. Search related threads. Remove From My Forums. Asked by:. Archived Forums. Visual C. Sign in to vote. My question now is Who did implement this? Wednesday, January 11, PM.



0コメント