-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
area-Tracing-coreclrenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionstenet-performancePerformance related issuePerformance related issue
Milestone
Description
Description
Related #44598
I measured PowerShell startup scenario with pwsh -c exit (really start-stop scenario).
One delay in the scenario is in AssemblyLoadContext.StartAssemblyLoad() called from hostpolicy - 59 ms (10%).
The StartAssemblyLoad() initializes tracing
Lines 199 to 206 in 191ea06
| private static void StartAssemblyLoad(ref Guid activityId, ref Guid relatedActivityId) | |
| { | |
| // Make sure ActivityTracker is enabled | |
| ActivityTracker.Instance.Enable(); | |
| // Don't use trace to TPL event source in ActivityTracker - that event source is a singleton and its instantiation may have triggered the load. | |
| ActivityTracker.Instance.OnStart(NativeRuntimeEventSource.Log.Name, AssemblyLoadName, 0, ref activityId, ref relatedActivityId, EventActivityOptions.Recursive, useTplSource: false); | |
| } |
Especially the slow System.Threading.Tasks.TplEventSource..cctor () - 49 ms (8.5%).
(And System.Diagnostics.Tracing.NativeRuntimeEventSource..cctor() too)
We can't seem to improve this in PowerShell and I hope it will be improved in .Net in some way. Perhaps it is possible to postpone the initialization or make it async.
Configuration
Used PowerShell 7.2 Preview.1 based on .Net 5.0.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-Tracing-coreclrenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionstenet-performancePerformance related issuePerformance related issue

