-
Notifications
You must be signed in to change notification settings - Fork 299
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
Set-PSReadLineOption is slow when called from profile #4022
Comments
Do you mean
I cannot reproduce the issue locally. I have 3 calls to |
Hi, for me it's the general Set-PSReadlineOption. Even a single Set-PSReadlineOption will introduce over 100 ms delay. |
Even
If you really want to dig into it, I guess you will have to collect traces using prefview, which is not easy for a starter. You will need to build PSReadLine locally with the |
There are other ways for profiling, maybe easier than using the perfview. See https://github.com/dotnet/performance/blob/main/docs/profiling-workflow-dotnet-runtime.md |
Just out of curiosity do you have some other software running that might be causing issues, ie: Defender, FireEye, etc. My work laptop frequently has performance issues running my wacky PowerShell profile because of those two specific applications scanning all the things. 😭 My latest issue was I have a function |
Thanks for the suggestion. I can take a look, but honestly, I don't think that's the reason. I have disabled Defender. |
Let me put some profiling result here.
|
I am not sure if this information is sufficient to help diagnose the issue, but if not, please let me know and I can provide more details. I am much more familiar with VTune, so if that would help, I can provide information from that as well. Based on my findings so far, the issue seems more likely to be related to PowerShell rather than PSReadLine. |
Just out of curiosity does the startup time only increase with that particular command or does it increase with anything in your profile? |
Hi @StevenBucher98, it increases with any line with |
Same here. |
Prerequisites
Exception report
N/A
Screenshot
measure-command { Set-PSReadLineOption -HistoryNoDuplicates -EditMode Windows }
Environment data
Steps to reproduce
This has been reported in #476, but closed without much context been provided.
Set-PSReadLineOption calling from profile will take much longer than calling from a running pwsh. Adding a single line of Set-PSReadLineOption in profile delays start up time over 100 ms. I wonder how is the 11 ms load time is achieved mentioned in that issue and what can I do to ease the issue.
Expected behavior
Same execution time when running from profile.
Actual behavior
Much longer execution time in profile.
The text was updated successfully, but these errors were encountered: