In TelemetryContext, and in auto-generated constructors of each base telemetry item, ConcurrentDictionaries are created for each telemetry item creation. This is a perf hit as ConcurrentDictionaries are expensive to create, and in most cases, the item is sampled out, so this ConccurentDictionary allocation is wasted.
https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/src/Microsoft.ApplicationInsights/DataContracts/TelemetryContext.cs#L42
https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/src/Microsoft.ApplicationInsights/Extensibility/Implementation/External/AvailabilityData_types.cs#L97
Proposal is to make the ConcurrentDictionary creation lazy, and improve performance.
Version Info
SDK Version :
.NET Version :
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) :
OS :
Hosting Info (IIS/Azure WebApps/ etc) :
In
TelemetryContext, and in auto-generated constructors of each base telemetry item, ConcurrentDictionaries are created for each telemetry item creation. This is a perf hit as ConcurrentDictionaries are expensive to create, and in most cases, the item is sampled out, so this ConccurentDictionary allocation is wasted.https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/src/Microsoft.ApplicationInsights/DataContracts/TelemetryContext.cs#L42
https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/src/Microsoft.ApplicationInsights/Extensibility/Implementation/External/AvailabilityData_types.cs#L97
Proposal is to make the ConcurrentDictionary creation lazy, and improve performance.
Version Info
SDK Version :
.NET Version :
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) :
OS :
Hosting Info (IIS/Azure WebApps/ etc) :