Update vendored System.Memory#8459
Conversation
BenchmarksBenchmark execution time: 2026-04-22 18:40:49 Comparing candidate commit 4cb40f3 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 61 known flaky benchmarks, 26 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8459) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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:
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 chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8459) - mean (73ms) : 71, 75
master - mean (73ms) : 71, 75
section Bailout
This PR (8459) - mean (77ms) : 75, 80
master - mean (78ms) : 75, 81
section CallTarget+Inlining+NGEN
This PR (8459) - mean (1,076ms) : 1032, 1121
master - mean (1,090ms) : 1015, 1165
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 (8459) - mean (115ms) : 109, 121
master - mean (115ms) : 112, 118
section Bailout
This PR (8459) - mean (118ms) : 111, 125
master - mean (119ms) : 113, 126
section CallTarget+Inlining+NGEN
This PR (8459) - mean (778ms) : 752, 804
master - mean (779ms) : 750, 808
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8459) - mean (101ms) : 97, 105
master - mean (104ms) : 97, 111
section Bailout
This PR (8459) - mean (106ms) : 101, 112
master - mean (104ms) : 98, 110
section CallTarget+Inlining+NGEN
This PR (8459) - mean (938ms) : 906, 970
master - mean (941ms) : 902, 980
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8459) - mean (101ms) : 96, 105
master - mean (101ms) : 98, 104
section Bailout
This PR (8459) - mean (101ms) : 99, 104
master - mean (105ms) : 99, 111
section CallTarget+Inlining+NGEN
This PR (8459) - mean (827ms) : 790, 864
master - mean (825ms) : 789, 862
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 (8459) - mean (211ms) : 194, 228
master - mean (207ms) : 197, 217
section Bailout
This PR (8459) - mean (214ms) : 199, 229
master - mean (212ms) : 204, 220
section CallTarget+Inlining+NGEN
This PR (8459) - mean (1,254ms) : 1186, 1322
master - mean (1,207ms) : 1152, 1261
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 (8459) - mean (307ms) : 278, 335
master - mean (297ms) : 282, 313
section Bailout
This PR (8459) - mean (307ms) : 279, 336
master - mean (300ms) : 285, 314
section CallTarget+Inlining+NGEN
This PR (8459) - mean (991ms) : 957, 1025
master - mean (979ms) : 945, 1013
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8459) - mean (294ms) : 277, 312
master - mean (295ms) : 282, 308
section Bailout
This PR (8459) - mean (295ms) : 276, 315
master - mean (297ms) : 284, 310
section CallTarget+Inlining+NGEN
This PR (8459) - mean (1,169ms) : 1124, 1214
master - mean (1,169ms) : 1121, 1217
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8459) - mean (293ms) : 279, 308
master - mean (289ms) : 273, 305
section Bailout
This PR (8459) - mean (292ms) : 278, 306
master - mean (289ms) : 273, 306
section CallTarget+Inlining+NGEN
This PR (8459) - mean (1,073ms) : 976, 1171
master - mean (1,064ms) : 981, 1147
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2cac866 to
7f66c52
Compare
00c728d to
b4b5712
Compare
b4b5712 to
58b049c
Compare
7f66c52 to
3b42dd4
Compare
58b049c to
8947b73
Compare
3b42dd4 to
2e151f2
Compare
8947b73 to
ac67d3f
Compare
2e151f2 to
4cb40f3
Compare
## Summary of changes Stop vendoring the `SR` + regex files for microsoft code ## Reason for change Using `ResourceManager` is overkill, as we don't deploy all the translations etc anyway, and don't want to. ## Implementation details Replaced all the `SR.` accesses in previous PRs, so this is now dead code that we can remove. ## Test coverage If it builds, we're good ## Other details https://datadoghq.atlassian.net/browse/APMLP-1207 Note that currently, there's a lot of `Utf8Formatter` code that _isn't_ used, and could be excluded, however, given that theoretically we could/should use this in the future. I'm torn whether to just leave it in, or whether to tear it out for now, and restore it if/when we want to use it later. Any thoughts? Part of a stack updating our vendored system code - #8391 - #8454 - #8455 - #8459
## Summary of changes - Create re-usable vendoring process for System.Runtime.CompilerServices.Unsafe - Update the vendored code (it's actually unchanged) ## Reason for change We want to be able to update vendored code as required. For the vendored [System.Runtime.CompilerServices.Unsafe package](https://nuget.info/packages/System.Runtime.CompilerServices.Unsafe/6.1.2), the [source code](https://github.com/dotnet/maintenance-packages/blob/14e29655e53aec37342e933bfd7ba574167453ff/src/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.il) is written directly as IL, and [compiled using Ilasm.exe](https://learn.microsoft.com/en-us/dotnet/framework/tools/ilasm-exe-il-assembler). So this PR introduces a simple "IL to C#" converter that converts that file to its C# equivalent, using the same `InlineIL.Fody` approach that we currently have. The final result produces a file that is _virtually_ identical to the existing one (which is good!). The only difference I made was to add the original IL line as a comment next to the Fody equivalent. This also shows that the code has not _actually_ changed (and it's unlikely it _will_ tbh), so this just means we have a repeatable self-contained approach to regenerate this in the repo as required. ## Implementation details Told 🤖 to make the IL to C# converter, and it did 😄 I've given the code it generated a once-over to look for anything terrible, but the key thing is that the _output_ is sane, and that's visibly basically unchanged, so I think it's fine. ## Test coverage @dudikeleti already wrote some extensive tests for the `Unsafe` implementation back when he originally ported it, which verifies that we can compile the methods, call them, and that the generated IL is identical to the "real" versions 🎉 ## Other details https://datadoghq.atlassian.net/browse/APMLP-1207 Part of a stack updating our vendored system code - #8391 - #8454 - #8455 - #8459 - #8461
#8476) ## 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 - #8391 - #8454 - #8455 - #8459 - #8461 - #8469
## 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) <[email protected]>
#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
… 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
Summary of changes
Reason for change
We want to update our vendored .NET library versions.
Implementation details
The updated vendoring is based on the public System.Memory nuget package, so is designed to be used with .NET Framework and .NET Standard, so makes the most sense to use IMO.
As this package also uses System.Buffers and System.Numerics.Vectors, vendored those pieces we need where appropriate.
Test coverage
This is the test, if it compiles and tests pass, we should be ok 🤞
Other details
https://datadoghq.atlassian.net/browse/APMLP-1207
Note that currently, there's a lot of
Utf8Formattercode that isn't used, and could be excluded, however, given that theoretically we could/should use this in the future. I'm torn whether to just leave it in, or whether to tear it out for now, and restore it if/when we want to use it later. Any thoughts?Part of a stack updating our vendored system code