Skip to content

Conversation

@andrewlock
Copy link
Member

@andrewlock andrewlock commented Oct 28, 2025

Summary of changes

Add a helper for comparing ReadOnlyDictionary<> instances

Reason for change

As part of the config work, we need to detect if tags have changed when customers do a manual/remote config update. This helper makes it easy

Implementation details

Added a SequenceEqual extension method.

Note that I used SequenceEqual because it already exists in System.Linq, but I could see an argument that it's too easy to use the wrong one, and instead we could use a different name? IsSameAs(other)?

Also, I only wrote this for ReadOnlyDictionary<> because that's all we need, it's what we use for all our setting dictionaries, and it will be (a tiny bit) faster than making it IDictionary<>, but happy to change if people feel strongly.

Test coverage

Added unit tests

Other details

https://datadoghq.atlassian.net/browse/LANGPLAT-819

Part of a config stack

@pr-commenter
Copy link

pr-commenter bot commented Oct 28, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7722 compared to master:

  • 1 benchmarks are faster, with geometric mean 2.829
  • 1 benchmarks are slower, with geometric mean 1.145
  • 13 benchmarks have fewer allocations
  • 3 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7722

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.1 KB 6.14 KB 46 B 0.75%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.4μs 58.6ns 397ns 0 0 0 5.53 KB
master StartStopWithChild netcoreapp3.1 14.4μs 65.8ns 255ns 0 0 0 5.7 KB
master StartStopWithChild net472 22μs 55.5ns 200ns 0.888 0.222 0 6.1 KB
#7722 StartStopWithChild net6.0 10.4μs 58.9ns 391ns 0 0 0 5.51 KB
#7722 StartStopWithChild netcoreapp3.1 13.4μs 70.4ns 366ns 0 0 0 5.72 KB
#7722 StartStopWithChild net472 22.3μs 124ns 731ns 0.966 0.29 0 6.14 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7722

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.35 KB 3.31 KB -46 B -1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 947μs 302ns 1.17μs 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 61.3ns 212ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.2ms 238ns 890ns 0 0 0 3.35 KB
#7722 WriteAndFlushEnrichedTraces net6.0 939μs 118ns 426ns 0 0 0 2.71 KB
#7722 WriteAndFlushEnrichedTraces netcoreapp3.1 1.05ms 314ns 1.22μs 0 0 0 2.7 KB
#7722 WriteAndFlushEnrichedTraces net472 1.21ms 453ns 1.76μs 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Unknown 🤷 Fewer allocations 🎉

