Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • If they all use the same console window, why is powershell so much slower? Why does the OP experience different results? I can attest to cmd.exe being faster than powershell.exe for running multiple instances of another program.
    – GChuf
    Commented Apr 7, 2023 at 8:35
  • Depends on which part of it is actually slower? PowerShell itself is slow to start up, but I'm not sure when the "other program" comes in, in your case. Commented Apr 7, 2023 at 8:39
  • "the other program" as you put it is just a binary that does something. The whole problem is that calling that binary through windows terminal or powershell is slower and hogs more resources than cmd. Hence the question how to make that faster.
    – GChuf
    Commented Apr 7, 2023 at 8:45
  • Again, which part of it? Does the binary itself occupy more memory or take more CPU to perform the same task when it's run from within PowerShell, or does PowerShell just take longer to spawn the binary initially? Is it the binary, or the PowerShell process, or the Conhost/WindowsTerminal process that's using those resources? Commented Apr 7, 2023 at 9:00
  • I understand your question now. In my own experience, the binary performs the same. It's the (powershell/windows terminal)conhost process that takes a lot of memory, and a lot of time to start up.
    – GChuf
    Commented Apr 7, 2023 at 9:07