Open
Description
Repro
dotnet new console
in .NET 7 SDK, copy&paste the following program (repro extracted from actual app where the issue was observed)
using System.Diagnostics;
var sw = new Stopwatch();
for (;;)
{
sw.Restart();
for (int i = 0; i < 100000; i++) Type.GetType("System.String, System.Runtime");
Console.WriteLine(sw.ElapsedMilliseconds);
}
dotnet run
- Download latest perfview and start a global collection session with default settings (Select "Collect / Collect" from menu and press "Start Collection" button)
Actual result
Program runs more than 10x slower when the perfview collection session is active
Expected result
Default perfview collection settings should not slow down the program by more than 10%
The problem is caused by very slow assembly loader tracing. The fix should be to either make assembly loader tracing a lot faster and lighter weight for cases like this one and/or assembly loader tracing should not be enabled for default (perfview) event collection settings.
Metadata
Metadata
Assignees
Type
Projects
Status
No status