Fewer allocations 🎉 in #7722

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net6.0 1.22 KB 0 b -1.22 KB -100.00%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑netcoreapp3.1 1.2 KB 0 b -1.2 KB -100.00%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net472 1.23 KB 0 b -1.23 KB -100.00%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net6.0 4.72 KB 0 b -4.72 KB -100.00%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑netcoreapp3.1 4.62 KB 0 b -4.62 KB -100.00%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 4.74 KB 0 b -4.74 KB -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.08μs 5.97ns 38.2ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.43μs 6.95ns 28.6ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.07μs 0.276ns 1.03ns 0.192 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.15μs 35.3ns 162ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 8.97μs 2.02ns 7.3ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.69μs 3.92ns 15.2ns 0.73 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 316ns 1.76ns 11.4ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 399ns 1.42ns 5.51ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 297ns 0.0403ns 0.151ns 0.0433 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.24μs 27.9ns 108ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.88μs 27.1ns 105ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.63μs 1.48ns 5.75ns 0.597 0 0 3.8 KB
#7722 AllCycleSimpleBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7722 AllCycleSimpleBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7722 AllCycleSimpleBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7722 AllCycleMoreComplexBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7722 AllCycleMoreComplexBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7722 AllCycleMoreComplexBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7722 ObjectExtractorSimpleBody net6.0 325ns 0.0859ns 0.333ns 0 0 0 280 B
#7722 ObjectExtractorSimpleBody netcoreapp3.1 398ns 2.24ns 15.3ns 0 0 0 272 B
#7722 ObjectExtractorSimpleBody net472 296ns 0.0164ns 0.0614ns 0.0434 0 0 281 B
#7722 ObjectExtractorMoreComplexBody net6.0 6.27μs 31.2ns 132ns 0 0 0 3.78 KB
#7722 ObjectExtractorMoreComplexBody netcoreapp3.1 7.87μs 34.6ns 134ns 0 0 0 3.69 KB
#7722 ObjectExtractorMoreComplexBody net472 6.69μs 1.2ns 4.15ns 0.601 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 77.1μs 39.9ns 149ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 98μs 295ns 1.14μs 0 0 0 32.4 KB
master EncodeArgs net472 112μs 24.3ns 94ns 5.07 0 0 32.51 KB
master EncodeLegacyArgs net6.0 142μs 63.9ns 248ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 199μs 593ns 2.3μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 263μs 60.8ns 235ns 0 0 0 2.16 KB
#7722 EncodeArgs net6.0 76.3μs 297ns 1.15μs 0 0 0 32.4 KB
#7722 EncodeArgs netcoreapp3.1 97.7μs 206ns 796ns 0 0 0 32.4 KB
#7722 EncodeArgs net472 114μs 60.5ns 234ns 5.13 0 0 32.51 KB
#7722 EncodeLegacyArgs net6.0 143μs 172ns 667ns 0 0 0 2.15 KB
#7722 EncodeLegacyArgs netcoreapp3.1 196μs 180ns 696ns 0 0 0 2.14 KB
#7722 EncodeLegacyArgs net472 262μs 18.5ns 64.2ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 390μs 68.5ns 247ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 847μs 3.96μs 15.3μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 428μs 66.1ns 256ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 290μs 168ns 652ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 297μs 139ns 501ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 308μs 43.4ns 168ns 0 0 0 2.29 KB
#7722 RunWafRealisticBenchmark net6.0 392μs 46.5ns 180ns 0 0 0 4.55 KB
#7722 RunWafRealisticBenchmark netcoreapp3.1 860μs 2.54μs 9.83μs 0 0 0 4.48 KB
#7722 RunWafRealisticBenchmark net472 427μs 54.1ns 210ns 0 0 0 4.66 KB
#7722 RunWafRealisticBenchmarkWithAttack net6.0 287μs 88.6ns 343ns 0 0 0 2.24 KB
#7722 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 298μs 441ns 1.53μs 0 0 0 2.22 KB
#7722 RunWafRealisticBenchmarkWithAttack net472 314μs 37.3ns 144ns 0 0 0 2.29 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 61.8μs 40.7ns 147ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 72.5μs 133ns 461ns 0 0 0 17.42 KB
master SendRequest net472 0.00254ns 0.00127ns 0.00492ns 0 0 0 0 b
#7722 SendRequest net6.0 62.6μs 52.4ns 203ns 0 0 0 14.52 KB
#7722 SendRequest netcoreapp3.1 72.2μs 86.1ns 333ns 0 0 0 17.42 KB
#7722 SendRequest net472 0.00186ns 0.00125ns 0.00466ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7722

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 7 B 4 B -3 B -42.86%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 4 B 2 B -2 B -50.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.89ms 6.5μs 25.2μs 0 0 0 640 KB
master OriginalCharSlice netcoreapp3.1 2.15ms 8.71μs 33.7μs 0 0 0 640 KB
master OriginalCharSlice net472 2.64ms 145ns 541ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.45ms 93.1ns 348ns 0 0 0 7 B
master OptimizedCharSlice netcoreapp3.1 1.8ms 238ns 921ns 0 0 0 1 B
master OptimizedCharSlice net472 1.95ms 459ns 1.78μs 0 0 0 73 B
master OptimizedCharSliceWithPool net6.0 851μs 77ns 298ns 0 0 0 4 B
master OptimizedCharSliceWithPool netcoreapp3.1 798μs 85.8ns 332ns 0 0 0 0 b
master OptimizedCharSliceWithPool net472 1.14ms 106ns 409ns 0 0 0 47 B
#7722 OriginalCharSlice net6.0 1.93ms 1.88μs 7.02μs 0 0 0 640 KB
#7722 OriginalCharSlice netcoreapp3.1 2.11ms 3.78μs 13.6μs 0 0 0 640 KB
#7722 OriginalCharSlice net472 2.73ms 382ns 1.38μs 100 0 0 641.95 KB
#7722 OptimizedCharSlice net6.0 1.33ms 452ns 1.75μs 0 0 0 4 B
#7722 OptimizedCharSlice netcoreapp3.1 1.66ms 395ns 1.48μs 0 0 0 1 B
#7722 OptimizedCharSlice net472 1.98ms 310ns 1.2μs 0 0 0 73 B
#7722 OptimizedCharSliceWithPool net6.0 858μs 11.8ns 45.8ns 0 0 0 2 B
#7722 OptimizedCharSliceWithPool netcoreapp3.1 827μs 56ns 210ns 0 0 0 0 b
#7722 OptimizedCharSliceWithPool net472 1.14ms 120ns 466ns 0 0 0 47 B
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7722

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 1.145 672,639.80 770,182.23

More allocations ⚠️ in #7722

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 55.95 KB 56.7 KB 750 B 1.34%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 671μs 1.99μs 7.69μs 0 0 0 41.74 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 735μs 942ns 3.4μs 0 0 0 42.01 KB
master WriteAndFlushEnrichedTraces net472 898μs 4.33μs 16.8μs 8.33 0 0 55.95 KB
#7722 WriteAndFlushEnrichedTraces net6.0 772μs 1.21μs 4.68μs 0 0 0 41.62 KB
#7722 WriteAndFlushEnrichedTraces netcoreapp3.1 714μs 3.7μs 17μs 0 0 0 41.88 KB
#7722 WriteAndFlushEnrichedTraces net472 902μs 4.81μs 25μs 8.33 0 0 56.7 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.92μs 9.95ns 45.6ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.62μs 12.5ns 48.3ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.9μs 5.92ns 22.9ns 0.146 0.0146 0 987 B
#7722 ExecuteNonQuery net6.0 1.89μs 0.61ns 2.11ns 0 0 0 1.02 KB
#7722 ExecuteNonQuery netcoreapp3.1 2.74μs 11.7ns 45.1ns 0 0 0 1.02 KB
#7722 ExecuteNonQuery net472 2.82μs 3.19ns 11.9ns 0.155 0.0141 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.66μs 8.56ns 40.2ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.21μs 8.77ns 34ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.58μs 2.11ns 7.9ns 0.161 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.84μs 7.13ns 27.6ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.39μs 11.7ns 48.4ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.66μs 3.58ns 12.9ns 0.165 0 0 1.1 KB
#7722 CallElasticsearch net6.0 1.75μs 8.15ns 32.6ns 0 0 0 1.03 KB
#7722 CallElasticsearch netcoreapp3.1 2.23μs 3.55ns 13.8ns 0 0 0 1.03 KB
#7722 CallElasticsearch net472 3.6μs 2.73ns 9.84ns 0.162 0 0 1.04 KB
#7722 CallElasticsearchAsync net6.0 1.86μs 3.19ns 12.4ns 0 0 0 1.01 KB
#7722 CallElasticsearchAsync netcoreapp3.1 2.4μs 8.4ns 32.5ns 0 0 0 1.08 KB
#7722 CallElasticsearchAsync net472 3.66μs 1.56ns 6.05ns 0.164 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.88μs 8.7ns 34.8ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.45μs 8.02ns 31.1ns 0 0 0 952 B
master ExecuteAsync net472 2.57μs 4.84ns 18.7ns 0.14 0 0 915 B
#7722 ExecuteAsync net6.0 1.92μs 8.92ns 35.7ns 0 0 0 952 B
#7722 ExecuteAsync netcoreapp3.1 2.51μs 7.82ns 29.2ns 0 0 0 952 B
#7722 ExecuteAsync net472 2.64μs 2.46ns 9.21ns 0.133 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 7.12μs 26.2ns 97.9ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.49μs 7.15ns 27.7ns 0 0 0 2.9 KB
master SendAsync net472 12.6μs 16.7ns 64.7ns 0.505 0 0 3.18 KB
#7722 SendAsync net6.0 6.79μs 7.36ns 26.5ns 0 0 0 2.36 KB
#7722 SendAsync netcoreapp3.1 8.78μs 21.6ns 83.8ns 0 0 0 2.9 KB
#7722 SendAsync net472 12.4μs 9.53ns 36.9ns 0.497 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7722

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 2.829 1,399,850.00 494,850.00

More allocations ⚠️ in #7722

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 278.05 KB 281.35 KB 3.3 KB 1.19%

