-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Startup performance PowerShell 7.2.0-Preview.1 #14268
Copy link
Copy link
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
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
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.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.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)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.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)StringComparison.Ordinalinstead ofStringComparison.CurrentCultureat startup time. It removes early Culture initialization.OrdinalIgnoreCaseinCommandLineParser. It removes early Culture initialization.string.ToLowerInvariant()inGetEnvironmentVariableAsBool(). It is slow ICU initialization.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.https://github.com/dotnet/runtime/tree/master/src/coreclr/tools/dotnet-pgo
Environment data