-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Engine-Performancecore PowerShell engine, interpreter, and runtime performancecore PowerShell engine, interpreter, and runtime performance
Milestone
Description
Here PerfView trace https://ru.files.fm/u/n2hqqsr7z

-
GetFileAttributesExW() reported to .Net Runtime. I hope they can reduce these operations TPA list building is contributing large % of time to startup dotnet/runtime#44545The referenced .NET issue was addressed. - PR Replace Newtonsoft.Json with System.Text.Json in PSConfiguration #14411 newtonsoft.json It read powershell.config.json Expected perf win 50-100 ms.
- There is an idea to use defaults and exclude the file at all in release version. (We still need the file for preview versions for experimental features turn on/off.)
- We should migrate to .Net System.Text.Json API. It is expected being faster.
-
CreateManifestAndDescriptors() I don't know if it's possible to remove this delay. Tracking issue Slow AssemblyLoadContext.StartAssemblyLoad() at startup dotnet/runtime#45466This only appears when collecting ETW traces. See Startup performance PowerShell 7.2.0-Preview.1 #14268 (comment) -
PR Remove dead code from SemanticVersion class #14320. SemanticVersion.op_Implicit There is dead code that we need to remove because we haven't received any feedback that it is needed. Expected perf win about 50 ms.PR closed because it's not dead code. -
microsoft.applicationinsights Perhaps we could lazy the initialization. PR Send telemetry lazy at startup #14281 - perf win from 30 to 100 ms. - PR Speedup InitialSessionState..cctor() #14283. InitialSessionState..cctor() See GetAppLockerPolicy() method. Perf win ~10-30 ms
-
Creation of explorer menu should be moved to right place (from line 184 to line 220) - it makes no sense to run the code in server mode - and be probably runned in background.Answered in Startup performance PowerShell 7.2.0-Preview.1 #14268 (comment) - Use
StringComparison.Ordinalinsted ofStringComparison.CurrentCultureinstring.StartsWith()inConsoleHost.Start(). It is slow ICU initialization. PR Use StringComparison.Ordinal insted of StringComparison.CurrentCulture at startup time #14298 - perf win ~5 ms. - We use
string.ToLowerInvariant()inCommandLineParser.GetSwitchKey(). It is slow ICU initialization - 26 ms! Reported to List of performance regressions caused by switching to ICU dotnet/runtime#40942 (comment) - PR Use StringComparison.Ordinal insted of StringComparison.CurrentCulture at startup time #14298. Use
StringComparison.Ordinalinstead ofStringComparison.CurrentCultureat startup time. It removes early Culture initialization. - PR Use OrdinalIgnoreCase in CommandLineParser #14303. Use
OrdinalIgnoreCaseinCommandLineParser. It removes early Culture initialization. - PR Exclude string.ToLowerInvariant() in GetEnvironmentVariableAsBool() #14323. Exclude
string.ToLowerInvariant()inGetEnvironmentVariableAsBool(). It is slow ICU initialization. - Exclude loading
System.Diagnostics.FileVersionInfo.dllon Windows inAmsiUtils.Init(). Retrieve PowerShell version in PSVersionInfo using assembly informational version instead of FileVersionInfo #14332 (comment) -
Review how we use (1) Jit paramteters, (2) crossgen.exe for same assemblies (Build.psm1) - it seems no effect on startup scenarioUse .NET crossgen properties in.csprojfiles. All shipped assemblies are R2R images now. - Benefit from modern CrossGen2 and dotnet-pgo
https://github.com/dotnet/runtime/tree/master/src/coreclr/tools/dotnet-pgo
Environment data
Name Value
---- -----
PSVersion 7.2.0-preview.1
PSEdition Core
GitCommitId 7.2.0-preview.1-62-g15e4e8a6af2f120bbd1eef8607131d878677c0ad
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
rgwood, mklement0, gulshan, musm, Jaykul and 7 more
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Engine-Performancecore PowerShell engine, interpreter, and runtime performancecore PowerShell engine, interpreter, and runtime performance