Fewer allocations 🎉 in #7722

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 43.15 KB 42.71 KB -440 B -1.02%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 286.74 KB 275.23 KB -11.5 KB -4.01%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 46.48 KB 43.82 KB -2.66 KB -5.73%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 338.03 KB 256.69 KB -81.34 KB -24.06%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 46.1μs 262ns 2μs 0 0 0 46.48 KB
master StringConcatBenchmark netcoreapp3.1 57.5μs 921ns 9.16μs 0 0 0 43.15 KB
master StringConcatBenchmark net472 56.7μs 248ns 961ns 0 0 0 65.54 KB
master StringConcatAspectBenchmark net6.0 472μs 2.36μs 10.6μs 0 0 0 286.74 KB
master StringConcatAspectBenchmark netcoreapp3.1 1.4ms 2.45μs 9.49μs 0 0 0 338.03 KB
master StringConcatAspectBenchmark net472 409μs 2.28μs 13.9μs 0 0 0 278.05 KB
#7722 StringConcatBenchmark net6.0 42.2μs 212ns 1.23μs 0 0 0 43.82 KB
#7722 StringConcatBenchmark netcoreapp3.1 48μs 277ns 2.09μs 0 0 0 42.71 KB
#7722 StringConcatBenchmark net472 57.8μs 127ns 459ns 0 0 0 65.54 KB
#7722 StringConcatAspectBenchmark net6.0 480μs 754ns 2.61μs 0 0 0 275.23 KB
#7722 StringConcatAspectBenchmark netcoreapp3.1 498μs 2.3μs 8.59μs 0 0 0 256.69 KB
#7722 StringConcatAspectBenchmark net472 413μs 2.33μs 16μs 0 0 0 281.35 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.6μs 0.902ns 3.49ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.66μs 17.7ns 77.3ns 0 0 0 1.7 KB
master EnrichedLog net472 4μs 4.97ns 19.3ns 0.259 0 0 1.64 KB
#7722 EnrichedLog net6.0 2.66μs 13.6ns 62.5ns 0 0 0 1.7 KB
#7722 EnrichedLog netcoreapp3.1 3.63μs 17.3ns 69.2ns 0 0 0 1.7 KB
#7722 EnrichedLog net472 3.84μs 2.83ns 10.9ns 0.249 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 122μs 87.6ns 339ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 126μs 109ns 393ns 0 0 0 4.31 KB
master EnrichedLog net472 169μs 149ns 578ns 0 0 0 4.52 KB
#7722 EnrichedLog net6.0 122μs 30.4ns 118ns 0 0 0 4.31 KB
#7722 EnrichedLog netcoreapp3.1 129μs 124ns 481ns 0 0 0 4.31 KB
#7722 EnrichedLog net472 167μs 225ns 843ns 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 5.06μs 2.03ns 7.85ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.78μs 13.1ns 50.9ns 0 0 0 2.26 KB
master EnrichedLog net472 7.54μs 9.05ns 35.1ns 0.3 0 0 2.08 KB
#7722 EnrichedLog net6.0 5μs 17.2ns 62.1ns 0 0 0 2.26 KB
#7722 EnrichedLog netcoreapp3.1 7.02μs 8.73ns 33.8ns 0 0 0 2.26 KB
#7722 EnrichedLog net472 7.54μs 4.57ns 16.5ns 0.304 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 2.11μs 2.19ns 8.48ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.59μs 12.5ns 54.4ns 0 0 0 1.2 KB
master SendReceive net472 3.05μs 3.87ns 14.5ns 0.184 0 0 1.2 KB
#7722 SendReceive net6.0 2.02μs 0.932ns 3.49ns 0 0 0 1.2 KB
#7722 SendReceive netcoreapp3.1 2.66μs 12.7ns 50.7ns 0 0 0 1.2 KB
#7722 SendReceive net472 3.25μs 3.97ns 15.4ns 0.179 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.37μs 10.3ns 40ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.89μs 16.4ns 63.4ns 0 0 0 1.63 KB
master EnrichedLog net472 6.7μs 7.75ns 30ns 0.301 0 0 2.03 KB
#7722 EnrichedLog net6.0 4.29μs 3.62ns 14ns 0 0 0 1.58 KB
#7722 EnrichedLog netcoreapp3.1 5.67μs 12.6ns 48.6ns 0 0 0 1.63 KB
#7722 EnrichedLog net472 6.54μs 6.88ns 26.6ns 0.293 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 778ns 3.63ns 14.5ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 953ns 5.08ns 27.8ns 0 0 0 576 B
master StartFinishSpan net472 926ns 0.447ns 1.73ns 0.0878 0 0 578 B
master StartFinishScope net6.0 916ns 4.88ns 23.4ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.25μs 5.97ns 23.1ns 0 0 0 696 B
master StartFinishScope net472 1.11μs 0.851ns 3.29ns 0.0997 0 0 658 B
#7722 StartFinishSpan net6.0 789ns 1.41ns 5.29ns 0 0 0 576 B
#7722 StartFinishSpan netcoreapp3.1 975ns 4.7ns 18.8ns 0 0 0 576 B
#7722 StartFinishSpan net472 953ns 0.426ns 1.59ns 0.0907 0 0 578 B
#7722 StartFinishScope net6.0 925ns 2.5ns 9.69ns 0 0 0 696 B
#7722 StartFinishScope netcoreapp3.1 1.2μs 5.01ns 19.4ns 0 0 0 696 B
#7722 StartFinishScope net472 1.16μs 3.34ns 12.9ns 0.0989 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.08μs 0.281ns 1.05ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.43μs 7.02ns 28.1ns 0 0 0 696 B
master RunOnMethodBegin net472 1.49μs 0.588ns 2.2ns 0.104 0 0 658 B
#7722 RunOnMethodBegin net6.0 1.1μs 5.3ns 21.8ns 0 0 0 696 B
#7722 RunOnMethodBegin netcoreapp3.1 1.41μs 6.28ns 24.3ns 0 0 0 696 B
#7722 RunOnMethodBegin net472 1.43μs 2.13ns 7.66ns 0.101 0 0 658 B

@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Oct 28, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

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 shown 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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7722) - mean (72ms)  : 70, 73
     .   : milestone, 72,
    master - mean (72ms)  : 71, 73
     .   : milestone, 72,

    section Baseline
    This PR (7722) - mean (68ms)  : 66, 70
     .   : milestone, 68,
    master - mean (68ms)  : 67, 70
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (7722) - mean (1,102ms)  : 969, 1235
     .   : milestone, 1102,
    master - mean (1,046ms)  : 1004, 1087
     .   : milestone, 1046,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7722) - mean (107ms)  : 104, 110
     .   : milestone, 107,
    master - mean (107ms)  : 105, 109
     .   : milestone, 107,

    section Baseline
    This PR (7722) - mean (109ms)  : 106, 112
     .   : milestone, 109,
    master - mean (106ms)  : 104, 108
     .   : milestone, 106,

    section CallTarget+Inlining+NGEN
    This PR (7722) - mean (749ms)  : 713, 785
     .   : milestone, 749,
    master - mean (748ms)  : 725, 771
     .   : milestone, 748,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7722) - mean (94ms)  : 93, 95
     .   : milestone, 94,
    master - mean (95ms)  : 93, 96
     .   : milestone, 95,

    section Baseline
    This PR (7722) - mean (94ms)  : 92, 96
     .   : milestone, 94,
    master - mean (94ms)  : 92, 96
     .   : milestone, 94,

    section CallTarget+Inlining+NGEN
    This PR (7722) - mean (703ms)  : 670, 737
     .   : milestone, 703,
    master - mean (708ms)  : 679, 738
     .   : milestone, 708,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7722) - mean (93ms)  : 91, 94
     .   : milestone, 93,
    master - mean (93ms)  : 92, 94
     .   : milestone, 93,

    section Baseline
    This PR (7722) - mean (92ms)  : 89, 94
     .   : milestone, 92,
    master - mean (92ms)  : 90, 95
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (7722) - mean (657ms)  : 642, 672
     .   : milestone, 657,
    master - mean (666ms)  : 652, 680
     .   : milestone, 666,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7722) - mean (208ms)  : crit, 189, 227
     .   : crit, milestone, 208,
    master - mean (195ms)  : 192, 198
     .   : milestone, 195,

    section Baseline
    This PR (7722) - mean (192ms)  : 188, 196
     .   : milestone, 192,
    master - mean (191ms)  : 188, 195
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (7722) - mean (1,197ms)  : 1080, 1314
     .   : milestone, 1197,
    master - mean (1,158ms)  : 1098, 1218
     .   : milestone, 1158,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7722) - mean (275ms)  : 271, 279
     .   : milestone, 275,
    master - mean (277ms)  : 272, 282
     .   : milestone, 277,

    section Baseline
    This PR (7722) - mean (275ms)  : 270, 280
     .   : milestone, 275,
    master - mean (276ms)  : 268, 283
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (7722) - mean (935ms)  : 896, 974
     .   : milestone, 935,
    master - mean (954ms)  : 906, 1002
     .   : milestone, 954,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7722) - mean (267ms)  : 263, 272
     .   : milestone, 267,
    master - mean (268ms)  : 265, 271
     .   : milestone, 268,

    section Baseline
    This PR (7722) - mean (266ms)  : 262, 270
     .   : milestone, 266,
    master - mean (268ms)  : 262, 273
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (7722) - mean (917ms)  : 870, 965
     .   : milestone, 917,
    master - mean (936ms)  : 881, 991
     .   : milestone, 936,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7722) - mean (285ms)  : crit, 280, 289
     .   : crit, milestone, 285,
    master - mean (267ms)  : 264, 270
     .   : milestone, 267,

    section Baseline
    This PR (7722) - mean (265ms)  : 262, 269
     .   : milestone, 265,
    master - mean (267ms)  : 263, 271
     .   : milestone, 267,

    section CallTarget+Inlining+NGEN
    This PR (7722) - mean (895ms)  : 845, 944
     .   : milestone, 895,
    master - mean (850ms)  : 835, 866
     .   : milestone, 850,

Loading

@andrewlock andrewlock force-pushed the andrew/settings/4b-helper branch from 1ed4e84 to 1477479 Compare October 28, 2025 15:20
@andrewlock andrewlock requested a review from a team as a code owner October 28, 2025 15:20
@andrewlock andrewlock force-pushed the andrew/settings/4b-helper branch from 1477479 to e27c515 Compare October 28, 2025 18:13
@andrewlock andrewlock requested review from a team as code owners October 28, 2025 18:13
@andrewlock andrewlock requested review from link04 and removed request for a team October 28, 2025 18:13
@andrewlock andrewlock force-pushed the andrew/settings/4a-block-uds-windows branch from 4421414 to 213ef9c Compare October 28, 2025 18:13
@datadog-datadog-prod-us1

This comment has been minimized.

@lucaspimentel lucaspimentel requested a review from a team October 29, 2025 15:31
andrewlock added a commit that referenced this pull request Oct 31, 2025
…ndows (#7721)

## Summary of changes

Enforces that you can't _change_ the `AgentUri` to be a UDS Uri if
you're on Windows

## Reason for change

The trace exporter doesn't work with UDS on Windows, so we have a check
in `TracerSettings` that disables the pipeline if we find this scenario.
However, user's can still _change_ the agent URI at runtime in code (😭).

We currently assume that the data pipeline won't be toggled at runtime
(we _do_ allow for reconfiguring it in general, but not for completely
removing or reintroducing). Changing this to allow the scenario would be
a pain, so instead this PR blocks you from setting a UDS URI in code if
you're on Windows.

The good news is that as far as I can tell, noone does this today, so
while _technically_ it could be considered a breaking change, I think
it's ok.

## Implementation details

- Throw an `ArgumentException` in the Datadog.Trace.Manual library, if
you're on Windows (or .NET FX) and you try to set a UDS agent URI (using
the same "detection" we do in `ExporterSettings`.
- Add a check in the Instrumentation of `Tracer.Configure()` to make
sure it hasn't slipped through. This could happen if a customer was
using an old version of the Datadog.Trace NuGet package with a newer
version of auto instrumentation.

Note that this adds two additional framework references for .NET Core
3.1+, to check if we're on Windows.

## Test coverage

Added an extra step to the manual instrumentation integration test to
confirm we throw

## Other details

https://datadoghq.atlassian.net/browse/LANGPLAT-819

Part of a config stack

- #7522
- #7525
- #7530
- #7532
- #7543
- #7544
- #7721 👈
- #7722
- #7695
- #7723
- #7724
Base automatically changed from andrew/settings/4a-block-uds-windows to master October 31, 2025 17:05
@andrewlock andrewlock force-pushed the andrew/settings/4b-helper branch from e27c515 to 41ce09f Compare October 31, 2025 18:04
Copy link
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.

Per naming I think SequenceEqual is a bit strange for dictionary, but I think it is fine

@andrewlock andrewlock enabled auto-merge (squash) November 3, 2025 13:23
Comment on lines +140 to +141
this ReadOnlyDictionary<string, string> dict1,
ReadOnlyDictionary<string, string> dict2,
Copy link
Member

Choose a reason for hiding this comment

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

any reason to not doing it in a Generic way?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right now, mostly because it's unnecessary, so extra abstraction doesn't seem worth it 🤷‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, auto merge just went ahead with it 😓

@andrewlock andrewlock merged commit 392fea4 into master Nov 3, 2025
151 checks passed
@andrewlock andrewlock deleted the andrew/settings/4b-helper branch November 3, 2025 14:40
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants