Skip to content

[Debugger] Improve debugger collection serialization#8753

Merged
dudikeleti merged 5 commits into
masterfrom
dudik/fix-debugger-collection-serialization
Jun 5, 2026
Merged

[Debugger] Improve debugger collection serialization#8753
dudikeleti merged 5 commits into
masterfrom
dudik/fix-debugger-collection-serialization

Conversation

@dudikeleti

Copy link
Copy Markdown
Contributor

Summary of changes

  • Fix debugger snapshot serialization for supported IEnumerable collection types that do not implement non-generic ICollection.
  • Add cached collection and dictionary-entry descriptors so snapshot serialization can read Count, dictionary keys, and dictionary values consistently.
  • Serialize SortedList / SortedList<TKey, TValue> as dictionary entries instead of collection elements.
  • Stop treating ConditionalWeakTable<TKey, TValue> as a supported collection for debugger snapshots.
  • Add debugger snapshot and supported-type tests for common collection and dictionary shapes.

Reason for change

  • Live Debugger snapshots should preserve useful structure for supported generic collections such as HashSet<T>, ConcurrentQueue<T>, ConcurrentBag<T>, BlockingCollection<T>, and sorted collections.
  • Dictionary-like types should be represented as key/value entries, and null/object-typed dictionary entries should keep the best available type information.

Implementation details

  • Introduces DebuggerSnapshotSerializer.CollectionDescriptors.cs with small bounded caches for supported enumerable descriptors and dictionary entry descriptors.
  • Uses type-based collection support checks and compiled Count accessors for supported enumerable types that expose an int Count property.
  • Reuses descriptor metadata when serializing dictionary entries, falling back to declared key/value types when runtime values are null.
  • Refactors supported collection/dictionary checks in Redaction to avoid LINQ and to share type-based matching logic.

Test coverage

  • Datadog.Trace.Tests.Debugger.DebuggerSnapshotCreatorTests
  • Datadog.Trace.Tests.Debugger.SupportedTypesServiceTests

@dudikeleti
dudikeleti requested a review from a team as a code owner June 4, 2026 16:26
@dudikeleti
dudikeleti requested a review from Copilot June 4, 2026 16:26
@dudikeleti dudikeleti added the type:performance Performance, speed, latency, resource usage (CPU, memory) label Jun 4, 2026
@dudikeleti
dudikeleti requested review from andreimatei and tylfin June 4, 2026 16:28
@datadog-datadog-prod-us1

This comment has been minimized.

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 improves Live Debugger snapshot serialization for a broader set of IEnumerable collection shapes (especially generic collections that don’t implement non-generic ICollection), while making dictionary-like types serialize consistently as key/value entries.

Changes:

  • Added descriptor-based logic (with small bounded caches) to consistently read Count and to serialize dictionary entries with stable key/value type selection.
  • Reclassified SortedList/SortedList<TKey, TValue> as dictionary-like for snapshot serialization, and removed ConditionalWeakTable<TKey, TValue> from supported collection handling.
  • Expanded test coverage to validate supported collection/dictionary shapes and specific dictionary-entry typing behavior (including null value fallback).

Reviewed changes

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

Show a summary per file
File Description
tracer/test/Datadog.Trace.Tests/Debugger/SupportedTypesServiceTests.cs Adds focused unit tests for Redaction supported collection vs dictionary classification.
tracer/test/Datadog.Trace.Tests/Debugger/DebuggerSnapshotCreatorTests.cs Adds snapshot-structure assertions for supported collections/dictionaries, SortedList as dictionary entries, and ConditionalWeakTable non-support.
tracer/src/Datadog.Trace/Debugger/Snapshots/Redaction.cs Refactors supported type checks to be type-based without LINQ; reclassifies SortedList as dictionary; removes ConditionalWeakTable from supported collections.
tracer/src/Datadog.Trace/Debugger/Snapshots/DebuggerSnapshotSerializer.cs Switches enumerable serialization to use computed SupportedEnumerableInfo; improves dictionary entry serialization via cached descriptors and runtime-type selection.
tracer/src/Datadog.Trace/Debugger/Snapshots/DebuggerSnapshotSerializer.CollectionDescriptors.cs Introduces cached descriptor helpers for supported enumerable count retrieval and dictionary entry accessors.

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

@dudikeleti
dudikeleti force-pushed the dudik/fix-debugger-collection-serialization branch from 2b022cc to 6bd7f9c Compare June 4, 2026 17:18
@dudikeleti
dudikeleti requested a review from Copilot June 4, 2026 17:19

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

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

@pr-commenter

pr-commenter Bot commented Jun 4, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-04 18:10:04

Comparing candidate commit 6bd7f9c in PR branch dudik/fix-debugger-collection-serialization with baseline commit 09ed0c4 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 61 known flaky benchmarks, 65 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.DbCommandBenchmark.ExecuteNonQuery net472

  • 🟥 throughput [-20834.099op/s; -18130.173op/s] or [-5.868%; -5.106%]

scenario:Benchmarks.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-4926.086op/s; -4670.661op/s] or [-5.623%; -5.332%]

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 [-6529.551op/s; -6126.333op/s] or [-7.742%; -7.264%]

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

  • 🟥 throughput [-8017.350op/s; -6675.746op/s] or [-8.152%; -6.788%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+300.504ms; +306.205ms] or [+149.120%; +151.950%]
  • 🟥 throughput [-44.395op/s; -40.509op/s] or [-7.988%; -7.288%]

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

  • 🟥 execution_time [+383.033ms; +384.382ms] or [+302.620%; +303.686%]
  • 🟩 throughput [+87.001op/s; +89.305op/s] or [+11.471%; +11.775%]

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

  • 🟥 execution_time [+397.402ms; +400.834ms] or [+351.685%; +354.723%]

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.620ms; -12.433ms] or [-7.762%; -5.807%]
  • 🟩 throughput [+7515.176op/s; +10306.843op/s] or [+5.486%; +7.523%]

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 [-271451.375op/s; -268311.077op/s] or [-27.717%; -27.396%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-26.137ms; -21.271ms] or [-11.656%; -9.486%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-156691.989op/s; -140658.392op/s] or [-22.514%; -20.210%]

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

  • 🟩 throughput [+8580.848op/s; +11597.770op/s] or [+5.460%; +7.379%]

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

  • 🟩 throughput [+8752.380op/s; +11420.123op/s] or [+6.972%; +9.098%]

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

  • 🟩 throughput [+475380.414op/s; +494085.503op/s] or [+15.851%; +16.475%]

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

  • 🟩 execution_time [-19.077ms; -14.738ms] or [-8.794%; -6.794%]
  • 🟩 throughput [+175817.386op/s; +231270.711op/s] or [+6.979%; +9.180%]

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

  • 🟥 execution_time [+300.316ms; +301.121ms] or [+150.058%; +150.460%]

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

  • 🟥 execution_time [+300.779ms; +304.651ms] or [+151.683%; +153.636%]
  • 🟩 throughput [+670.770op/s; +889.478op/s] or [+5.130%; +6.803%]

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

  • 🟥 execution_time [+299.880ms; +302.379ms] or [+151.056%; +152.315%]

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

  • 🟥 execution_time [+296.677ms; +297.476ms] or [+145.716%; +146.109%]

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

  • 🟥 execution_time [+295.111ms; +297.521ms] or [+144.269%; +145.447%]

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

  • 🟥 execution_time [+301.404ms; +304.196ms] or [+150.641%; +152.037%]

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

  • 🟥 execution_time [+22.454µs; +49.599µs] or [+5.150%; +11.376%]
  • 🟥 throughput [-241.651op/s; -119.752op/s] or [-10.506%; -5.206%]

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

  • 🟥 execution_time [+33.070µs; +57.291µs] or [+10.558%; +18.290%]
  • 🟥 throughput [-516.999op/s; -314.083op/s] or [-16.116%; -9.791%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.418ms; +300.173ms] or [+149.440%; +149.817%]

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

  • unstable execution_time [+317.804ms; +388.800ms] or [+345.307%; +422.447%]
  • 🟩 throughput [+666.424op/s; +904.920op/s] or [+5.476%; +7.436%]

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

  • 🟥 execution_time [+369.685ms; +374.907ms] or [+280.698%; +284.664%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+3.151KB; +3.157KB] or [+5.598%; +5.608%]
  • unstable execution_time [+282.545ms; +339.519ms] or [+129.912%; +156.107%]
  • 🟥 throughput [-540.634op/s; -493.761op/s] or [-48.987%; -44.740%]

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

  • unstable execution_time [+209.379ms; +342.629ms] or [+89.228%; +146.014%]
  • 🟥 throughput [-676.297op/s; -592.560op/s] or [-45.109%; -39.524%]

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

  • 🟥 execution_time [+327.035ms; +342.370ms] or [+195.605%; +204.777%]
  • 🟥 throughput [-394.898op/s; -357.854op/s] or [-27.496%; -24.917%]

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

  • 🟩 execution_time [-170.669µs; -104.164µs] or [-8.645%; -5.277%]
  • 🟩 throughput [+31.087op/s; +48.772op/s] or [+6.137%; +9.628%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+304.337ms; +306.847ms] or [+153.258%; +154.523%]

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

  • 🟥 execution_time [+301.411ms; +303.856ms] or [+151.038%; +152.263%]

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

  • 🟥 execution_time [+301.602ms; +304.714ms] or [+151.512%; +153.075%]
  • 🟩 throughput [+25870.505op/s; +33566.685op/s] or [+5.450%; +7.071%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.114ms; +304.247ms] or [+151.711%; +152.783%]

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

  • 🟥 execution_time [+296.754ms; +299.044ms] or [+146.731%; +147.864%]

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

  • 🟥 execution_time [+302.599ms; +306.460ms] or [+153.371%; +155.328%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+300.522ms; +302.748ms] or [+150.835%; +151.952%]

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

  • 🟥 execution_time [+300.926ms; +302.823ms] or [+149.984%; +150.930%]
  • 🟩 throughput [+53117.369op/s; +60342.017op/s] or [+10.547%; +11.982%]

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

  • 🟥 execution_time [+300.064ms; +303.243ms] or [+149.279%; +150.861%]

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

  • 🟩 execution_time [-16.918ms; -13.274ms] or [-7.867%; -6.172%]

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

  • unstable execution_time [+0.796µs; +44.355µs] or [+0.197%; +10.956%]

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

  • 🟩 allocated_mem [-20.008KB; -19.986KB] or [-7.299%; -7.290%]
  • unstable execution_time [-41.350µs; +13.477µs] or [-8.173%; +2.664%]

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

  • 🟩 allocated_mem [-18.722KB; -18.704KB] or [-6.825%; -6.819%]
  • unstable execution_time [-66.375µs; -6.050µs] or [-11.502%; -1.048%]

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

  • unstable execution_time [+6.166µs; +11.020µs] or [+14.575%; +26.049%]
  • 🟥 throughput [-4847.703op/s; -2957.184op/s] or [-20.407%; -12.449%]

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

  • unstable execution_time [-13.449µs; -5.665µs] or [-20.865%; -8.789%]
  • unstable throughput [+1344.400op/s; +3069.971op/s] or [+8.248%; +18.835%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.740ms; +304.151ms] or [+153.022%; +153.735%]

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

  • 🟥 execution_time [+304.109ms; +306.418ms] or [+154.791%; +155.966%]

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

  • 🟥 execution_time [+301.196ms; +303.714ms] or [+150.786%; +152.046%]

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

  • 🟩 throughput [+33860.994op/s; +36211.947op/s] or [+6.409%; +6.854%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.931ms; +302.844ms] or [+149.987%; +150.940%]

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

  • 🟥 execution_time [+301.192ms; +302.392ms] or [+151.244%; +151.847%]

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

  • 🟥 execution_time [+303.222ms; +307.295ms] or [+153.775%; +155.840%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.630ms; +301.420ms] or [+149.956%; +150.350%]
  • 🟩 throughput [+61094398.078op/s; +61428039.942op/s] or [+44.493%; +44.736%]

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

  • 🟥 execution_time [+424.499ms; +428.226ms] or [+527.940%; +532.575%]

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

  • 🟥 execution_time [+299.812ms; +300.864ms] or [+149.539%; +150.064%]

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

  • 🟩 throughput [+60918.255op/s; +81925.560op/s] or [+5.688%; +7.649%]

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

  • 🟩 throughput [+75709.549op/s; +109770.592op/s] or [+5.860%; +8.496%]

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

  • 🟩 throughput [+76860.558op/s; +84482.793op/s] or [+7.633%; +8.391%]

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

  • 🟩 throughput [+45850.591op/s; +51954.323op/s] or [+8.326%; +9.434%]

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

  • 🟩 throughput [+24521.406op/s; +34372.205op/s] or [+5.489%; +7.694%]

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

  • 🟩 throughput [+92437.609op/s; +110655.387op/s] or [+10.328%; +12.363%]

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.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • 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.StartFinishTwoScopes net472
  • 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 (8753) 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.25 ± (73.35 - 73.80) ms75.75 ± (75.57 - 76.13) ms+3.4%✅⬆️
.NET Framework 4.8 - Bailout
duration77.35 ± (77.20 - 77.57) ms77.72 ± (77.77 - 78.22) ms+0.5%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1107.08 ± (1106.78 - 1114.16) ms1106.98 ± (1106.28 - 1115.93) ms-0.0%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.42 ± (22.38 - 22.47) ms22.63 ± (22.57 - 22.69) ms+0.9%✅⬆️
process.time_to_main_ms84.40 ± (84.16 - 84.64) ms86.34 ± (86.04 - 86.65) 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.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.35 ± (22.31 - 22.40) ms22.29 ± (22.25 - 22.33) ms-0.3%
process.time_to_main_ms85.82 ± (85.59 - 86.04) ms86.10 ± (85.89 - 86.32) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.94 - 10.95) MB10.95 ± (10.95 - 10.96) MB+0.0%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms215.84 ± (214.99 - 216.69) ms215.08 ± (214.30 - 215.86) ms-0.4%
process.time_to_main_ms544.33 ± (542.98 - 545.67) ms546.35 ± (544.93 - 547.77) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.33 ± (48.30 - 48.36) MB48.35 ± (48.32 - 48.37) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.64 ± (21.57 - 21.70) ms21.28 ± (21.24 - 21.31) ms-1.7%
process.time_to_main_ms75.78 ± (75.48 - 76.09) ms74.43 ± (74.27 - 74.60) ms-1.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.61 - 10.62) MB10.65 ± (10.64 - 10.65) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.24 ± (21.20 - 21.28) ms21.12 ± (21.08 - 21.17) ms-0.6%
process.time_to_main_ms74.62 ± (74.43 - 74.81) ms74.22 ± (74.03 - 74.40) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.74) MB10.76 ± (10.76 - 10.76) MB+0.3%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms369.52 ± (367.48 - 371.56) ms372.02 ± (369.76 - 374.29) ms+0.7%✅⬆️
process.time_to_main_ms547.15 ± (545.70 - 548.59) ms552.60 ± (551.06 - 554.15) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.78 ± (49.76 - 49.81) MB49.82 ± (49.79 - 49.85) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.47 ± (19.42 - 19.51) ms19.68 ± (19.63 - 19.74) ms+1.1%✅⬆️
process.time_to_main_ms73.13 ± (72.87 - 73.39) ms75.03 ± (74.77 - 75.29) ms+2.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.66 - 7.67) MB7.68 ± (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.68 ± (19.61 - 19.74) ms19.41 ± (19.37 - 19.44) ms-1.4%
process.time_to_main_ms75.96 ± (75.66 - 76.26) ms74.12 ± (73.94 - 74.29) ms-2.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.72 - 7.73) MB7.72 ± (7.72 - 7.72) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms294.67 ± (292.49 - 296.84) ms297.80 ± (295.53 - 300.08) ms+1.1%✅⬆️
process.time_to_main_ms496.73 ± (495.47 - 497.99) ms502.33 ± (501.04 - 503.62) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.79 ± (36.76 - 36.82) MB36.89 ± (36.85 - 36.92) MB+0.3%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.1%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration196.77 ± (196.44 - 197.42) ms199.69 ± (199.64 - 200.60) ms+1.5%✅⬆️
.NET Framework 4.8 - Bailout
duration201.36 ± (200.49 - 201.43) ms204.82 ± (204.51 - 205.27) ms+1.7%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1199.45 ± (1198.75 - 1204.41) ms1206.00 ± (1207.47 - 1213.10) ms+0.5%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms193.19 ± (192.68 - 193.70) ms194.65 ± (194.17 - 195.14) ms+0.8%✅⬆️
process.time_to_main_ms84.47 ± (84.17 - 84.78) ms85.06 ± (84.76 - 85.36) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.08 - 16.12) MB16.07 ± (16.05 - 16.09) MB-0.2%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms192.92 ± (192.43 - 193.41) ms194.64 ± (194.17 - 195.12) ms+0.9%✅⬆️
process.time_to_main_ms85.36 ± (85.11 - 85.62) ms86.61 ± (86.36 - 86.86) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.17 ± (16.14 - 16.19) MB16.22 ± (16.19 - 16.24) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 21)21 ± (21 - 21)+0.7%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms386.66 ± (385.47 - 387.85) ms388.33 ± (387.07 - 389.58) ms+0.4%✅⬆️
process.time_to_main_ms537.72 ± (536.35 - 539.08) ms544.19 ± (542.81 - 545.57) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed57.60 ± (57.38 - 57.81) MB57.99 ± (57.77 - 58.21) MB+0.7%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.4%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms197.93 ± (197.53 - 198.33) ms199.62 ± (199.19 - 200.05) ms+0.9%✅⬆️
process.time_to_main_ms72.53 ± (72.24 - 72.82) ms73.95 ± (73.70 - 74.20) ms+2.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.32 ± (16.30 - 16.34) MB16.38 ± (16.35 - 16.40) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.2%
.NET 6 - Bailout
process.internal_duration_ms197.36 ± (197.03 - 197.70) ms198.16 ± (197.77 - 198.54) ms+0.4%✅⬆️
process.time_to_main_ms73.71 ± (73.57 - 73.86) ms74.69 ± (74.48 - 74.90) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.42 ± (16.39 - 16.45) MB16.35 ± (16.33 - 16.38) MB-0.4%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.1%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms588.26 ± (585.50 - 591.02) ms585.34 ± (582.75 - 587.93) ms-0.5%
process.time_to_main_ms541.86 ± (540.66 - 543.05) ms549.10 ± (547.96 - 550.23) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.25 ± (61.15 - 61.36) MB61.18 ± (61.09 - 61.27) MB-0.1%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.5%
.NET 8 - Baseline
process.internal_duration_ms195.41 ± (194.99 - 195.84) ms196.20 ± (195.79 - 196.61) ms+0.4%✅⬆️
process.time_to_main_ms72.18 ± (71.95 - 72.41) ms72.50 ± (72.21 - 72.80) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.70 ± (11.68 - 11.72) MB11.70 ± (11.69 - 11.72) MB+0.0%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.0%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms195.07 ± (194.62 - 195.52) ms195.21 ± (194.78 - 195.65) ms+0.1%✅⬆️
process.time_to_main_ms73.02 ± (72.83 - 73.20) ms73.07 ± (72.88 - 73.27) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.74 - 11.78) MB11.78 ± (11.76 - 11.80) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.2%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms512.92 ± (510.16 - 515.69) ms512.98 ± (510.47 - 515.49) ms+0.0%✅⬆️
process.time_to_main_ms493.02 ± (492.10 - 493.94) ms495.27 ± (494.45 - 496.08) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.56 ± (50.52 - 50.59) MB50.62 ± (50.59 - 50.66) MB+0.1%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 30)30 ± (30 - 30)+0.5%✅⬆️
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 (8753) - mean (76ms)  : 72, 80
    master - mean (74ms)  : 70, 77

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

    section CallTarget+Inlining+NGEN
    This PR (8753) - mean (1,111ms)  : 1037, 1185
    master - mean (1,110ms)  : 1055, 1165

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 (8753) - mean (116ms)  : 110, 122
    master - mean (114ms)  : 109, 118

    section Bailout
    This PR (8753) - mean (115ms)  : 112, 118
    master - mean (115ms)  : 112, 118

    section CallTarget+Inlining+NGEN
    This PR (8753) - mean (797ms)  : 762, 831
    master - mean (796ms)  : 768, 824

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

    section Bailout
    This PR (8753) - mean (102ms)  : 99, 105
    master - mean (102ms)  : 98, 106

    section CallTarget+Inlining+NGEN
    This PR (8753) - mean (959ms)  : 917, 1002
    master - mean (945ms)  : 907, 984

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

    section Bailout
    This PR (8753) - mean (101ms)  : 98, 104
    master - mean (104ms)  : 97, 110

    section CallTarget+Inlining+NGEN
    This PR (8753) - mean (831ms)  : 793, 869
    master - mean (822ms)  : 787, 857

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 (8753) - mean (200ms)  : 195, 205
    master - mean (197ms)  : 190, 204

    section Bailout
    This PR (8753) - mean (205ms)  : 201, 209
    master - mean (201ms)  : 196, 206

    section CallTarget+Inlining+NGEN
    This PR (8753) - mean (1,210ms)  : 1170, 1251
    master - mean (1,202ms)  : 1163, 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 (8753) - mean (289ms)  : 280, 297
    master - mean (287ms)  : 279, 295

    section Bailout
    This PR (8753) - mean (290ms)  : 284, 297
    master - mean (287ms)  : 281, 293

    section CallTarget+Inlining+NGEN
    This PR (8753) - mean (974ms)  : 954, 993
    master - mean (965ms)  : 943, 987

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8753) - mean (282ms)  : 275, 288
    master - mean (279ms)  : 274, 285

    section Bailout
    This PR (8753) - mean (281ms)  : 276, 287
    master - mean (279ms)  : 275, 284

    section CallTarget+Inlining+NGEN
    This PR (8753) - mean (1,171ms)  : 1132, 1210
    master - mean (1,160ms)  : 1117, 1204

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

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

    section CallTarget+Inlining+NGEN
    This PR (8753) - mean (1,042ms)  : 1003, 1080
    master - mean (1,038ms)  : 987, 1090

Loading

@dudikeleti
dudikeleti enabled auto-merge (squash) June 4, 2026 20:44
Comment on lines +32 to +63
private static DictionaryEntryDescriptor GetDictionaryEntryDescriptor(Type runtimeType)
{
var descriptors = _dictionaryEntryDescriptors;
for (var i = 0; i < descriptors.Length; i++)
{
if (descriptors[i].RuntimeType == runtimeType)
{
return descriptors[i];
}
}

lock (DictionaryEntryDescriptorCacheLock)
{
descriptors = _dictionaryEntryDescriptors;
for (var i = 0; i < descriptors.Length; i++)
{
if (descriptors[i].RuntimeType == runtimeType)
{
return descriptors[i];
}
}

var descriptor = CreateDictionaryEntryDescriptor(runtimeType);
if (descriptors.Length < MaxDictionaryEntryDescriptorCacheSize)
{
var newDescriptors = new DictionaryEntryDescriptor[descriptors.Length + 1];
Array.Copy(descriptors, newDescriptors, descriptors.Length);
newDescriptors[descriptors.Length] = descriptor;
_dictionaryEntryDescriptors = newDescriptors;
}

return descriptor;

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.

In Java we have a CopyOnWriteArrayList with this implementation.
Worth exploring or at least adding a class for those 2 usages. this is exactly this usage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We have Concurrent* collections, Frozen* types, and ImmutableArray, but none of them is exactly what we want.
For this tiny cache, a raw array + lock is a good solution.
Adding a CopyOnWriteArrayList implementation sounds like a good idea. I'll do that in a follow-up PR.

@dudikeleti
dudikeleti merged commit 12768a8 into master Jun 5, 2026
142 checks passed
@dudikeleti
dudikeleti deleted the dudik/fix-debugger-collection-serialization branch June 5, 2026 09:19
@github-actions github-actions Bot added this to the vNext-v3 milestone Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants