Skip to content

Apply .cctor deadlock defense on .NET Core (follow-up to #8498)#8517

Merged
NachoEchevarria merged 3 commits into
masterfrom
nacho/NetcoreAssemblyLoadSeparation
Apr 27, 2026
Merged

Apply .cctor deadlock defense on .NET Core (follow-up to #8498)#8517
NachoEchevarria merged 3 commits into
masterfrom
nacho/NetcoreAssemblyLoadSeparation

Conversation

@NachoEchevarria

@NachoEchevarria NachoEchevarria commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #8498. No known .NET Core trigger today; defense-in-depth for consistency.

Summary of changes

Mirror the .NET Framework fix from #8498 on .NET Core. Move the AppDomain.AssemblyResolve and AssemblyLoadContext.Default.Resolving handlers, plus the assembly cache and DependencyLoadContext, off Startup onto ManagedProfilerAssemblyResolver.

Reason for change

The mechanism behind #8498 — "invoking a static member requires the declaring type's .cctor to have completed" — is runtime-generic; only the trigger (<appSettings> configBuilder) was Framework-specific. On .NET Core both AppDomain.AssemblyResolve (static method on Startup) and AssemblyLoadContext.Default.Resolving (lambda compiled to a static method on Startup) have the same latent hazard if anything in the .cctor chain ever does sync-over-async.

Implementation details

Same shape as #8498:

  • New ManagedProfilerAssemblyResolver.NetCore.cs with the handlers, ResolveAssembly, DependencyLoadContext, cache, and a PopulateAssemblyCache entry point.
  • Startup.NetCore.cs slimmed — ComputeTfmDirectory delegates cache population to the resolver.
  • Startup.cs: #if NETFRAMEWORK conditionals removed; both TFMs subscribe through the resolver, and the ALC Resolving lambda now points at OnAssemblyLoadContextResolving. LoadAssembly fallback uses the resolver unconditionally.

Both OnAssemblyResolve and OnAssemblyLoadContextResolving wrap ResolveAssembly in a try/catch that logs via StartupLogger and returns null, matching the .NET Framework resolver. Without this, a throw from LoadFromAssemblyPath (e.g. BadImageFormatException, FileLoadException) would propagate into whoever triggered the resolve — often a credential-chain probe expecting null on miss — breaking their fallback logic.

Startup..cctor seeds ManagedProfilerAssemblyResolver.ManagedProfilerDirectory before subscribing, triggering the resolver's trivial .cctor up-front so ThreadPool dispatches don't wait on anything.

Test coverage

No new tests — the deadlock is theoretical on .NET Core. Existing loader/instrumentation tests exercise the new dispatch path.

Other details

None.

@NachoEchevarria NachoEchevarria changed the title Separate assembly resolve in startup - netcore Apply .cctor deadlock defense on .NET Core (follow-up to #8498) Apr 24, 2026
@pr-commenter

pr-commenter Bot commented Apr 24, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-24 11:42:20

Comparing candidate commit 04042b4 in PR branch nacho/NetcoreAssemblyLoadSeparation with baseline commit 8339c77 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 61 known flaky benchmarks, 26 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0

  • 🟩 throughput [+10226.664op/s; +12405.456op/s] or [+8.596%; +10.427%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+313.175ms; +317.605ms] or [+155.408%; +157.607%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 execution_time [+381.482ms; +383.581ms] or [+301.394%; +303.052%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+400.753ms; +403.575ms] or [+354.651%; +357.148%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-16.485ms; -12.316ms] or [-7.699%; -5.752%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.502%; +27.510%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-259903.242op/s; -256470.933op/s] or [-26.537%; -26.187%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-27.054ms; -22.195ms] or [-12.065%; -9.898%]
  • 🟥 throughput [-90040.794op/s; -66898.338op/s] or [-9.619%; -7.147%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-131007.491op/s; -115174.234op/s] or [-18.823%; -16.548%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟩 throughput [+9105.842op/s; +12069.083op/s] or [+5.794%; +7.679%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟩 throughput [+8009.328op/s; +10653.039op/s] or [+6.380%; +8.487%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟩 throughput [+344798.437op/s; +367636.150op/s] or [+11.497%; +12.259%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟩 execution_time [-18.413ms; -14.052ms] or [-8.488%; -6.478%]
  • 🟩 throughput [+203420.675op/s; +256822.806op/s] or [+8.074%; +10.194%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟥 execution_time [+299.875ms; +300.560ms] or [+149.837%; +150.180%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟥 execution_time [+299.384ms; +302.486ms] or [+150.980%; +152.544%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1

  • 🟥 execution_time [+299.960ms; +302.678ms] or [+151.096%; +152.466%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+297.365ms; +298.277ms] or [+146.054%; +146.502%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+294.677ms; +297.376ms] or [+144.057%; +145.376%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+303.272ms; +305.352ms] or [+151.575%; +152.615%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟥 execution_time [+20.726µs; +44.309µs] or [+6.617%; +14.146%]
  • 🟥 throughput [-414.406op/s; -215.938op/s] or [-12.918%; -6.731%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.896ms; +300.568ms] or [+149.679%; +150.014%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • unstable execution_time [+341.620ms; +381.363ms] or [+371.184%; +414.366%]
  • 🟩 throughput [+1161.159op/s; +1316.689op/s] or [+9.541%; +10.819%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • unstable execution_time [+304.479ms; +342.809ms] or [+231.188%; +260.292%]
  • 🟩 throughput [+606.583op/s; +811.960op/s] or [+5.872%; +7.860%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+353.486ms; +412.551ms] or [+162.529%; +189.687%]
  • 🟥 throughput [-473.439op/s; -425.269op/s] or [-42.898%; -38.534%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • unstable execution_time [+205.055ms; +338.272ms] or [+87.386%; +144.157%]
  • 🟥 throughput [-744.636op/s; -661.219op/s] or [-49.667%; -44.104%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 allocated_mem [+2.304KB; +2.308KB] or [+5.441%; +5.449%]
  • 🟥 execution_time [+338.714ms; +345.656ms] or [+202.590%; +206.742%]
  • 🟥 throughput [-400.568op/s; -365.968op/s] or [-27.891%; -25.482%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0

  • 🟥 execution_time [+107.817µs; +136.722µs] or [+7.407%; +9.393%]
  • 🟥 throughput [-58.177op/s; -45.373op/s] or [-8.469%; -6.605%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟩 execution_time [-162.247µs; -132.525µs] or [-8.219%; -6.713%]
  • 🟩 throughput [+37.686op/s; +45.723op/s] or [+7.440%; +9.026%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.090ms; +302.667ms] or [+151.623%; +152.417%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+302.648ms; +304.094ms] or [+151.657%; +152.382%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+300.795ms; +303.803ms] or [+151.107%; +152.618%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.053ms; +303.922ms] or [+151.681%; +152.619%]
  • 🟩 throughput [+16187.468op/s; +17861.372op/s] or [+5.423%; +5.984%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+298.111ms; +300.266ms] or [+147.403%; +148.468%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+302.790ms; +306.550ms] or [+153.467%; +155.373%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+301.984ms; +303.844ms] or [+151.569%; +152.502%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+299.953ms; +302.356ms] or [+149.499%; +150.697%]
  • 🟩 throughput [+41080.768op/s; +47199.995op/s] or [+8.157%; +9.372%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+300.586ms; +309.442ms] or [+149.539%; +153.945%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0

  • 🟩 execution_time [-16.445ms; -12.799ms] or [-7.647%; -5.952%]
  • 🟩 throughput [+18377.468op/s; +25422.624op/s] or [+5.041%; +6.974%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 allocated_mem [-20.675KB; -20.655KB] or [-7.542%; -7.534%]
  • unstable execution_time [-42.651µs; +9.693µs] or [-8.430%; +1.916%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • 🟩 allocated_mem [-18.880KB; -18.864KB] or [-6.883%; -6.877%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟥 execution_time [+6.131µs; +10.094µs] or [+14.492%; +23.858%]
  • 🟥 throughput [-4624.849op/s; -2864.091op/s] or [-19.469%; -12.057%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1

  • unstable execution_time [-13.777µs; -6.551µs] or [-21.374%; -10.164%]
  • 🟩 throughput [+1669.874op/s; +3176.049op/s] or [+10.245%; +19.486%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.505ms; +303.799ms] or [+152.903%; +153.557%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+303.318ms; +305.413ms] or [+154.388%; +155.454%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+301.156ms; +303.602ms] or [+150.766%; +151.990%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+29438.139op/s; +32940.430op/s] or [+5.572%; +6.235%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.883ms; +301.585ms] or [+149.465%; +150.313%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+301.997ms; +303.034ms] or [+151.649%; +152.169%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+303.964ms; +306.732ms] or [+154.151%; +155.555%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.342ms; +301.053ms] or [+149.812%; +150.167%]
  • 🟩 throughput [+61090559.924op/s; +61339518.143op/s] or [+44.490%; +44.671%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • 🟥 execution_time [+420.795ms; +425.487ms] or [+523.333%; +529.169%]
  • 🟩 throughput [+1031.658op/s; +1208.170op/s] or [+7.975%; +9.340%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 execution_time [+299.008ms; +299.929ms] or [+149.138%; +149.598%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 throughput [+97814.200op/s; +107227.350op/s] or [+9.133%; +10.011%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1

  • 🟩 throughput [+47434.703op/s; +67396.382op/s] or [+5.490%; +7.801%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0

  • 🟩 throughput [+87647.708op/s; +119097.782op/s] or [+6.784%; +9.218%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+75359.753op/s; +85138.149op/s] or [+7.484%; +8.456%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟩 throughput [+39330.915op/s; +45930.898op/s] or [+7.142%; +8.340%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1

  • 🟩 throughput [+29757.311op/s; +39383.117op/s] or [+6.661%; +8.815%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472

  • 🟥 throughput [-43481.834op/s; -40087.304op/s] or [-6.364%; -5.867%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+91771.452op/s; +109564.281op/s] or [+10.253%; +12.241%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Apr 24, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8517) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration72.94 ± (73.21 - 73.67) ms72.48 ± (72.51 - 72.86) ms-0.6%
.NET Framework 4.8 - Bailout
duration78.71 ± (78.53 - 79.10) ms76.61 ± (76.38 - 76.72) ms-2.7%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1073.48 ± (1073.43 - 1080.21) ms1085.27 ± (1084.46 - 1090.46) ms+1.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms23.00 ± (22.94 - 23.07) ms22.47 ± (22.43 - 22.51) ms-2.3%
process.time_to_main_ms87.66 ± (87.29 - 88.02) ms85.68 ± (85.45 - 85.90) ms-2.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.92) MB10.92 ± (10.91 - 10.92) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.68 ± (22.63 - 22.72) ms22.49 ± (22.45 - 22.53) ms-0.8%
process.time_to_main_ms87.17 ± (86.94 - 87.40) ms86.50 ± (86.28 - 86.71) ms-0.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.94 - 10.95) MB10.95 ± (10.94 - 10.95) MB+0.0%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms211.69 ± (210.83 - 212.54) ms211.20 ± (210.32 - 212.09) ms-0.2%
process.time_to_main_ms531.55 ± (530.30 - 532.80) ms531.56 ± (530.09 - 533.04) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.02 ± (47.99 - 48.04) MB48.06 ± (48.03 - 48.08) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.4%
.NET 6 - Baseline
process.internal_duration_ms21.36 ± (21.31 - 21.41) ms21.08 ± (21.04 - 21.11) ms-1.3%
process.time_to_main_ms75.46 ± (75.19 - 75.74) ms73.38 ± (73.21 - 73.56) ms-2.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.60 - 10.61) MB10.63 ± (10.63 - 10.63) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.00 ± (20.96 - 21.05) ms21.43 ± (21.37 - 21.49) ms+2.0%✅⬆️
process.time_to_main_ms73.88 ± (73.71 - 74.05) ms77.55 ± (77.23 - 77.87) ms+5.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.72 - 10.73) MB10.74 ± (10.74 - 10.74) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms382.59 ± (380.49 - 384.69) ms382.71 ± (380.86 - 384.56) ms+0.0%✅⬆️
process.time_to_main_ms528.25 ± (526.96 - 529.54) ms533.39 ± (532.06 - 534.72) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.39 ± (49.36 - 49.42) MB49.39 ± (49.36 - 49.42) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.72 ± (19.66 - 19.77) ms19.56 ± (19.52 - 19.60) ms-0.8%
process.time_to_main_ms74.17 ± (73.93 - 74.40) ms73.39 ± (73.16 - 73.61) ms-1.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.69) MB7.68 ± (7.67 - 7.69) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.74 ± (19.69 - 19.79) ms19.45 ± (19.41 - 19.49) ms-1.4%
process.time_to_main_ms75.86 ± (75.62 - 76.11) ms74.03 ± (73.87 - 74.19) ms-2.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.72 - 7.73) MB7.73 ± (7.72 - 7.74) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms296.47 ± (294.25 - 298.69) ms301.85 ± (299.57 - 304.14) ms+1.8%✅⬆️
process.time_to_main_ms486.60 ± (485.48 - 487.72) ms495.41 ± (494.09 - 496.72) ms+1.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.46 ± (36.44 - 36.49) MB36.49 ± (36.47 - 36.52) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.0%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration201.56 ± (201.40 - 202.45) ms202.88 ± (203.33 - 204.65) ms+0.7%✅⬆️
.NET Framework 4.8 - Bailout
duration206.15 ± (206.13 - 207.41) ms206.83 ± (207.57 - 208.93) ms+0.3%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1194.30 ± (1195.25 - 1203.18) ms1202.69 ± (1205.39 - 1213.44) ms+0.7%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms195.93 ± (195.46 - 196.40) ms197.08 ± (196.46 - 197.70) ms+0.6%✅⬆️
process.time_to_main_ms84.58 ± (84.29 - 84.86) ms85.70 ± (85.40 - 86.01) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed15.97 ± (15.95 - 15.99) MB16.02 ± (16.00 - 16.03) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.9%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms194.90 ± (194.42 - 195.39) ms196.63 ± (196.08 - 197.18) ms+0.9%✅⬆️
process.time_to_main_ms85.59 ± (85.33 - 85.85) ms86.96 ± (86.70 - 87.22) ms+1.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.04 ± (16.03 - 16.06) MB16.06 ± (16.05 - 16.08) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 21)21 ± (21 - 21)+0.6%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms385.64 ± (384.59 - 386.69) ms390.17 ± (388.77 - 391.58) ms+1.2%✅⬆️
process.time_to_main_ms528.47 ± (527.03 - 529.92) ms540.78 ± (539.22 - 542.34) ms+2.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.42 ± (57.23 - 57.61) MB57.89 ± (57.69 - 58.09) MB+0.8%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.4%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms200.72 ± (200.24 - 201.20) ms203.16 ± (202.52 - 203.79) ms+1.2%✅⬆️
process.time_to_main_ms73.85 ± (73.59 - 74.10) ms74.82 ± (74.56 - 75.08) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.34 ± (16.31 - 16.36) MB16.34 ± (16.33 - 16.36) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+1.3%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms198.95 ± (198.39 - 199.52) ms201.90 ± (201.30 - 202.50) ms+1.5%✅⬆️
process.time_to_main_ms74.52 ± (74.31 - 74.73) ms75.66 ± (75.42 - 75.90) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.32 ± (16.30 - 16.34) MB16.33 ± (16.31 - 16.35) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.9%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms595.01 ± (592.41 - 597.61) ms597.31 ± (594.82 - 599.80) ms+0.4%✅⬆️
process.time_to_main_ms527.09 ± (525.85 - 528.34) ms535.93 ± (534.77 - 537.10) ms+1.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.04 ± (60.94 - 61.15) MB61.17 ± (61.07 - 61.27) MB+0.2%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms199.60 ± (198.80 - 200.40) ms201.75 ± (201.09 - 202.41) ms+1.1%✅⬆️
process.time_to_main_ms73.25 ± (72.90 - 73.60) ms74.04 ± (73.75 - 74.34) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.71 ± (11.69 - 11.73) MB11.68 ± (11.66 - 11.69) MB-0.2%
runtime.dotnet.threads.count18 ± (18 - 18)19 ± (19 - 19)+1.4%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms196.99 ± (196.49 - 197.49) ms200.79 ± (200.18 - 201.40) ms+1.9%✅⬆️
process.time_to_main_ms73.49 ± (73.30 - 73.69) ms74.91 ± (74.67 - 75.14) ms+1.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.75 ± (11.74 - 11.77) MB11.70 ± (11.68 - 11.71) MB-0.5%
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (20 - 20)+1.6%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms519.58 ± (516.61 - 522.55) ms526.16 ± (521.30 - 531.02) ms+1.3%✅⬆️
process.time_to_main_ms486.16 ± (485.14 - 487.19) ms496.75 ± (495.62 - 497.87) ms+2.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.34 ± (50.30 - 50.38) MB50.30 ± (50.25 - 50.35) MB-0.1%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.4%✅⬆️
Comparison explanation

Execution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8517) - mean (73ms)  : 70, 75
    master - mean (73ms)  : 70, 77

    section Bailout
    This PR (8517) - mean (77ms)  : 75, 78
    master - mean (79ms)  : 74, 83

    section CallTarget+Inlining+NGEN
    This PR (8517) - mean (1,087ms)  : 1044, 1131
    master - mean (1,077ms)  : 1027, 1127

Loading
FakeDbCommand (.NET Core 3.1)
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8517) - mean (115ms)  : 110, 120
    master - mean (118ms)  : 112, 124

    section Bailout
    This PR (8517) - mean (116ms)  : 114, 119
    master - mean (117ms)  : 113, 121

    section CallTarget+Inlining+NGEN
    This PR (8517) - mean (782ms)  : 753, 811
    master - mean (780ms)  : 752, 808

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8517) - mean (101ms)  : 97, 104
    master - mean (104ms)  : 99, 109

    section Bailout
    This PR (8517) - mean (106ms)  : 100, 112
    master - mean (101ms)  : 98, 104

    section CallTarget+Inlining+NGEN
    This PR (8517) - mean (946ms)  : 906, 987
    master - mean (939ms)  : 909, 969

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8517) - mean (101ms)  : 96, 106
    master - mean (102ms)  : 97, 108

    section Bailout
    This PR (8517) - mean (101ms)  : 98, 104
    master - mean (104ms)  : 99, 108

    section CallTarget+Inlining+NGEN
    This PR (8517) - mean (830ms)  : 786, 874
    master - mean (816ms)  : 780, 852

Loading
HttpMessageHandler (.NET Framework 4.8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8517) - mean (204ms)  : 194, 214
    master - mean (202ms)  : 194, 210

    section Bailout
    This PR (8517) - mean (208ms)  : 198, 219
    master - mean (207ms)  : 197, 217

    section CallTarget+Inlining+NGEN
    This PR (8517) - mean (1,209ms)  : 1149, 1269
    master - mean (1,199ms)  : 1143, 1255

Loading
HttpMessageHandler (.NET Core 3.1)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8517) - mean (293ms)  : 280, 305
    master - mean (289ms)  : 280, 299

    section Bailout
    This PR (8517) - mean (294ms)  : 281, 307
    master - mean (290ms)  : 279, 301

    section CallTarget+Inlining+NGEN
    This PR (8517) - mean (970ms)  : 944, 995
    master - mean (954ms)  : 921, 987

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8517) - mean (288ms)  : 272, 303
    master - mean (284ms)  : 274, 294

    section Bailout
    This PR (8517) - mean (288ms)  : 272, 303
    master - mean (282ms)  : 270, 295

    section CallTarget+Inlining+NGEN
    This PR (8517) - mean (1,164ms)  : 1115, 1213
    master - mean (1,153ms)  : 1114, 1191

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8517) - mean (287ms)  : 274, 300
    master - mean (283ms)  : 270, 297

    section Bailout
    This PR (8517) - mean (287ms)  : 275, 299
    master - mean (281ms)  : 271, 291

    section CallTarget+Inlining+NGEN
    This PR (8517) - mean (1,060ms)  : 978, 1143
    master - mean (1,039ms)  : 992, 1085

Loading

@NachoEchevarria NachoEchevarria added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Apr 24, 2026
@NachoEchevarria
NachoEchevarria marked this pull request as ready for review April 24, 2026 12:15
@NachoEchevarria
NachoEchevarria requested review from a team as code owners April 24, 2026 12:15

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

StartupLogger.Debug("Total number of assemblies: {0}", _assemblies.Length);
}

internal static Assembly? OnAssemblyResolve(object sender, ResolveEventArgs args)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is just a cut-and paste from Startup.NetCore, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost. It was, but I noticed that the original code had no try/catch (the .net framework version does) so these were added.

@NachoEchevarria
NachoEchevarria merged commit 55b7898 into master Apr 27, 2026
140 of 141 checks passed
@NachoEchevarria
NachoEchevarria deleted the nacho/NetcoreAssemblyLoadSeparation branch April 27, 2026 07:29
@github-actions github-actions Bot added this to the vNext-v3 milestone Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:reliability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants