Skip to content

[Debugger] Fix safe ToString handling for debugger collections#8747

Merged
dudikeleti merged 1 commit into
masterfrom
dudik/fix-safe-to-call-tostring
Jun 4, 2026
Merged

[Debugger] Fix safe ToString handling for debugger collections#8747
dudikeleti merged 1 commit into
masterfrom
dudik/fix-safe-to-call-tostring

Conversation

@dudikeleti

Copy link
Copy Markdown
Contributor

Summary of changes

  • Updates debugger redaction safety checks so collection support no longer implies ToString() is safe to call.
  • Keeps Redaction.IsSafeToCallToString() limited to simple types and explicitly allowlisted scalar-like types.
  • Adds focused tests documenting that collections and dictionaries should not rely on ToString() for safe string fallback behavior.

Reason for change

  • IsSafeToCallToString() was reusing IsSupportedCollection(), which mixed two separate concepts: whether a type can be structurally handled as a debugger collection, and whether calling ToString() is safe/useful.
  • This caused supported collection types, including problematic collection-like types, to be treated as safe for string fallback paths.
  • Separating this now keeps the first fix small and leaves broader collection/dictionary serializer support for a follow-up PR.

Implementation details

  • Removed the IsSupportedCollection(type) check from Redaction.IsSafeToCallToString().
  • This reduces work in the helper by avoiding the collection allowlist scan.
  • Added deterministic unit coverage for List<T>, HashSet<T>, Dictionary<TKey,TValue>, Hashtable, and ConditionalWeakTable<TKey,TValue>.
  • No serializer collection support is changed in this PR.

Test coverage

  • SupportedTypesServiceTests
  • DebuggerExpressionLanguageTests
  • DebuggerSnapshotCreatorTests

@datadog-official

Copy link
Copy Markdown
Contributor

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

DataDog/apm-reliability/dd-trace-dotnet | validate_supported_configurations_v2_local_file   View in Datadog   GitLab

See error HTTP error 503 when trying to access the requested URL.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: defda0b | Docs | Datadog PR Page | Give us feedback!

@dudikeleti
dudikeleti removed the request for review from jpbempel June 4, 2026 10:33

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 narrows debugger “safe string fallback” behavior by ensuring that collection/dictionary support does not imply it’s safe/appropriate to call ToString() when capturing debugger snapshots. This keeps Redaction.IsSafeToCallToString() focused on simple/scalar-like types and avoids accidentally treating supported collections as safe for ToString()-based serialization.

Changes:

  • Removed the IsSupportedCollection(type) condition from Redaction.IsSafeToCallToString() so collection support no longer marks a type as safe for ToString().
  • Added unit tests asserting common collections/dictionaries are not safe for ToString() fallback behavior.

Reviewed changes

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

File Description
tracer/src/Datadog.Trace/Debugger/Snapshots/Redaction.cs Tightens IsSafeToCallToString() to simple/allowlisted scalar-like types only.
tracer/test/Datadog.Trace.Tests/Debugger/SupportedTypesServiceTests.cs Adds coverage ensuring common collections/dictionaries are not considered safe for ToString().

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

@dudikeleti
dudikeleti enabled auto-merge (squash) June 4, 2026 10:33
@pr-commenter

pr-commenter Bot commented Jun 4, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-04 11:18:42

Comparing candidate commit defda0b in PR branch dudik/fix-safe-to-call-tostring with baseline commit 4af8ab6 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 57 known flaky benchmarks, 69 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.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-5831.913op/s; -5267.963op/s] or [-6.658%; -6.014%]

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 net472

  • 🟥 throughput [-7788.077op/s; -6857.606op/s] or [-9.234%; -8.131%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+304.694ms; +311.075ms] or [+151.200%; +154.367%]
  • 🟥 throughput [-49.489op/s; -44.430op/s] or [-8.904%; -7.994%]

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

  • 🟥 execution_time [+381.110ms; +383.323ms] or [+301.100%; +302.849%]
  • 🟩 throughput [+88.803op/s; +92.532op/s] or [+11.708%; +12.200%]

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

  • 🟥 execution_time [+394.016ms; +397.685ms] or [+348.689%; +351.936%]

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 [+471 bytes; +472 bytes] or [+9.976%; +9.987%]
  • 🟩 execution_time [-16.045ms; -11.831ms] or [-7.494%; -5.525%]

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

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

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-273434.031op/s; -270222.427op/s] or [-27.919%; -27.591%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-25.139ms; -20.247ms] or [-11.211%; -9.029%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-164199.823op/s; -146576.554op/s] or [-23.592%; -21.060%]

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

  • 🟩 throughput [+8906.159op/s; +11958.523op/s] or [+5.667%; +7.609%]

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

  • 🟩 throughput [+8439.459op/s; +11107.407op/s] or [+6.723%; +8.848%]

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

  • 🟩 throughput [+393845.253op/s; +421213.104op/s] or [+13.132%; +14.045%]

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

  • 🟩 execution_time [-18.760ms; -14.424ms] or [-8.648%; -6.649%]
  • 🟩 throughput [+164563.229op/s; +222543.190op/s] or [+6.532%; +8.833%]

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

  • 🟥 execution_time [+299.202ms; +299.845ms] or [+149.501%; +149.822%]

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

  • 🟥 execution_time [+300.384ms; +303.896ms] or [+151.485%; +153.255%]

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

  • 🟥 execution_time [+299.641ms; +302.715ms] or [+150.936%; +152.484%]

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

  • 🟥 execution_time [+296.180ms; +297.294ms] or [+145.472%; +146.019%]

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

  • 🟥 execution_time [+295.825ms; +299.342ms] or [+144.618%; +146.337%]

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

  • 🟥 execution_time [+299.725ms; +300.608ms] or [+149.802%; +150.244%]

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

  • 🟥 execution_time [+21.238µs; +44.867µs] or [+6.780%; +14.324%]
  • 🟥 throughput [-419.152op/s; -220.297op/s] or [-13.066%; -6.867%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.615ms; +300.475ms] or [+149.539%; +149.968%]

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

  • unstable execution_time [+338.119ms; +395.407ms] or [+367.381%; +429.626%]
  • 🟩 throughput [+749.681op/s; +945.074op/s] or [+6.160%; +7.766%]

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

  • unstable execution_time [+298.507ms; +350.980ms] or [+226.653%; +266.496%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+321.019ms; +353.857ms] or [+147.601%; +162.700%]
  • 🟥 throughput [-503.958op/s; -468.794op/s] or [-45.664%; -42.477%]

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

  • unstable execution_time [+210.653ms; +343.895ms] or [+89.771%; +146.554%]
  • 🟥 throughput [-672.112op/s; -588.617op/s] or [-44.830%; -39.261%]

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

  • 🟥 execution_time [+346.722ms; +357.150ms] or [+207.380%; +213.617%]
  • 🟥 throughput [-418.305op/s; -381.513op/s] or [-29.126%; -26.564%]

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

  • 🟩 throughput [+26.078op/s; +40.008op/s] or [+5.148%; +7.898%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+302.717ms; +304.024ms] or [+152.443%; +153.101%]

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

  • 🟥 execution_time [+299.558ms; +301.786ms] or [+150.109%; +151.225%]

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

  • 🟥 execution_time [+299.486ms; +302.640ms] or [+150.449%; +152.034%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.155ms; +304.504ms] or [+151.732%; +152.912%]

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

  • 🟥 execution_time [+300.564ms; +304.569ms] or [+148.616%; +150.596%]

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

  • 🟥 execution_time [+302.153ms; +305.990ms] or [+153.145%; +155.089%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+301.979ms; +304.014ms] or [+151.566%; +152.588%]

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

  • 🟥 execution_time [+301.100ms; +303.289ms] or [+150.071%; +151.162%]
  • 🟩 throughput [+48455.564op/s; +56352.133op/s] or [+9.622%; +11.190%]

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

  • 🟥 execution_time [+301.601ms; +304.356ms] or [+150.044%; +151.415%]

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

  • 🟩 execution_time [-16.361ms; -12.663ms] or [-7.608%; -5.889%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+15.009µs; +58.509µs] or [+3.707%; +14.452%]

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

  • 🟩 allocated_mem [-19.930KB; -19.906KB] or [-7.270%; -7.261%]
  • unstable execution_time [-42.022µs; +13.521µs] or [-8.306%; +2.672%]

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

  • 🟩 allocated_mem [-16.341KB; -16.322KB] or [-5.957%; -5.950%]
  • unstable execution_time [-39.255µs; +22.794µs] or [-6.803%; +3.950%]

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

  • unstable execution_time [+9.970µs; +16.341µs] or [+23.565%; +38.625%]
  • 🟥 throughput [-6373.791op/s; -4220.403op/s] or [-26.832%; -17.767%]

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

  • unstable execution_time [-13.106µs; -5.468µs] or [-20.334%; -8.483%]
  • unstable throughput [+1245.608op/s; +2907.475op/s] or [+7.642%; +17.838%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.051ms; +302.125ms] or [+151.157%; +152.711%]

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

  • 🟥 execution_time [+302.979ms; +305.669ms] or [+154.215%; +155.585%]

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

  • 🟥 execution_time [+300.759ms; +302.905ms] or [+150.567%; +151.641%]

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

  • 🟩 throughput [+32399.693op/s; +39493.678op/s] or [+6.133%; +7.475%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.210ms; +303.551ms] or [+150.126%; +151.293%]

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

  • 🟥 execution_time [+302.725ms; +303.996ms] or [+152.014%; +152.652%]

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

  • 🟥 execution_time [+303.649ms; +306.296ms] or [+153.991%; +155.334%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.916ms; +301.369ms] or [+149.600%; +150.324%]
  • 🟩 throughput [+65594463.441op/s; +65962404.776op/s] or [+47.770%; +48.038%]

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

  • unstable execution_time [+341.870ms; +401.443ms] or [+425.176%; +499.266%]

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

  • 🟥 execution_time [+300.915ms; +302.103ms] or [+150.090%; +150.682%]
  • 🟩 throughput [+17798218.469op/s; +18775787.260op/s] or [+7.883%; +8.316%]

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

  • 🟩 throughput [+61067.032op/s; +82163.109op/s] or [+5.702%; +7.671%]

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

  • 🟩 throughput [+87608.060op/s; +96579.836op/s] or [+8.701%; +9.592%]

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

  • 🟩 throughput [+42580.778op/s; +50623.073op/s] or [+7.732%; +9.192%]

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

  • 🟩 throughput [+96019.916op/s; +113264.015op/s] or [+10.728%; +12.654%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • 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_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • 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 net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • 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 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.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • 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.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8747) 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.75 ± (72.74 - 73.07) ms74.68 ± (74.85 - 75.40) ms+2.6%✅⬆️
.NET Framework 4.8 - Bailout
duration77.26 ± (77.24 - 77.71) ms77.35 ± (77.15 - 77.57) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1104.79 ± (1100.89 - 1108.18) ms1106.59 ± (1105.50 - 1111.87) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.60 ± (22.54 - 22.66) ms22.75 ± (22.69 - 22.81) ms+0.7%✅⬆️
process.time_to_main_ms84.19 ± (83.98 - 84.40) ms85.81 ± (85.53 - 86.10) ms+1.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.91) MB10.93 ± (10.93 - 10.94) MB+0.2%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.78 ± (22.72 - 22.84) ms22.25 ± (22.21 - 22.28) ms-2.4%
process.time_to_main_ms88.48 ± (88.15 - 88.80) ms86.03 ± (85.81 - 86.24) ms-2.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.94 - 10.95) MB10.96 ± (10.95 - 10.96) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms213.42 ± (212.27 - 214.58) ms214.81 ± (214.00 - 215.61) ms+0.6%✅⬆️
process.time_to_main_ms543.38 ± (542.04 - 544.72) ms544.57 ± (543.18 - 545.97) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.31 ± (48.27 - 48.36) MB48.36 ± (48.33 - 48.39) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.4%
.NET 6 - Baseline
process.internal_duration_ms21.42 ± (21.36 - 21.48) ms21.52 ± (21.47 - 21.57) ms+0.5%✅⬆️
process.time_to_main_ms74.47 ± (74.19 - 74.75) ms74.75 ± (74.49 - 75.01) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.62 - 10.63) MB10.63 ± (10.63 - 10.63) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.42 ± (21.36 - 21.48) ms21.46 ± (21.41 - 21.51) ms+0.2%✅⬆️
process.time_to_main_ms76.78 ± (76.52 - 77.05) ms76.27 ± (76.03 - 76.51) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.74 ± (10.74 - 10.74) MB10.74 ± (10.74 - 10.75) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms371.59 ± (369.32 - 373.86) ms369.04 ± (366.90 - 371.17) ms-0.7%
process.time_to_main_ms548.46 ± (547.20 - 549.71) ms549.33 ± (547.89 - 550.77) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.79 ± (49.77 - 49.81) MB49.76 ± (49.73 - 49.78) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 8 - Baseline
process.internal_duration_ms19.25 ± (19.21 - 19.29) ms19.35 ± (19.31 - 19.38) ms+0.5%✅⬆️
process.time_to_main_ms71.92 ± (71.74 - 72.09) ms72.94 ± (72.79 - 73.09) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.68 - 7.69) MB7.67 ± (7.67 - 7.68) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.41 ± (19.37 - 19.45) ms19.60 ± (19.54 - 19.65) ms+0.9%✅⬆️
process.time_to_main_ms73.42 ± (73.24 - 73.59) ms75.65 ± (75.37 - 75.92) ms+3.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.74 ± (7.73 - 7.74) MB7.73 ± (7.72 - 7.73) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms293.59 ± (291.26 - 295.92) ms292.70 ± (290.33 - 295.06) ms-0.3%
process.time_to_main_ms501.55 ± (500.43 - 502.67) ms498.43 ± (497.41 - 499.45) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.86 ± (36.83 - 36.89) MB36.86 ± (36.83 - 36.89) 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
duration200.37 ± (200.40 - 201.39) ms198.30 ± (198.05 - 198.93) ms-1.0%
.NET Framework 4.8 - Bailout
duration203.45 ± (203.13 - 204.10) ms203.41 ± (202.79 - 203.73) ms-0.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1199.94 ± (1198.11 - 1205.68) ms1202.49 ± (1202.60 - 1207.92) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms193.95 ± (193.59 - 194.31) ms192.82 ± (192.36 - 193.29) ms-0.6%
process.time_to_main_ms84.39 ± (84.06 - 84.73) ms84.11 ± (83.80 - 84.43) ms-0.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.07 - 16.12) MB16.11 ± (16.09 - 16.14) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms193.73 ± (193.31 - 194.14) ms191.46 ± (191.01 - 191.91) ms-1.2%
process.time_to_main_ms85.28 ± (85.07 - 85.48) ms85.25 ± (84.97 - 85.53) ms-0.0%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.13 - 16.18) MB16.15 ± (16.13 - 16.18) MB-0.0%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-0.3%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms388.09 ± (386.79 - 389.39) ms387.89 ± (386.38 - 389.40) ms-0.1%
process.time_to_main_ms535.36 ± (534.14 - 536.58) ms535.62 ± (534.53 - 536.71) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.44 ± (57.22 - 57.65) MB57.23 ± (57.07 - 57.39) MB-0.4%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms197.52 ± (197.12 - 197.92) ms197.88 ± (197.48 - 198.28) ms+0.2%✅⬆️
process.time_to_main_ms72.76 ± (72.50 - 73.02) ms72.55 ± (72.28 - 72.82) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.35 ± (16.33 - 16.38) MB16.38 ± (16.35 - 16.40) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.2%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms196.25 ± (195.91 - 196.59) ms196.47 ± (196.11 - 196.83) ms+0.1%✅⬆️
process.time_to_main_ms73.19 ± (73.00 - 73.37) ms73.33 ± (73.13 - 73.54) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.43 ± (16.40 - 16.47) MB16.44 ± (16.42 - 16.47) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.1%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms587.21 ± (584.92 - 589.49) ms585.94 ± (582.87 - 589.01) ms-0.2%
process.time_to_main_ms539.70 ± (538.80 - 540.59) ms543.22 ± (541.96 - 544.48) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.22 ± (61.12 - 61.31) MB61.19 ± (61.07 - 61.32) MB-0.0%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms195.19 ± (194.73 - 195.64) ms193.71 ± (193.31 - 194.11) ms-0.8%
process.time_to_main_ms72.19 ± (71.93 - 72.44) ms71.19 ± (70.94 - 71.43) ms-1.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.70 ± (11.68 - 11.73) MB11.71 ± (11.68 - 11.73) MB+0.0%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.1%
.NET 8 - Bailout
process.internal_duration_ms195.06 ± (194.69 - 195.44) ms194.23 ± (193.72 - 194.73) ms-0.4%
process.time_to_main_ms72.91 ± (72.73 - 73.09) ms72.93 ± (72.65 - 73.22) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.77 ± (11.74 - 11.79) MB11.81 ± (11.79 - 11.83) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.3%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms511.95 ± (509.42 - 514.47) ms513.23 ± (510.76 - 515.69) ms+0.2%✅⬆️
process.time_to_main_ms490.86 ± (490.04 - 491.67) ms489.62 ± (488.82 - 490.42) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.60 ± (50.56 - 50.63) MB50.69 ± (50.65 - 50.73) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 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 (8747) - mean (75ms)  : 71, 79
    master - mean (73ms)  : 71, 75

    section Bailout
    This PR (8747) - mean (77ms)  : 75, 80
    master - mean (77ms)  : 74, 81

    section CallTarget+Inlining+NGEN
    This PR (8747) - mean (1,109ms)  : 1062, 1155
    master - mean (1,105ms)  : 1051, 1158

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 (8747) - mean (116ms)  : 111, 121
    master - mean (114ms)  : 110, 117

    section Bailout
    This PR (8747) - mean (115ms)  : 112, 118
    master - mean (118ms)  : 113, 124

    section CallTarget+Inlining+NGEN
    This PR (8747) - mean (798ms)  : 776, 820
    master - mean (794ms)  : 773, 814

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

    section Bailout
    This PR (8747) - mean (104ms)  : 100, 109
    master - mean (105ms)  : 100, 109

    section CallTarget+Inlining+NGEN
    This PR (8747) - mean (946ms)  : 911, 981
    master - mean (949ms)  : 912, 986

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8747) - mean (100ms)  : 97, 104
    master - mean (99ms)  : 95, 102

    section Bailout
    This PR (8747) - mean (103ms)  : 98, 108
    master - mean (101ms)  : 98, 103

    section CallTarget+Inlining+NGEN
    This PR (8747) - mean (826ms)  : 779, 872
    master - mean (827ms)  : 778, 876

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 (8747) - mean (198ms)  : 193, 203
    master - mean (201ms)  : 194, 208

    section Bailout
    This PR (8747) - mean (203ms)  : 199, 208
    master - mean (204ms)  : 199, 209

    section CallTarget+Inlining+NGEN
    This PR (8747) - mean (1,205ms)  : 1167, 1243
    master - mean (1,202ms)  : 1152, 1252

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 (8747) - mean (286ms)  : 281, 292
    master - mean (287ms)  : 280, 295

    section Bailout
    This PR (8747) - mean (286ms)  : 279, 293
    master - mean (288ms)  : 283, 292

    section CallTarget+Inlining+NGEN
    This PR (8747) - mean (963ms)  : 944, 981
    master - mean (965ms)  : 947, 983

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8747) - mean (279ms)  : 273, 284
    master - mean (279ms)  : 273, 284

    section Bailout
    This PR (8747) - mean (278ms)  : 274, 283
    master - mean (278ms)  : 273, 282

    section CallTarget+Inlining+NGEN
    This PR (8747) - mean (1,162ms)  : 1134, 1190
    master - mean (1,157ms)  : 1120, 1193

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8747) - mean (275ms)  : 270, 281
    master - mean (278ms)  : 272, 283

    section Bailout
    This PR (8747) - mean (277ms)  : 271, 283
    master - mean (278ms)  : 272, 284

    section CallTarget+Inlining+NGEN
    This PR (8747) - mean (1,036ms)  : 991, 1081
    master - mean (1,036ms)  : 987, 1086

Loading

@dudikeleti
dudikeleti merged commit 02a4461 into master Jun 4, 2026
83 of 86 checks passed
@dudikeleti
dudikeleti deleted the dudik/fix-safe-to-call-tostring branch June 4, 2026 11:51
@github-actions github-actions Bot added this to the vNext-v3 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants