Minor performance improvements for runspace initialization#10569
Minor performance improvements for runspace initialization#10569daxian-dbw merged 2 commits intoPowerShell:masterfrom
Conversation
daxian-dbw
left a comment
There was a problem hiding this comment.
Perf win ~2.3%
This comment is not accurate. This code path is hit 4 or 5 times at most when Runspace opens. There are many other places checks for file existence, such as in PowerShellConfig when reading the config json file. So removing this check won't eliminate all FileSystem.FileExist calls.
|
Can you update your PR description to not say a 2.3% perf win? |
|
It's still not accurate as there may be other calls to |
|
Done. |
|
@daxian-dbw Could you please merge? |
|
@iSazonov Sorry I forgot this :) |
|
🎉 Handy links: |

PR Summary
Comments says that the code was optimized in Windows PowerShell but there is still room for improvements that is important for scenarios actively using runspaces and startup.
Remove check that file exist.

The code came from Windows PowerShell but now all the standard dlls is placed in $PSHome and we have no need to search them in other paths by the dll name.
Remove some obvious allocations
PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.