Stop vendoring resx for vendored microsoft code#8461
Conversation
BenchmarksBenchmark execution time: 2026-04-23 08:26:24 Comparing candidate commit 481fbc2 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 60 known flaky benchmarks, 27 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8461) 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 (8461) - mean (74ms) : 70, 78
master - mean (73ms) : 69, 77
section Bailout
This PR (8461) - mean (79ms) : 75, 84
master - mean (78ms) : 74, 83
section CallTarget+Inlining+NGEN
This PR (8461) - mean (1,079ms) : 1021, 1138
master - mean (1,084ms) : 1011, 1157
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 (8461) - mean (117ms) : 110, 124
master - mean (114ms) : 110, 119
section Bailout
This PR (8461) - mean (116ms) : 110, 121
master - mean (120ms) : 113, 126
section CallTarget+Inlining+NGEN
This PR (8461) - mean (775ms) : 747, 803
master - mean (776ms) : 749, 802
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8461) - mean (103ms) : 97, 108
master - mean (104ms) : 98, 109
section Bailout
This PR (8461) - mean (103ms) : 99, 107
master - mean (102ms) : 98, 106
section CallTarget+Inlining+NGEN
This PR (8461) - mean (937ms) : 902, 972
master - mean (939ms) : 900, 979
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8461) - mean (99ms) : 96, 102
master - mean (100ms) : 96, 104
section Bailout
This PR (8461) - mean (104ms) : 97, 110
master - mean (105ms) : 100, 110
section CallTarget+Inlining+NGEN
This PR (8461) - mean (822ms) : 776, 869
master - mean (825ms) : 775, 875
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 (8461) - mean (200ms) : 194, 206
master - mean (200ms) : 191, 209
section Bailout
This PR (8461) - mean (203ms) : 199, 208
master - mean (203ms) : 195, 212
section CallTarget+Inlining+NGEN
This PR (8461) - mean (1,193ms) : 1123, 1262
master - mean (1,187ms) : 1133, 1241
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 (8461) - mean (287ms) : 275, 299
master - mean (287ms) : 275, 299
section Bailout
This PR (8461) - mean (288ms) : 280, 295
master - mean (290ms) : 277, 302
section CallTarget+Inlining+NGEN
This PR (8461) - mean (942ms) : 911, 974
master - mean (952ms) : 918, 985
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8461) - mean (280ms) : 269, 290
master - mean (282ms) : 270, 294
section Bailout
This PR (8461) - mean (279ms) : 268, 291
master - mean (284ms) : 273, 295
section CallTarget+Inlining+NGEN
This PR (8461) - mean (1,141ms) : 1069, 1212
master - mean (1,141ms) : 1082, 1200
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8461) - mean (278ms) : 267, 290
master - mean (280ms) : 269, 291
section Bailout
This PR (8461) - mean (279ms) : 268, 290
master - mean (280ms) : 267, 293
section CallTarget+Inlining+NGEN
This PR (8461) - mean (1,034ms) : 990, 1078
master - mean (1,042ms) : 979, 1106
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7f66c52 to
3b42dd4
Compare
bdf65ae to
ef58938
Compare
3b42dd4 to
2e151f2
Compare
ef58938 to
7dc44a2
Compare
2e151f2 to
4cb40f3
Compare
7dc44a2 to
481fbc2
Compare
## 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
Stop vendoring the
SR+ regex files for microsoft codeReason for change
Using
ResourceManageris 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
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