Skip to content

Move vendored ReadOnlySpan<T>, Span<T> et. al. to System namespace#8476

Merged
andrewlock merged 9 commits intomasterfrom
andrew/update-vendors-8
Apr 24, 2026
Merged

Move vendored ReadOnlySpan<T>, Span<T> et. al. to System namespace#8476
andrewlock merged 9 commits intomasterfrom
andrew/update-vendors-8

Conversation

@andrewlock
Copy link
Copy Markdown
Member

Summary of changes

Updates the System.Memory vendoring code to move types like ReadOnlySpan<T>, Span<T> into System instead of Datadog.Trace.VendoredMicrosoftCode.System

Reason for change

The compiler has various functionality that relies on the Span<T> (and ReadOnlySpan<T>) being available in the System namespace. By making this change, we get the advantage of those types being available.

A separate PR will actually update code to use those types, except where changes were required to make it compile in this PR.

Implementation details

Update the vendoring code to stop changing the namespace.

Test coverage

This is the test, if the tests pass, we should be fine.

Other details

Depends on a stack updating our vendored system code

@andrewlock andrewlock added type:performance Performance, speed, latency, resource usage (CPU, memory) area:vendors Code from other vendors labels Apr 17, 2026
Comment thread tracer/src/Datadog.Trace/Propagators/W3CTraceContextPropagator.cs
@dd-trace-dotnet-ci-bot
Copy link
Copy Markdown

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

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8476) 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.47 ± (72.42 - 72.82) ms74.80 ± (74.47 - 74.99) ms+3.2%✅⬆️
.NET Framework 4.8 - Bailout
duration76.71 ± (76.65 - 77.02) ms79.64 ± (79.45 - 79.96) ms+3.8%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1074.78 ± (1075.28 - 1081.46) ms1080.18 ± (1081.77 - 1091.35) ms+0.5%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.42 ± (22.37 - 22.47) ms22.74 ± (22.68 - 22.80) ms+1.4%✅⬆️
process.time_to_main_ms84.32 ± (84.06 - 84.58) ms86.85 ± (86.49 - 87.21) ms+3.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.90 - 10.90) MB10.91 ± (10.90 - 10.91) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.22 ± (22.19 - 22.26) ms22.33 ± (22.30 - 22.37) ms+0.5%✅⬆️
process.time_to_main_ms84.83 ± (84.65 - 85.02) ms85.90 ± (85.69 - 86.11) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.94 ± (10.94 - 10.94) MB+0.4%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms230.39 ± (229.22 - 231.56) ms212.55 ± (211.64 - 213.47) ms-7.7%
process.time_to_main_ms530.99 ± (529.72 - 532.26) ms527.68 ± (526.29 - 529.06) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.36 ± (48.32 - 48.39) MB47.70 ± (47.66 - 47.73) MB-1.4%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 6 - Baseline
process.internal_duration_ms21.44 ± (21.38 - 21.50) ms21.42 ± (21.37 - 21.47) ms-0.1%
process.time_to_main_ms75.83 ± (75.55 - 76.10) ms74.21 ± (73.94 - 74.48) ms-2.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.60 - 10.60) MB10.62 ± (10.62 - 10.62) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.11 ± (21.08 - 21.15) ms21.51 ± (21.46 - 21.57) ms+1.9%✅⬆️
process.time_to_main_ms74.72 ± (74.53 - 74.91) ms76.51 ± (76.25 - 76.77) ms+2.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.72 ± (10.72 - 10.72) MB10.73 ± (10.72 - 10.73) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms381.75 ± (379.82 - 383.68) ms385.67 ± (383.62 - 387.72) ms+1.0%✅⬆️
process.time_to_main_ms531.07 ± (529.72 - 532.43) ms527.15 ± (525.93 - 528.37) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.81 ± (49.78 - 49.84) MB49.25 ± (49.23 - 49.28) MB-1.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.8%
.NET 8 - Baseline
process.internal_duration_ms19.60 ± (19.55 - 19.65) ms19.42 ± (19.38 - 19.45) ms-0.9%
process.time_to_main_ms73.48 ± (73.21 - 73.75) ms72.62 ± (72.47 - 72.78) ms-1.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.68 - 7.69) MB7.66 ± (7.66 - 7.67) MB-0.3%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.84 ± (19.78 - 19.90) ms19.76 ± (19.70 - 19.82) ms-0.4%
process.time_to_main_ms76.37 ± (76.10 - 76.65) ms75.97 ± (75.69 - 76.25) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.72 - 7.73) MB7.72 ± (7.71 - 7.72) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms303.50 ± (300.94 - 306.06) ms301.57 ± (299.19 - 303.95) ms-0.6%
process.time_to_main_ms493.67 ± (492.43 - 494.90) ms489.88 ± (488.69 - 491.07) ms-0.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.09 ± (37.06 - 37.11) MB36.46 ± (36.44 - 36.49) MB-1.7%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.5%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration192.40 ± (192.39 - 193.08) ms193.23 ± (193.24 - 193.99) ms+0.4%✅⬆️
.NET Framework 4.8 - Bailout
duration196.34 ± (196.15 - 196.57) ms196.62 ± (196.35 - 196.76) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1151.69 ± (1154.23 - 1160.96) ms1152.47 ± (1154.33 - 1160.73) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms185.83 ± (185.42 - 186.25) ms186.22 ± (185.92 - 186.53) ms+0.2%✅⬆️
process.time_to_main_ms81.28 ± (81.08 - 81.48) ms81.18 ± (80.96 - 81.39) ms-0.1%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.08 ± (16.05 - 16.10) MB16.09 ± (16.05 - 16.12) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)19 ± (19 - 20)-0.5%
.NET Core 3.1 - Bailout
process.internal_duration_ms187.79 ± (187.40 - 188.19) ms185.69 ± (185.41 - 185.97) ms-1.1%
process.time_to_main_ms83.57 ± (83.37 - 83.77) ms82.39 ± (82.24 - 82.53) ms-1.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.13 ± (16.11 - 16.16) MB16.12 ± (16.09 - 16.15) MB-0.1%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.2%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms398.38 ± (397.18 - 399.58) ms375.42 ± (374.22 - 376.62) ms-5.8%
process.time_to_main_ms515.18 ± (514.10 - 516.27) ms507.47 ± (506.26 - 508.68) ms-1.5%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed59.27 ± (59.21 - 59.32) MB56.70 ± (56.65 - 56.75) MB-4.3%
runtime.dotnet.threads.count30 ± (30 - 30)29 ± (29 - 30)-0.2%
.NET 6 - Baseline
process.internal_duration_ms192.07 ± (191.69 - 192.44) ms191.18 ± (190.83 - 191.53) ms-0.5%
process.time_to_main_ms71.21 ± (70.98 - 71.43) ms70.91 ± (70.74 - 71.08) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.27 ± (16.17 - 16.37) MB16.05 ± (15.90 - 16.21) MB-1.3%
runtime.dotnet.threads.count19 ± (19 - 19)18 ± (18 - 18)-2.8%
.NET 6 - Bailout
process.internal_duration_ms191.31 ± (191.00 - 191.62) ms190.39 ± (190.15 - 190.63) ms-0.5%
process.time_to_main_ms72.29 ± (72.16 - 72.42) ms71.53 ± (71.40 - 71.65) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.06 ± (15.92 - 16.21) MB16.21 ± (16.09 - 16.34) MB+0.9%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)19 ± (19 - 20)-2.5%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms599.19 ± (596.40 - 601.98) ms583.17 ± (578.59 - 587.76) ms-2.7%
process.time_to_main_ms513.91 ± (512.94 - 514.88) ms509.27 ± (508.33 - 510.21) ms-0.9%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.63 ± (61.54 - 61.72) MB60.73 ± (60.63 - 60.82) MB-1.5%
runtime.dotnet.threads.count30 ± (30 - 30)31 ± (31 - 31)+1.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms191.72 ± (191.25 - 192.19) ms188.68 ± (188.32 - 189.03) ms-1.6%
process.time_to_main_ms71.15 ± (70.98 - 71.32) ms70.40 ± (70.18 - 70.61) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.72 - 11.75) MB11.78 ± (11.76 - 11.81) MB+0.4%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.8%
.NET 8 - Bailout
process.internal_duration_ms188.59 ± (188.19 - 189.00) ms187.52 ± (187.32 - 187.73) ms-0.6%
process.time_to_main_ms71.63 ± (71.46 - 71.81) ms71.16 ± (71.06 - 71.25) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.81 ± (11.79 - 11.83) MB11.85 ± (11.83 - 11.88) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.2%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms518.35 ± (515.56 - 521.13) ms515.71 ± (512.94 - 518.48) ms-0.5%
process.time_to_main_ms474.45 ± (473.54 - 475.37) ms468.92 ± (468.15 - 469.69) ms-1.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.72 ± (50.68 - 50.75) MB50.19 ± (50.16 - 50.22) MB-1.0%
runtime.dotnet.threads.count30 ± (30 - 30)29 ± (29 - 30)-1.4%
Comparison explanation

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

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

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

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

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

    section Bailout
    This PR (8476) - mean (80ms)  : 76, 83
    master - mean (77ms)  : 75, 79

    section CallTarget+Inlining+NGEN
    This PR (8476) - mean (1,087ms)  : 1015, 1158
    master - mean (1,078ms)  : 1034, 1122

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 (8476) - mean (117ms)  : 109, 124
    master - mean (114ms)  : 108, 119

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

    section CallTarget+Inlining+NGEN
    This PR (8476) - mean (779ms)  : 754, 803
    master - mean (800ms)  : 771, 828

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

    section Bailout
    This PR (8476) - mean (105ms)  : 99, 111
    master - mean (102ms)  : 98, 107

    section CallTarget+Inlining+NGEN
    This PR (8476) - mean (941ms)  : 906, 977
    master - mean (942ms)  : 896, 988

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

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

    section CallTarget+Inlining+NGEN
    This PR (8476) - mean (822ms)  : 787, 856
    master - mean (829ms)  : 783, 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 (8476) - mean (194ms)  : 190, 197
    master - mean (193ms)  : 189, 196

    section Bailout
    This PR (8476) - mean (197ms)  : 195, 198
    master - mean (196ms)  : 194, 198

    section CallTarget+Inlining+NGEN
    This PR (8476) - mean (1,158ms)  : 1112, 1203
    master - mean (1,158ms)  : 1108, 1207

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 (8476) - mean (276ms)  : 271, 281
    master - mean (276ms)  : 271, 281

    section Bailout
    This PR (8476) - mean (277ms)  : 272, 281
    master - mean (281ms)  : 274, 287

    section CallTarget+Inlining+NGEN
    This PR (8476) - mean (913ms)  : 889, 937
    master - mean (946ms)  : 921, 971

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8476) - mean (270ms)  : 267, 274
    master - mean (272ms)  : 265, 279

    section Bailout
    This PR (8476) - mean (270ms)  : 267, 274
    master - mean (272ms)  : 267, 277

    section CallTarget+Inlining+NGEN
    This PR (8476) - mean (1,119ms)  : 1047, 1192
    master - mean (1,145ms)  : 1104, 1185

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8476) - mean (270ms)  : 264, 275
    master - mean (273ms)  : 263, 283

    section Bailout
    This PR (8476) - mean (268ms)  : 266, 271
    master - mean (271ms)  : 263, 278

    section CallTarget+Inlining+NGEN
    This PR (8476) - mean (1,017ms)  : 970, 1063
    master - mean (1,030ms)  : 981, 1079

Loading

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Apr 17, 2026

Benchmarks

Benchmark execution time: 2026-04-23 13:19:48

Comparing candidate commit 0688bae in PR branch andrew/update-vendors-8 with baseline commit 7520173 in branch master.

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

Explanation

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

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

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

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

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

More details about the CI and significant changes

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

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

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

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

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

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

Known flaky benchmarks

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

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

  • 🟩 throughput [+7655.576op/s; +9957.761op/s] or [+6.435%; +8.370%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+317.079ms; +319.734ms] or [+157.346%; +158.663%]

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

  • 🟥 execution_time [+378.250ms; +380.892ms] or [+298.841%; +300.928%]

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

  • 🟥 execution_time [+399.314ms; +401.389ms] or [+353.378%; +355.214%]

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

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

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-15.728ms; -11.554ms] or [-7.346%; -5.396%]

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

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

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-248583.708op/s; -244343.716op/s] or [-25.382%; -24.949%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-26.459ms; -21.603ms] or [-11.800%; -9.634%]
  • 🟥 throughput [-72732.725op/s; -49696.578op/s] or [-7.770%; -5.309%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-155686.160op/s; -139470.914op/s] or [-22.369%; -20.039%]

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

  • 🟩 throughput [+9948.855op/s; +12937.071op/s] or [+6.330%; +8.232%]

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

  • 🟩 throughput [+7897.278op/s; +10542.524op/s] or [+6.291%; +8.398%]

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

  • 🟩 throughput [+367763.382op/s; +403059.054op/s] or [+12.263%; +13.440%]

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

  • 🟩 execution_time [-18.421ms; -14.038ms] or [-8.492%; -6.471%]
  • 🟩 throughput [+153043.005op/s; +209278.534op/s] or [+6.075%; +8.307%]

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

  • 🟥 execution_time [+300.168ms; +300.848ms] or [+149.984%; +150.324%]

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

  • 🟥 execution_time [+299.780ms; +302.923ms] or [+151.180%; +152.765%]

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

  • 🟥 execution_time [+300.775ms; +303.846ms] or [+151.507%; +153.054%]

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

  • 🟥 execution_time [+296.288ms; +297.055ms] or [+145.525%; +145.902%]

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

  • 🟥 execution_time [+295.859ms; +298.896ms] or [+144.635%; +146.119%]

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

  • 🟥 execution_time [+302.312ms; +303.970ms] or [+151.095%; +151.924%]

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

  • 🟥 execution_time [+24.119µs; +48.712µs] or [+7.700%; +15.551%]
  • 🟥 throughput [-443.479op/s; -240.811op/s] or [-13.825%; -7.507%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.542ms; +300.219ms] or [+149.502%; +149.840%]

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

  • unstable execution_time [+330.470ms; +379.747ms] or [+359.070%; +412.611%]
  • 🟩 throughput [+1153.138op/s; +1303.294op/s] or [+9.476%; +10.709%]

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

  • unstable execution_time [+343.115ms; +362.122ms] or [+260.524%; +274.956%]
  • 🟩 throughput [+735.580op/s; +933.865op/s] or [+7.121%; +9.040%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+240.579ms; +321.700ms] or [+110.616%; +147.915%]
  • 🟥 throughput [-539.226op/s; -469.501op/s] or [-48.859%; -42.541%]

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

  • unstable execution_time [+204.385ms; +337.597ms] or [+87.100%; +143.870%]
  • 🟥 throughput [-746.709op/s; -663.274op/s] or [-49.806%; -44.241%]

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

  • 🟥 execution_time [+342.374ms; +349.752ms] or [+204.779%; +209.192%]
  • 🟥 throughput [-418.021op/s; -382.832op/s] or [-29.106%; -26.656%]

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

  • 🟩 throughput [+28.052op/s; +38.227op/s] or [+5.538%; +7.546%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.793ms; +305.084ms] or [+152.984%; +153.634%]

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

  • 🟥 execution_time [+302.469ms; +305.776ms] or [+151.568%; +153.225%]

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

  • 🟥 execution_time [+301.750ms; +304.965ms] or [+151.586%; +153.201%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.859ms; +303.975ms] or [+152.086%; +152.646%]

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

  • 🟥 execution_time [+298.878ms; +300.687ms] or [+147.782%; +148.676%]

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

  • 🟥 execution_time [+303.313ms; +306.995ms] or [+153.732%; +155.599%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+301.620ms; +303.765ms] or [+151.386%; +152.463%]

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

  • 🟥 execution_time [+300.019ms; +306.919ms] or [+149.532%; +152.971%]
  • 🟩 throughput [+33814.723op/s; +43263.375op/s] or [+6.715%; +8.591%]

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

  • 🟥 execution_time [+299.254ms; +306.124ms] or [+148.876%; +152.294%]

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

  • 🟩 execution_time [-15.524ms; -11.874ms] or [-7.219%; -5.522%]
  • 🟩 throughput [+18302.896op/s; +25307.808op/s] or [+5.021%; +6.943%]

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

  • unstable execution_time [+17.359µs; +60.276µs] or [+4.288%; +14.889%]

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

  • 🟩 allocated_mem [-26.190KB; -26.170KB] or [-9.554%; -9.546%]
  • unstable execution_time [-43.221µs; +8.883µs] or [-8.542%; +1.756%]

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

  • unstable execution_time [+8.344µs; +12.879µs] or [+19.722%; +30.442%]
  • 🟥 throughput [-5468.016op/s; -3637.240op/s] or [-23.019%; -15.312%]

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

  • unstable execution_time [-14.862µs; -7.836µs] or [-23.058%; -12.157%]
  • 🟩 throughput [+2037.462op/s; +3492.913op/s] or [+12.501%; +21.430%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.583ms; +302.893ms] or [+152.437%; +153.099%]

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

  • 🟥 execution_time [+300.403ms; +303.089ms] or [+152.904%; +154.271%]

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

  • 🟥 execution_time [+299.645ms; +301.786ms] or [+150.009%; +151.081%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472

  • 🟥 throughput [-27928.356op/s; -26491.068op/s] or [-7.731%; -7.333%]

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

  • 🟩 throughput [+31317.534op/s; +35724.871op/s] or [+5.928%; +6.762%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.209ms; +302.041ms] or [+149.627%; +150.540%]

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

  • 🟥 execution_time [+301.639ms; +302.916ms] or [+151.469%; +152.110%]

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

  • 🟥 execution_time [+304.718ms; +307.293ms] or [+154.533%; +155.839%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.663ms; +300.220ms] or [+149.473%; +149.751%]
  • 🟩 throughput [+61092663.523op/s; +61327850.585op/s] or [+44.491%; +44.663%]

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

  • 🟥 execution_time [+423.434ms; +427.519ms] or [+526.615%; +531.696%]
  • 🟩 throughput [+984.085op/s; +1167.178op/s] or [+7.607%; +9.023%]

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

  • 🟥 execution_time [+299.321ms; +300.268ms] or [+149.295%; +149.767%]

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

  • 🟩 throughput [+84855.871op/s; +93972.418op/s] or [+7.923%; +8.774%]

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

  • 🟩 throughput [+52555.295op/s; +72490.904op/s] or [+6.083%; +8.391%]

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

  • 🟩 throughput [+96186.430op/s; +105111.215op/s] or [+9.553%; +10.439%]

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

  • 🟩 throughput [+38656.903op/s; +45226.002op/s] or [+7.019%; +8.212%]

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

  • 🟩 throughput [+28986.937op/s; +38661.397op/s] or [+6.488%; +8.654%]

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

  • 🟩 throughput [+65105.044op/s; +84840.215op/s] or [+7.274%; +9.479%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice 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.StringConcatAspectBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@andrewlock andrewlock marked this pull request as ready for review April 20, 2026 15:53
@andrewlock andrewlock requested review from a team as code owners April 20, 2026 15:53
@andrewlock andrewlock force-pushed the andrew/update-vendors-7 branch from 3af08ab to 528b407 Compare April 21, 2026 10:19
@andrewlock andrewlock requested review from a team as code owners April 21, 2026 10:19
@andrewlock andrewlock force-pushed the andrew/update-vendors-8 branch from c448c23 to ed790e1 Compare April 21, 2026 10:19
@andrewlock andrewlock force-pushed the andrew/update-vendors-7 branch from 528b407 to 112589a Compare April 23, 2026 09:27
Base automatically changed from andrew/update-vendors-7 to master April 23, 2026 11:08
@andrewlock andrewlock force-pushed the andrew/update-vendors-8 branch from ed790e1 to 0688bae Compare April 23, 2026 12:14
Copy link
Copy Markdown
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

LGTM

I didn't understand why Aliases="DatadogTrace" was added and asked the LLM to explain and I pasted its response in the other comment, unsure if important or not TBH

<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.0" />
<ProjectReference Include="..\..\..\..\src\Datadog.Trace\Datadog.Trace.csproj" />
<ProjectReference Include="..\..\..\..\src\Datadog.Trace\Datadog.Trace.csproj" Aliases="DatadogTrace" />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the Aliases="DatadogTrace" for?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

CLAUDE

 tracer/build/_build/UpdateVendors/VendoredDependency.cs
Line: 1027

The internalization regex on this line doesn't match public readonly ref partial struct, so the vendored System.Memory refresh leaves the following types public in namespace System inside Datadog.Trace.dll:

  • tracer/src/Datadog.Trace/Vendors/System.Memory/System/Span.cs:34
  • tracer/src/Datadog.Trace/Vendors/System.Memory/System/Span.Portable.cs:35
  • tracer/src/Datadog.Trace/Vendors/System.Memory/System/ReadOnlySpan.cs:34
  • tracer/src/Datadog.Trace/Vendors/System.Memory/System/ReadOnlySpan.Portable.cs:33

That's what forced the Aliases="DatadogTrace" workaround in CallTargetNativeTest.csproj and the ~30 extern alias DatadogTrace; additions in commit ed790e1838 - Datadog.Trace.dll is now exporting System.Span<T> / System.ReadOnlySpan<T>, which collides with System.Memory 4.5.5 in any consumer that references both without aliases.

Fix: extend this regex to also match partial between ref and struct. For example, change the readonly\s+(ref\s+)?struct alternative to readonly\s+(ref\s+)?(partial\s+)?struct. Then regenerate the vendored files - the four Span types above should become internal. Once they're internal, the Aliases="DatadogTrace" entry in CallTargetNativeTest.csproj and the extern alias directives added in ed790e1838 can be reverted.

Why not just move them out of namespace System: per the comment you added in a18fa35156, the System namespace placement is load-bearing - the C# compiler looks up System.Span<T> by name to light up stackalloc, fixed, slicing, pattern-foreach, etc. Renaming the namespace would break that inside Datadog.Trace.dll on .NET Framework 4.6.1.

Why internal is fine: compiler light-up keys on the type's name and shape, not its accessibility. internal System.Span<T> inside Datadog.Trace.dll produces identical codegen to public System.Span<T> for everything inside that assembly; it just stops leaking the type to downstream consumers - which is the behavior every other vendored type in this repo already has.

Customer impact is low (the manual API ships from Datadog.Trace.Manual.dll, not this assembly), so this doesn't have to block the merge, but worth a follow-up PR before the extern-alias workaround gets copied into more places.****

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Claude is talking nonsense

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We have [InternalsVisibleTo] set to include this project, so the "fix" wouldn't fix anything 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's right about the root cause though - you get a collision between the System.Span<T> in Datadog.Trace and the System.Span<T> in System.Memory. Unfortunately, this is the only reasonable way to work around the issue. Technically we could remove the System.Memory reference entirely, but I'd rather we kept the "real" references for correctness reasons. Using the extern alias approach means the types aren't automatically available in the namespaces (they aren't in global namespace, they go in the DatadogTrace namespace). I have a post about it here 🙂 https://andrewlock.net/disambiguating-types-with-the-same-name-with-extern-alias/

@andrewlock andrewlock merged commit b44e705 into master Apr 24, 2026
142 checks passed
@andrewlock andrewlock deleted the andrew/update-vendors-8 branch April 24, 2026 07:01
@github-actions github-actions Bot added this to the vNext-v3 milestone Apr 24, 2026
andrewlock added a commit that referenced this pull request Apr 24, 2026
## Summary of changes

Remove some branching code that's no longer required after #8476 moved
`Span<T>` to `System` namespace

## Reason for change

This sort of stuff is the _reason_ we made that change, to reduce
maintenance.

## Implementation details

Set 🤖 looking for possible cases, so it's not exhaustive, but gives a
taster. I think most of these make sense. It's nothing outstanding but
it's the little things.

## Test coverage

Just a refactoring, so covered by existing tests.

## Other details

By definition, we don't really expect to see performance improvements
for this, other than potentially some reduced allocation in .NET
Framework. The primary benefits are devx

Depends on the vendoring code stack:


Depends on a stack updating our vendored system code

- #8391
- #8454
- #8455
- #8459
- #8461
- #8469
- #8476

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
andrewlock added a commit that referenced this pull request Apr 24, 2026
#8486)

## Summary of changes

Update the tag list generator to always use `ReadOnlySpan<byte>`
properties instead of `byte[]`

## Reason for change

After moving our vendored `Span<T>` implementation into the `System`
namespace, various optimizations open up to us, including using
`ReadOnlySpan<byte>` properties on .NET Framework instead of `static
readonly byte[]` to avoid startup costs.

## Implementation details

Replace the code generated by the generator, and update the generated
code

## Test coverage

Covered by snapshot tests and behaviour is covered by existing tests.
We'll check the benchmarks to make sure that we _don't_ see any perf
impact (there shouldn't be, impact should just be reduced startup costs)

## Other details

Depends on a stack updating our vendored system code

- #8391
- #8454
- #8455
- #8459
- #8461
- #8469
- #8476
- #8477
andrewlock added a commit that referenced this pull request Apr 27, 2026
… string literals (#8487)

## Summary of changes

Convert `Encoding.Utf8.GetBytes` calls to static constants using UTF8
string literals

## Reason for change

After moving our vendored `Span<T>` implementation into the `System`
namespace, various optimizations open up to us, including using UTF-8
string literals, to encode strings to UTF-8 at compile time instead of
at runtime. By combing with `static ReadOnlySpan<byte>` properties,
these also become zero allocation, so we get reduced overall memory
usage as well as better startup time

## Implementation details

Replace the following with utf8 string literals:
- `StringEncoding.UTF8.GetBytes`
- `Encoding.UTF8.GetBytes`
- `EncodingHelpers.UTF8NoBom.GetBytes`

## Test coverage

All covered by existing tests

## Other details

Depends on a stack updating our vendored system code

- #8391
- #8454
- #8455
- #8459
- #8461
- #8469
- #8476
- #8477
- #8486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:vendors Code from other vendors type:performance Performance, speed, latency, resource usage (CPU, memory)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants