Skip to content

[Code Origin] Optimize per-assembly PDB cache#8631

Merged
dudikeleti merged 6 commits into
masterfrom
dudik/co/optimize-pdb-cache
May 14, 2026
Merged

[Code Origin] Optimize per-assembly PDB cache#8631
dudikeleti merged 6 commits into
masterfrom
dudik/co/optimize-pdb-cache

Conversation

@dudikeleti

Copy link
Copy Markdown
Contributor

Summary of changes

  • Optimizes Span Code Origin PDB analysis by replacing the old per-assembly ConcurrentAdaptiveCache / separate skip-cache path with a weakly-keyed ConditionalWeakTable<Assembly, Lazy<AssemblyAnalysis>>.
  • Deduplicates concurrent first-touch analysis for the same assembly while allowing different assemblies to be analyzed in parallel.
  • Combines the assembly skip decision and endpoint sequence-point cache into one per-assembly analysis result.
  • Adds a metadata-only PDB reader mode for code-origin endpoint discovery, avoiding full PE image prefetch when IL bodies are not needed.
  • Ensures metadata/PDB reader resources are disposed correctly, including sidecar portable PDB providers.

Reason for change

  • The previous cache population path used a global write lock, so concurrent cold-cache analysis for different assemblies could block each other.
  • Code-origin PDB lookup only needs metadata and PDB sequence points, not the full PE image, so full-image prefetching added unnecessary cold-path cost.
  • Weak assembly keys avoid keeping collectible assembly load contexts alive through the cache.

Implementation details

  • SpanCodeOrigin now stores a Lazy<AssemblyAnalysis> per Assembly, keyed by ConditionalWeakTable, so:
    • repeated lookups hit an already-computed analysis result;
    • concurrent first touches for the same assembly are deduplicated;
    • first touches for different assemblies are no longer serialized by the old global cache write lock.
  • AssemblyAnalysis stores both the skip decision and the endpoint token-to-sequence-point dictionary.
  • DatadogMetadataReader.CreatePdbReader() now supports metadataOnly: true.
    • For this mode it uses PEStreamOptions.Default instead of PrefetchMetadata | PrefetchEntireImage.
    • This avoids reading the full DLL image while still keeping the stream available for portable PDB discovery.
  • Resource ownership is now explicit during PDB reader creation so PEReader, MetadataReaderProvider, dnlib module, and dnlib symbol reader are disposed if construction exits early.

Test coverage

  • Added unit coverage for CreatePdbReader(metadataOnly: true) to verify it still discovers the same PDB availability as the full-prefetch path.

  • Ran local BenchmarkDotNet comparison on Windows, .NET 10.0.7, BenchmarkDotNet 0.15.8:

Case master this branch Change
Cold first-touch 546.389 us, 31,480 B 421.000 us, 35,744 B ~23% faster, +4.3 KB managed allocation
Warm cache 278.472 ns, 584 B 277.088 ns, 584 B effectively unchanged

Other details

  • The measured cold first-touch improvement is single-threaded. In a multi-threaded environment, the benefit is expected to be higher when multiple assemblies are first analyzed concurrently, because this branch removes the previous global cache write-lock bottleneck.
  • Warm-cache performance is unchanged because both implementations converge to the same steady-state work: cache lookup, method-token dictionary lookup, and tag writes.
  • The cold-path managed allocation is slightly higher due to the new Lazy / analysis wrapper objects, but BenchmarkDotNet managed allocation does not capture the reduced PE image prefetching, I/O, native memory, or handle lifetime improvements.

@dudikeleti
dudikeleti requested review from a team as code owners May 13, 2026 17:29
@dudikeleti
dudikeleti requested a review from andrewlock May 13, 2026 17:29
@dudikeleti dudikeleti added type:performance Performance, speed, latency, resource usage (CPU, memory) area:debugger labels May 13, 2026
@pr-commenter

pr-commenter Bot commented May 13, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-14 12:36:16

Comparing candidate commit 3c1086a in PR branch dudik/co/optimize-pdb-cache with baseline commit 9f45287 in branch master.

Some scenarios are present only in baseline or only in candidate runs. If you didn't create or remove some scenarios in your branch, this maybe a sign of crashed benchmarks 💥💥💥
Check Gitlab CI job log to find if any benchmark has crashed.

Scenarios present only in baseline:

  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • Benchmarks.OpenTelemetry.Api.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472

Found 3 performance improvements and 7 performance regressions! Performance is the same for 44 metrics, 18 unstable metrics, 88 known flaky benchmarks, 38 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 ----------------------------------'

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartActiveSpan net6.0

  • 🟩 allocated_mem [-144 bytes; -143 bytes] or [-9.188%; -9.180%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartRootSpan net6.0

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+10.108%; +10.117%]
  • 🟥 throughput [-27343.127op/s; -13569.459op/s] or [-14.984%; -7.436%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_GetCurrentSpan net6.0

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+10.108%; +10.117%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartSpan_SetActive net6.0

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+7.889%; +7.898%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-5240.854op/s; -4577.856op/s] or [-5.983%; -5.226%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net6.0

  • 🟥 throughput [-74811.882op/s; -68455.642op/s] or [-50.821%; -46.503%]
  • 🟩 execution_time [-29.218ms; -15.429ms] or [-14.499%; -7.657%]

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

  • 🟥 throughput [-34323.409op/s; -29305.050op/s] or [-17.210%; -14.694%]
  • 🟩 execution_time [-84.096ms; -79.784ms] or [-42.530%; -40.349%]

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.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0

  • unstable execution_time [-14.417ms; +10.136ms] or [-10.271%; +7.221%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1

  • unstable execution_time [-21378.790µs; +21217.982µs] or [-16.046%; +15.926%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0

  • unstable execution_time [-5.509ms; +28.199ms] or [-3.836%; +19.635%]
  • unstable throughput [-17327.970op/s; +4980.491op/s] or [-11.535%; +3.315%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1

  • unstable execution_time [+10.051ms; +35.139ms] or [+11.726%; +40.998%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0

  • unstable execution_time [-26.215ms; -9.588ms] or [-18.871%; -6.902%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1

  • unstable execution_time [-0.830ms; +39.813ms] or [-0.743%; +35.619%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0

  • unstable execution_time [-14.988ms; +4.679ms] or [-9.799%; +3.059%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0

  • unstable execution_time [-28.302ms; -0.176ms] or [-18.770%; -0.116%]
  • unstable throughput [+22184.504op/s; +43896.663op/s] or [+13.549%; +26.810%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1

  • unstable execution_time [-20936.391µs; +21507.171µs] or [-15.639%; +16.066%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0

  • unstable execution_time [-15.716ms; +8.740ms] or [-11.305%; +6.287%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0

  • unstable execution_time [+9.902ms; +46.095ms] or [+7.068%; +32.901%]
  • unstable throughput [-31314.188op/s; -3725.718op/s] or [-18.980%; -2.258%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1

  • unstable execution_time [-33.455ms; -9.132ms] or [-29.690%; -8.104%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0

  • unstable execution_time [-27.742ms; +10.927ms] or [-16.747%; +6.596%]
  • unstable throughput [-1421.046op/s; +22328.322op/s] or [-1.098%; +17.248%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1

  • unstable execution_time [-22334.910µs; +20916.994µs] or [-16.619%; +15.564%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0

  • unstable execution_time [-49.324ms; -10.050ms] or [-27.207%; -5.544%]
  • unstable throughput [+31322.225op/s; +51717.961op/s] or [+22.265%; +36.764%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1

  • unstable execution_time [-18270.551µs; +17996.675µs] or [-16.619%; +16.370%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0

  • unstable execution_time [-19.198ms; +25.536ms] or [-12.948%; +17.223%]
  • unstable throughput [-16547.882op/s; +11297.947op/s] or [-15.380%; +10.501%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1

  • unstable execution_time [-58.572ms; -27.636ms] or [-44.402%; -20.950%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0

  • unstable execution_time [+27.036ms; +42.831ms] or [+19.156%; +30.347%]
  • 🟥 throughput [-20682.564op/s; -10737.155op/s] or [-16.094%; -8.355%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1

  • unstable execution_time [+9.845ms; +34.318ms] or [+10.974%; +38.254%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0

  • 🟥 allocated_mem [+143 bytes; +144 bytes] or [+9.570%; +9.578%]
  • unstable execution_time [+16.402ms; +38.144ms] or [+13.164%; +30.614%]
  • unstable throughput [-45739.712op/s; -17450.610op/s] or [-25.068%; -9.564%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1

  • unstable execution_time [+53.524ms; +83.545ms] or [+60.564%; +94.535%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0

  • unstable execution_time [-32.092ms; -5.074ms] or [-20.303%; -3.210%]
  • unstable throughput [-3686.036op/s; +17267.096op/s] or [-2.306%; +10.803%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1

  • unstable execution_time [-34.884ms; -9.710ms] or [-31.278%; -8.707%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-7620.674op/s; -6756.691op/s] or [-9.036%; -8.011%]

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

  • unstable execution_time [-82.196ms; -59.989ms] or [-41.008%; -29.929%]
  • unstable throughput [-35034.263op/s; -22540.081op/s] or [-29.448%; -18.946%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • unstable execution_time [-90.844ms; -67.700ms] or [-45.692%; -34.051%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+316.554ms; +331.838ms] or [+157.085%; +164.670%]
  • 🟥 throughput [-55.975op/s; -43.369op/s] or [-10.071%; -7.803%]

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

  • 🟥 execution_time [+99.405ms; +101.739ms] or [+78.536%; +80.380%]
  • 🟩 throughput [+82.855op/s; +91.336op/s] or [+10.924%; +12.042%]

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

  • 🟥 execution_time [+85.047ms; +86.530ms] or [+75.263%; +76.576%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.528%; +27.540%]

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

  • 🟥 allocated_mem [+439 bytes; +440 bytes] or [+9.299%; +9.310%]
  • 🟩 execution_time [-67.484ms; -48.025ms] or [-31.518%; -22.429%]
  • 🟥 throughput [-21074.350op/s; -7459.872op/s] or [-15.383%; -5.445%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.500%; +27.510%]
  • unstable execution_time [-63.467ms; -42.285ms] or [-30.223%; -20.136%]

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-268406.004op/s; -260273.047op/s] or [-27.406%; -26.575%]

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

  • 🟥 allocated_mem [+439 bytes; +440 bytes] or [+35.945%; +35.954%]
  • unstable execution_time [-86.633ms; -52.654ms] or [-38.635%; -23.482%]
  • unstable throughput [-196151.429op/s; -76457.172op/s] or [-20.955%; -8.168%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • unstable execution_time [-76.881ms; -56.480ms] or [-38.376%; -28.192%]
  • 🟥 throughput [-140002.998op/s; -123236.289op/s] or [-20.116%; -17.707%]

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

  • 🟩 execution_time [-54.207ms; -40.086ms] or [-27.350%; -20.226%]

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

  • 🟩 execution_time [-49.100ms; -29.507ms] or [-25.033%; -15.044%]
  • 🟩 throughput [+10447.372op/s; +13096.100op/s] or [+8.323%; +10.433%]

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

  • unstable execution_time [-55.461ms; -28.955ms] or [-27.422%; -14.316%]
  • unstable throughput [-390365.290op/s; +10999.960op/s] or [-13.016%; +0.367%]

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

  • 🟩 execution_time [-99.469ms; -78.310ms] or [-45.852%; -36.098%]
  • 🟩 throughput [+174538.547op/s; +229847.813op/s] or [+6.928%; +9.123%]

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

  • 🟥 execution_time [+301.806ms; +315.632ms] or [+150.802%; +157.711%]

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

  • unstable execution_time [+175.956ms; +224.239ms] or [+88.735%; +113.084%]

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

  • 🟥 execution_time [+300.517ms; +307.731ms] or [+151.377%; +155.011%]

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

  • 🟥 execution_time [+298.535ms; +312.250ms] or [+146.629%; +153.365%]

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

  • 🟥 execution_time [+229.444ms; +234.558ms] or [+112.167%; +114.667%]

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

  • 🟥 execution_time [+301.934ms; +307.934ms] or [+150.906%; +153.905%]

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

  • 🟥 allocated_mem [+24.632KB; +24.633KB] or [+1099.639%; +1099.708%]
  • 🟥 execution_time [+20.414µs; +44.044µs] or [+6.517%; +14.061%]
  • 🟥 throughput [-412.263op/s; -213.402op/s] or [-12.851%; -6.652%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+300.037ms; +300.983ms] or [+149.749%; +150.221%]

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

  • unstable execution_time [+361.345ms; +381.419ms] or [+392.616%; +414.427%]
  • 🟥 throughput [-6974.089op/s; -6744.015op/s] or [-57.307%; -55.417%]

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

  • unstable execution_time [+271.061ms; +342.259ms] or [+205.814%; +259.874%]
  • 🟥 throughput [-1262.682op/s; -1033.806op/s] or [-12.224%; -10.008%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+304.727ms; +321.473ms] or [+140.110%; +147.810%]
  • 🟥 throughput [-682.848op/s; -666.208op/s] or [-61.873%; -60.365%]

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

  • unstable execution_time [-63.951ms; +69.324ms] or [-27.253%; +29.543%]
  • 🟥 throughput [-664.303op/s; -579.558op/s] or [-44.309%; -38.657%]

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

  • 🟥 allocated_mem [+2.305KB; +2.308KB] or [+5.442%; +5.450%]
  • 🟥 execution_time [+340.044ms; +348.280ms] or [+203.386%; +208.312%]
  • 🟥 throughput [-727.021op/s; -692.938op/s] or [-50.621%; -48.248%]

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

  • 🟩 execution_time [-137.669µs; -115.857µs] or [-6.974%; -5.869%]
  • 🟩 throughput [+31.826op/s; +38.165op/s] or [+6.283%; +7.534%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.786ms; +316.593ms] or [+152.981%; +159.430%]

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

  • 🟥 execution_time [+249.777ms; +267.283ms] or [+125.164%; +133.936%]

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

  • 🟥 execution_time [+298.899ms; +306.240ms] or [+150.154%; +153.842%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+308.112ms; +321.919ms] or [+154.723%; +161.657%]

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

  • 🟥 execution_time [+201.150ms; +211.728ms] or [+99.460%; +104.690%]

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

  • 🟥 execution_time [+304.024ms; +311.315ms] or [+154.093%; +157.788%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+305.953ms; +320.610ms] or [+153.561%; +160.917%]

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

  • unstable execution_time [+213.643ms; +281.827ms] or [+106.482%; +140.465%]
  • 🟩 throughput [+34170.601op/s; +45812.932op/s] or [+6.785%; +9.097%]

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

  • 🟥 execution_time [+298.480ms; +304.383ms] or [+148.491%; +151.428%]

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

  • unstable execution_time [-104.060ms; -80.119ms] or [-48.388%; -37.256%]
  • unstable throughput [-67367.542op/s; -23885.341op/s] or [-18.481%; -6.552%]

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

  • unstable execution_time [-73.918ms; -45.002ms] or [-37.078%; -22.574%]

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

  • 🟩 allocated_mem [-25.414KB; -25.391KB] or [-9.270%; -9.262%]
  • unstable execution_time [-60.796µs; -5.318µs] or [-12.016%; -1.051%]

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

  • 🟩 throughput [+97.797op/s; +248.955op/s] or [+5.587%; +14.223%]

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

  • unstable execution_time [+4.499µs; +9.819µs] or [+10.635%; +23.210%]
  • 🟥 throughput [-4236.180op/s; -2189.011op/s] or [-17.833%; -9.215%]

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

  • unstable execution_time [-12.652µs; -3.338µs] or [-19.629%; -5.179%]
  • unstable throughput [+988.145op/s; +2928.363op/s] or [+6.063%; +17.966%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.052ms; +312.925ms] or [+152.168%; +158.169%]

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

  • 🟥 execution_time [+302.692ms; +307.313ms] or [+154.070%; +156.421%]

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

  • 🟥 execution_time [+297.534ms; +303.848ms] or [+148.953%; +152.113%]

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

  • unstable execution_time [-50.867ms; -11.202ms] or [-25.426%; -5.599%]
  • unstable throughput [-230760.138op/s; -144318.115op/s] or [-43.678%; -27.316%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1

  • unstable execution_time [-56.135ms; -25.031ms] or [-28.455%; -12.688%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.066ms; +313.399ms] or [+149.556%; +156.201%]

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

  • unstable execution_time [+261.950ms; +295.275ms] or [+131.539%; +148.273%]

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

  • 🟥 execution_time [+304.066ms; +310.390ms] or [+154.203%; +157.410%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.729ms; +300.410ms] or [+149.506%; +149.846%]
  • 🟩 throughput [+59924470.498op/s; +60196919.022op/s] or [+43.641%; +43.839%]

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

  • unstable execution_time [+374.378ms; +394.077ms] or [+465.605%; +490.105%]
  • 🟥 throughput [-7498.933op/s; -7232.506op/s] or [-57.970%; -55.911%]

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

  • 🟥 execution_time [+301.956ms; +303.913ms] or [+150.609%; +151.585%]
  • 🟥 throughput [-30615993.803op/s; -29454716.709op/s] or [-13.561%; -13.047%]

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

  • unstable execution_time [-73.138ms; -37.272ms] or [-35.822%; -18.255%]
  • unstable throughput [-246941.571op/s; -78736.626op/s] or [-23.056%; -7.351%]

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

  • unstable execution_time [-74.170ms; -47.614ms] or [-37.530%; -24.093%]

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

  • unstable execution_time [-64.836ms; -37.644ms] or [-33.780%; -19.612%]
  • unstable throughput [-274716.003op/s; -81683.994op/s] or [-21.264%; -6.322%]

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

  • unstable execution_time [-78.306ms; -50.829ms] or [-38.473%; -24.973%]
  • 🟩 throughput [+77720.779op/s; +94007.554op/s] or [+7.719%; +9.336%]

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

  • unstable execution_time [-72.715ms; -48.534ms] or [-36.314%; -24.237%]
  • unstable throughput [-104636.148op/s; -31163.396op/s] or [-19.000%; -5.659%]

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

  • unstable execution_time [-52.503ms; -26.279ms] or [-26.379%; -13.204%]

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

  • unstable execution_time [-82.680ms; -53.305ms] or [-41.354%; -26.662%]
  • unstable throughput [-218889.461op/s; -84266.758op/s] or [-24.455%; -9.415%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

  • unstable execution_time [-73.794ms; -45.289ms] or [-37.479%; -23.001%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • 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 net6.0
  • 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.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472

@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented May 13, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8631) 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
duration73.58 ± (73.62 - 74.14) ms74.18 ± (74.09 - 74.66) ms+0.8%✅⬆️
.NET Framework 4.8 - Bailout
duration76.79 ± (76.66 - 77.04) ms77.80 ± (77.84 - 78.29) ms+1.3%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1100.29 ± (1099.28 - 1107.42) ms1107.84 ± (1110.15 - 1118.84) ms+0.7%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.46 ± (22.41 - 22.51) ms22.60 ± (22.54 - 22.66) ms+0.6%✅⬆️
process.time_to_main_ms84.74 ± (84.49 - 84.98) ms85.45 ± (85.16 - 85.73) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.92) MB10.93 ± (10.92 - 10.93) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.24 ± (22.20 - 22.28) ms22.35 ± (22.31 - 22.39) ms+0.5%✅⬆️
process.time_to_main_ms84.88 ± (84.67 - 85.09) ms86.15 ± (85.93 - 86.36) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.97 ± (10.96 - 10.97) MB+0.7%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms214.06 ± (213.08 - 215.03) ms213.86 ± (213.07 - 214.65) ms-0.1%
process.time_to_main_ms541.13 ± (539.78 - 542.48) ms539.88 ± (538.57 - 541.19) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.45 ± (48.42 - 48.48) MB48.34 ± (48.30 - 48.37) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.31 ± (21.25 - 21.36) ms21.84 ± (21.78 - 21.90) ms+2.5%✅⬆️
process.time_to_main_ms74.49 ± (74.25 - 74.72) ms76.49 ± (76.19 - 76.79) ms+2.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.63 - 10.63) MB10.65 ± (10.64 - 10.65) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.12 ± (21.09 - 21.15) ms21.36 ± (21.32 - 21.41) ms+1.2%✅⬆️
process.time_to_main_ms74.59 ± (74.45 - 74.73) ms75.77 ± (75.58 - 75.96) ms+1.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.74 ± (10.74 - 10.74) MB10.76 ± (10.76 - 10.77) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms377.12 ± (374.87 - 379.37) ms378.00 ± (375.95 - 380.05) ms+0.2%✅⬆️
process.time_to_main_ms539.17 ± (537.94 - 540.40) ms541.98 ± (540.60 - 543.35) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.76 ± (49.73 - 49.78) MB49.88 ± (49.85 - 49.90) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.56 ± (19.52 - 19.61) ms19.57 ± (19.52 - 19.61) ms+0.0%✅⬆️
process.time_to_main_ms73.67 ± (73.43 - 73.92) ms73.01 ± (72.74 - 73.28) ms-0.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.67 - 7.68) MB7.67 ± (7.67 - 7.67) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.60 ± (19.55 - 19.65) ms19.76 ± (19.72 - 19.81) ms+0.8%✅⬆️
process.time_to_main_ms75.53 ± (75.31 - 75.76) ms75.63 ± (75.34 - 75.92) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.72 - 7.73) MB7.73 ± (7.73 - 7.74) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms298.35 ± (296.17 - 300.53) ms298.70 ± (296.41 - 300.98) ms+0.1%✅⬆️
process.time_to_main_ms492.35 ± (491.39 - 493.30) ms493.79 ± (492.78 - 494.79) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.90 ± (36.88 - 36.93) MB36.90 ± (36.88 - 36.93) MB+0.0%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.3%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration198.91 ± (198.64 - 199.62) ms200.38 ± (199.58 - 200.49) ms+0.7%✅⬆️
.NET Framework 4.8 - Bailout
duration202.10 ± (202.12 - 202.84) ms203.45 ± (203.07 - 204.05) ms+0.7%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1194.39 ± (1193.89 - 1199.95) ms1196.89 ± (1200.65 - 1208.73) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms194.41 ± (193.97 - 194.85) ms196.29 ± (195.76 - 196.83) ms+1.0%✅⬆️
process.time_to_main_ms83.70 ± (83.40 - 84.00) ms84.52 ± (84.22 - 84.82) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.07 ± (16.05 - 16.09) MB16.06 ± (16.03 - 16.08) MB-0.1%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)+0.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms193.95 ± (193.53 - 194.37) ms195.60 ± (195.16 - 196.04) ms+0.8%✅⬆️
process.time_to_main_ms84.87 ± (84.66 - 85.08) ms85.33 ± (85.07 - 85.59) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.13 - 16.18) MB16.09 ± (16.07 - 16.11) MB-0.4%
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)-0.1%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms387.35 ± (386.09 - 388.61) ms390.18 ± (388.75 - 391.60) ms+0.7%✅⬆️
process.time_to_main_ms533.12 ± (531.91 - 534.33) ms533.66 ± (532.55 - 534.77) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.62 ± (57.41 - 57.83) MB57.76 ± (57.54 - 57.99) MB+0.2%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.2%
.NET 6 - Baseline
process.internal_duration_ms196.17 ± (195.75 - 196.60) ms198.95 ± (198.51 - 199.40) ms+1.4%✅⬆️
process.time_to_main_ms71.67 ± (71.43 - 71.90) ms72.93 ± (72.60 - 73.26) ms+1.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.38 ± (16.35 - 16.41) MB16.32 ± (16.30 - 16.34) MB-0.4%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.8%
.NET 6 - Bailout
process.internal_duration_ms196.64 ± (196.12 - 197.16) ms197.69 ± (197.20 - 198.18) ms+0.5%✅⬆️
process.time_to_main_ms73.19 ± (72.94 - 73.43) ms73.30 ± (73.08 - 73.53) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.44 ± (16.42 - 16.47) MB16.41 ± (16.38 - 16.44) MB-0.2%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.8%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms596.52 ± (593.98 - 599.06) ms591.99 ± (589.20 - 594.77) ms-0.8%
process.time_to_main_ms534.37 ± (533.37 - 535.36) ms535.16 ± (534.21 - 536.11) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.33 ± (61.21 - 61.44) MB61.22 ± (61.12 - 61.32) MB-0.2%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms196.83 ± (196.41 - 197.25) ms197.48 ± (196.90 - 198.05) ms+0.3%✅⬆️
process.time_to_main_ms72.00 ± (71.75 - 72.26) ms72.26 ± (71.95 - 72.57) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.72 ± (11.70 - 11.75) MB11.71 ± (11.69 - 11.74) MB-0.1%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.3%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms195.94 ± (195.58 - 196.29) ms196.82 ± (196.44 - 197.19) ms+0.4%✅⬆️
process.time_to_main_ms73.21 ± (73.04 - 73.37) ms73.22 ± (72.97 - 73.47) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.77 ± (11.75 - 11.78) MB11.74 ± (11.73 - 11.76) MB-0.2%
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (19 - 20)+1.1%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms513.60 ± (510.93 - 516.27) ms517.17 ± (514.61 - 519.73) ms+0.7%✅⬆️
process.time_to_main_ms489.99 ± (489.34 - 490.63) ms493.25 ± (492.46 - 494.04) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.59 ± (50.55 - 50.62) MB50.61 ± (50.57 - 50.65) MB+0.0%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.1%
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 (8631) - mean (74ms)  : 70, 79
    master - mean (74ms)  : 70, 78

    section Bailout
    This PR (8631) - mean (78ms)  : 75, 81
    master - mean (77ms)  : 75, 79

    section CallTarget+Inlining+NGEN
    This PR (8631) - mean (1,114ms)  : 1051, 1178
    master - mean (1,103ms)  : 1043, 1164

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 (8631) - mean (115ms)  : 109, 121
    master - mean (114ms)  : 109, 120

    section Bailout
    This PR (8631) - mean (115ms)  : 112, 119
    master - mean (114ms)  : 110, 117

    section CallTarget+Inlining+NGEN
    This PR (8631) - mean (791ms)  : 761, 821
    master - mean (793ms)  : 762, 823

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8631) - mean (105ms)  : 99, 111
    master - mean (102ms)  : 97, 108

    section Bailout
    This PR (8631) - mean (104ms)  : 100, 107
    master - mean (102ms)  : 100, 104

    section CallTarget+Inlining+NGEN
    This PR (8631) - mean (956ms)  : 918, 994
    master - mean (947ms)  : 902, 991

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8631) - mean (101ms)  : 95, 107
    master - mean (101ms)  : 96, 107

    section Bailout
    This PR (8631) - mean (104ms)  : 97, 110
    master - mean (103ms)  : 98, 108

    section CallTarget+Inlining+NGEN
    This PR (8631) - mean (822ms)  : 782, 863
    master - mean (821ms)  : 778, 864

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 (8631) - mean (200ms)  : 194, 206
    master - mean (199ms)  : 193, 205

    section Bailout
    This PR (8631) - mean (204ms)  : 198, 209
    master - mean (202ms)  : 199, 206

    section CallTarget+Inlining+NGEN
    This PR (8631) - mean (1,205ms)  : 1143, 1266
    master - mean (1,197ms)  : 1153, 1240

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 (8631) - mean (289ms)  : 282, 297
    master - mean (287ms)  : 278, 296

    section Bailout
    This PR (8631) - mean (290ms)  : 281, 298
    master - mean (287ms)  : 281, 294

    section CallTarget+Inlining+NGEN
    This PR (8631) - mean (965ms)  : 942, 989
    master - mean (961ms)  : 945, 978

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8631) - mean (281ms)  : 274, 287
    master - mean (276ms)  : 268, 285

    section Bailout
    This PR (8631) - mean (280ms)  : 274, 286
    master - mean (278ms)  : 272, 284

    section CallTarget+Inlining+NGEN
    This PR (8631) - mean (1,156ms)  : 1102, 1210
    master - mean (1,157ms)  : 1125, 1190

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8631) - mean (280ms)  : 274, 286
    master - mean (279ms)  : 274, 285

    section Bailout
    This PR (8631) - mean (280ms)  : 275, 285
    master - mean (279ms)  : 275, 284

    section CallTarget+Inlining+NGEN
    This PR (8631) - mean (1,041ms)  : 996, 1086
    master - mean (1,037ms)  : 995, 1078

Loading

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes code-origin PDB analysis by switching SpanCodeOrigin’s per-assembly caching to a weak-keyed ConditionalWeakTable<Assembly, Lazy<...>>, reducing cross-assembly contention and enabling a metadata-only PDB reader path that avoids full PE prefetch when IL bodies aren’t needed.

Changes:

  • Replaced the old per-assembly caches in SpanCodeOrigin with a weakly-keyed, per-assembly Lazy<AssemblyAnalysis> to deduplicate same-assembly first-touch work while allowing parallel analysis across assemblies.
  • Added metadataOnly support to DatadogMetadataReader.CreatePdbReader(...), including more explicit resource-ownership/disposal to prevent file-handle leaks (notably for sidecar portable PDB providers).
  • Added a regression test to ensure metadataOnly: true still discovers associated PDBs equivalently to the full-prefetch path.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tracer/test/Datadog.Trace.Tests/Pdb/DatadogMetadataReaderTests.cs Adds a regression test asserting PDB discovery equivalence for metadataOnly: true vs full-prefetch.
tracer/src/Datadog.Trace/PDBs/DatadogMetadataReader.cs Adds metadataOnly mode and improves explicit disposal/ownership for PE/PDB resources.
tracer/src/Datadog.Trace/Debugger/SpanCodeOrigin/SpanCodeOrigin.cs Reworks per-assembly analysis caching using ConditionalWeakTable<Assembly, Lazy<AssemblyAnalysis>> and uses metadataOnly: true PDB reads for endpoint sequence points.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tracer/src/Datadog.Trace/Debugger/SpanCodeOrigin/SpanCodeOrigin.cs Outdated
Comment thread tracer/src/Datadog.Trace/PDBs/DatadogMetadataReader.cs Outdated
@dudikeleti
dudikeleti force-pushed the dudik/co/optimize-pdb-cache branch from 5bd7948 to 2cd4aab Compare May 14, 2026 09:14

@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.

Nice update, thanks!

Comment thread tracer/src/Datadog.Trace/Debugger/SpanCodeOrigin/SpanCodeOrigin.cs Outdated
Comment thread tracer/src/Datadog.Trace/PDBs/DatadogMetadataReader.cs
Comment thread tracer/src/Datadog.Trace/Debugger/SpanCodeOrigin/SpanCodeOrigin.cs Outdated
@dudikeleti
dudikeleti force-pushed the dudik/co/optimize-pdb-cache branch from 2cd4aab to 3c1086a Compare May 14, 2026 11:38
@dudikeleti
dudikeleti enabled auto-merge (squash) May 14, 2026 11:52
@dudikeleti
dudikeleti merged commit 9c344fa into master May 14, 2026
140 checks passed
@dudikeleti
dudikeleti deleted the dudik/co/optimize-pdb-cache branch May 14, 2026 13:05
@github-actions github-actions Bot added this to the vNext-v3 milestone May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:code-origin area:debugger type:performance Performance, speed, latency, resource usage (CPU, memory)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants