Update vendored System.Reflection.Metadata#8455
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d76ae4cf88
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d76ae4c to
4820815
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8455) 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 (8455) - mean (72ms) : 69, 75
master - mean (71ms) : 69, 73
section Bailout
This PR (8455) - mean (76ms) : 75, 78
master - mean (76ms) : 73, 79
section CallTarget+Inlining+NGEN
This PR (8455) - mean (1,060ms) : 1015, 1105
master - mean (1,062ms) : 1019, 1105
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 (8455) - mean (112ms) : 109, 116
master - mean (112ms) : 109, 116
section Bailout
This PR (8455) - mean (114ms) : 112, 116
master - mean (114ms) : 112, 117
section CallTarget+Inlining+NGEN
This PR (8455) - mean (765ms) : 745, 785
master - mean (784ms) : 761, 807
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8455) - mean (100ms) : 95, 104
master - mean (100ms) : 96, 103
section Bailout
This PR (8455) - mean (101ms) : 98, 104
master - mean (100ms) : 97, 102
section CallTarget+Inlining+NGEN
This PR (8455) - mean (934ms) : 908, 960
master - mean (930ms) : 890, 971
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8455) - mean (99ms) : 97, 101
master - mean (98ms) : 94, 102
section Bailout
This PR (8455) - mean (100ms) : 97, 103
master - mean (99ms) : 96, 103
section CallTarget+Inlining+NGEN
This PR (8455) - mean (819ms) : 778, 860
master - mean (819ms) : 780, 859
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 (8455) - mean (211ms) : 206, 215
master - mean (206ms) : 201, 211
section Bailout
This PR (8455) - mean (215ms) : 210, 219
master - mean (210ms) : 206, 213
section CallTarget+Inlining+NGEN
This PR (8455) - mean (1,222ms) : 1178, 1266
master - mean (1,207ms) : 1169, 1246
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 (8455) - mean (305ms) : 297, 312
master - mean (297ms) : 289, 305
section Bailout
This PR (8455) - mean (306ms) : 300, 312
master - mean (299ms) : 293, 306
section CallTarget+Inlining+NGEN
This PR (8455) - mean (997ms) : 963, 1030
master - mean (1,002ms) : 964, 1040
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8455) - mean (298ms) : 292, 305
master - mean (292ms) : 286, 297
section Bailout
This PR (8455) - mean (299ms) : 294, 304
master - mean (293ms) : 288, 297
section CallTarget+Inlining+NGEN
This PR (8455) - mean (1,182ms) : 1153, 1211
master - mean (1,167ms) : 1124, 1210
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8455) - mean (297ms) : 292, 303
master - mean (289ms) : 283, 296
section Bailout
This PR (8455) - mean (298ms) : 292, 304
master - mean (290ms) : 284, 296
section CallTarget+Inlining+NGEN
This PR (8455) - mean (1,091ms) : 980, 1201
master - mean (1,067ms) : 971, 1162
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-04-22 15:58:06 Comparing candidate commit ac67d3f in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 26 metrics, 0 unstable metrics, 61 known flaky benchmarks, 26 flaky benchmarks without significant changes.
|
88354de to
a2f94ba
Compare
00c728d to
b4b5712
Compare
b4b5712 to
58b049c
Compare
9f055d8 to
fa2694a
Compare
fa2694a to
0257651
Compare
58b049c to
8947b73
Compare
0257651 to
1cd4ff9
Compare
8947b73 to
ac67d3f
Compare
## Summary of changes - Update the System.Memory based on NuGet package sources ## Reason for change We want to update our vendored .NET library versions. ## Implementation details - Make the vendoring repeatable - Run the tool, check for errors, tweak, rinse and repeat - After running the tool, used 🤖 to identify segments of code that weren't used, so we could strip them out The updated vendoring is based on the public [System.Memory](https://www.nuget.org/packages/System.Memory/4.6.3#dependencies-body-tab) 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 `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
## 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) <noreply@anthropic.com>
#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
Summary of changes
Reason for change
We want to update our vendored .NET library versions.
Implementation details
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
Part of a stack updating our vendored system code
Update vendored System.Collections.Immutable #8391
Use the built-in System.Reflection.Metadata types for .NET Core #8454