Skip to content

Conversation

@andrewlock
Copy link
Member

@andrewlock andrewlock commented Nov 10, 2025

Summary of changes

Update tests to using using when creating mutexes

Reason for change

ManualResetEventSlim has native resources, so we should Dispose() them instead of waiting for the finalizer thread.

Implementation details

Use using statements everywhere

Test coverage

Covered by existing

Other details

Shouldn't make much difference, just tidying up, may improve test perf minutely

@andrewlock andrewlock added area:tests unit tests, integration tests type:cleanup Minor code clean up labels Nov 10, 2025
@andrewlock andrewlock requested review from a team as code owners November 10, 2025 13:47
@pr-commenter
Copy link

pr-commenter bot commented Nov 10, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7797 compared to master:

  • 1 benchmarks are slower, with geometric mean 2.437
  • 5 benchmarks have fewer allocations
  • 8 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 #7797

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.67 KB 5.77 KB 99 B 1.75%

Fewer allocations 🎉 in #7797

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.07 KB 6 KB -63 B -1.04%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 11.1μs 61.4ns 389ns 0 0 0 5.52 KB
master StartStopWithChild netcoreapp3.1 13.6μs 70.6ns 339ns 0 0 0 5.67 KB
master StartStopWithChild net472 22.6μs 128ns 914ns 1.06 0.319 0.106 6.07 KB
#7797 StartStopWithChild net6.0 10.5μs 59.2ns 431ns 0 0 0 5.51 KB
#7797 StartStopWithChild netcoreapp3.1 13.1μs 66.5ns 319ns 0 0 0 5.77 KB
#7797 StartStopWithChild net472 22.1μs 118ns 625ns 0.97 0.431 0.108 6 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7797

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 941μs 277ns 961ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 94.7ns 367ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.21ms 603ns 2.26μs 0 0 0 3.35 KB
#7797 WriteAndFlushEnrichedTraces net6.0 925μs 445ns 1.72μs 0 0 0 2.71 KB
#7797 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 826ns 2.86μs 0 0 0 2.7 KB
#7797 WriteAndFlushEnrichedTraces net472 1.22ms 1.54μs 5.97μs 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.09μs 5.65ns 27.1ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.45μs 7.9ns 46ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.03μs 0.667ns 2.41ns 0.192 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.01μs 34.1ns 145ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.05μs 46ns 200ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.69μs 4.72ns 16.4ns 0.731 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 324ns 1.8ns 11.1ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 391ns 2.21ns 14.3ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 301ns 0.108ns 0.405ns 0.044 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.27μs 32.1ns 151ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.88μs 35ns 136ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.74μs 3.45ns 13.3ns 0.573 0 0 3.8 KB
#7797 AllCycleSimpleBody net6.0 1.08μs 5.5ns 25.8ns 0 0 0 1.22 KB
#7797 AllCycleSimpleBody netcoreapp3.1 1.42μs 7.77ns 48.6ns 0 0 0 1.2 KB
#7797 AllCycleSimpleBody net472 1.02μs 0.711ns 2.75ns 0.195 0 0 1.23 KB
#7797 AllCycleMoreComplexBody net6.0 7.33μs 35.2ns 136ns 0 0 0 4.72 KB
#7797 AllCycleMoreComplexBody netcoreapp3.1 9.03μs 44.9ns 190ns 0 0 0 4.62 KB
#7797 AllCycleMoreComplexBody net472 7.77μs 5.31ns 20.6ns 0.733 0 0 4.74 KB
#7797 ObjectExtractorSimpleBody net6.0 316ns 1.76ns 10.3ns 0 0 0 280 B
#7797 ObjectExtractorSimpleBody netcoreapp3.1 402ns 2.27ns 14.1ns 0 0 0 272 B
#7797 ObjectExtractorSimpleBody net472 296ns 0.0587ns 0.227ns 0.0432 0 0 281 B
#7797 ObjectExtractorMoreComplexBody net6.0 6.35μs 1.29ns 5ns 0 0 0 3.78 KB
#7797 ObjectExtractorMoreComplexBody netcoreapp3.1 7.78μs 39.6ns 177ns 0 0 0 3.69 KB
#7797 ObjectExtractorMoreComplexBody net472 6.7μs 3.86ns 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 76.4μs 266ns 997ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 96.6μs 157ns 609ns 0 0 0 32.4 KB
master EncodeArgs net472 109μs 21.1ns 81.7ns 4.94 0 0 32.51 KB
master EncodeLegacyArgs net6.0 143μs 208ns 806ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 196μs 112ns 388ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 264μs 47.7ns 185ns 0 0 0 2.16 KB
#7797 EncodeArgs net6.0 76.2μs 266ns 994ns 0 0 0 32.4 KB
#7797 EncodeArgs netcoreapp3.1 97.9μs 240ns 930ns 0 0 0 32.4 KB
#7797 EncodeArgs net472 110μs 16.8ns 62.8ns 4.96 0 0 32.51 KB
#7797 EncodeLegacyArgs net6.0 140μs 28.2ns 109ns 0 0 0 2.15 KB
#7797 EncodeLegacyArgs netcoreapp3.1 198μs 47.2ns 177ns 0 0 0 2.14 KB
#7797 EncodeLegacyArgs net472 263μs 360ns 1.39μs 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7797

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.437 296,161.16 721,872.82

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 430μs 1.17μs 4.55μs 0 0 0 4.56 KB
master RunWafRealisticBenchmark netcoreapp3.1 411μs 169ns 609ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 457μs 48.3ns 187ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 309μs 74ns 277ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 296μs 109ns 421ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 335μs 40.7ns 158ns 0 0 0 2.29 KB
#7797 RunWafRealisticBenchmark net6.0 394μs 193ns 722ns 0 0 0 4.55 KB
#7797 RunWafRealisticBenchmark netcoreapp3.1 411μs 284ns 1.1μs 0 0 0 4.48 KB
#7797 RunWafRealisticBenchmark net472 434μs 90.2ns 337ns 0 0 0 4.66 KB
#7797 RunWafRealisticBenchmarkWithAttack net6.0 288μs 34.2ns 119ns 0 0 0 2.24 KB
#7797 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 709μs 7.37μs 73.4μs 0 0 0 2.22 KB
#7797 RunWafRealisticBenchmarkWithAttack net472 318μs 57.4ns 222ns 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 60.7μs 62.6ns 234ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71μs 118ns 440ns 0 0 0 17.42 KB
master SendRequest net472 0.00285ns 0.000927ns 0.00359ns 0 0 0 0 b
#7797 SendRequest net6.0 61.3μs 141ns 529ns 0 0 0 14.52 KB
#7797 SendRequest netcoreapp3.1 72.3μs 45.5ns 176ns 0 0 0 17.42 KB
#7797 SendRequest net472 0.00648ns 0.00228ns 0.00881ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7797

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 3 B 4 B 1 B 33.33%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 6 B 7 B 1 B 16.67%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 47 B 48 B 1 B 2.13%

Fewer allocations 🎉 in #7797

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 1 B 0 b -1 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.95ms 249ns 962ns 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.07ms 6.45μs 25μs 0 0 0 640 KB
master OriginalCharSlice net472 2.74ms 241ns 931ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.39ms 651ns 2.52μs 0 0 0 6 B
master OptimizedCharSlice netcoreapp3.1 1.64ms 381ns 1.47μs 0 0 0 1 B
master OptimizedCharSlice net472 1.97ms 248ns 960ns 0 0 0 73 B
master OptimizedCharSliceWithPool net6.0 800μs 31.8ns 123ns 0 0 0 3 B
master OptimizedCharSliceWithPool netcoreapp3.1 852μs 34.9ns 135ns 0 0 0 1 B
master OptimizedCharSliceWithPool net472 1.14ms 73ns 273ns 0 0 0 47 B
#7797 OriginalCharSlice net6.0 1.94ms 4.48μs 17.3μs 0 0 0 640 KB
#7797 OriginalCharSlice netcoreapp3.1 2.1ms 5.27μs 20.4μs 0 0 0 640 KB
#7797 OriginalCharSlice net472 2.65ms 160ns 579ns 100 0 0 641.95 KB
#7797 OptimizedCharSlice net6.0 1.51ms 453ns 1.76μs 0 0 0 7 B
#7797 OptimizedCharSlice netcoreapp3.1 1.69ms 336ns 1.3μs 0 0 0 1 B
#7797 OptimizedCharSlice net472 2.04ms 566ns 2.19μs 0 0 0 73 B
#7797 OptimizedCharSliceWithPool net6.0 809μs 37.8ns 146ns 0 0 0 4 B
#7797 OptimizedCharSliceWithPool netcoreapp3.1 797μs 94.6ns 366ns 0 0 0 0 b
#7797 OptimizedCharSliceWithPool net472 1.15ms 59.6ns 206ns 0 0 0 48 B
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7797

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 42.14 KB 42.56 KB 417 B 0.99%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 727μs 3.77μs 17.3μs 0 0 0 42.14 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 718μs 4.17μs 34.6μs 0 0 0 41.75 KB
master WriteAndFlushEnrichedTraces net472 892μs 3.83μs 14.8μs 4.46 0 0 55.96 KB
#7797 WriteAndFlushEnrichedTraces net6.0 716μs 2.51μs 9.06μs 0 0 0 42.56 KB
#7797 WriteAndFlushEnrichedTraces netcoreapp3.1 782μs 3.71μs 14.4μs 0 0 0 41.73 KB
#7797 WriteAndFlushEnrichedTraces net472 906μs 3.16μs 12.2μs 4.46 0 0 55.9 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.88μs 1.54ns 5.97ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.62μs 12.1ns 46.8ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.87μs 4.85ns 17.5ns 0.144 0.0144 0 987 B
#7797 ExecuteNonQuery net6.0 1.86μs 3.86ns 14.5ns 0 0 0 1.02 KB
#7797 ExecuteNonQuery netcoreapp3.1 2.67μs 4.64ns 18ns 0 0 0 1.02 KB
#7797 ExecuteNonQuery net472 2.91μs 4.16ns 16.1ns 0.144 0.0144 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.69μs 8.99ns 44.9ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.21μs 11.2ns 51.5ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.59μs 1.43ns 5.36ns 0.162 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.8μs 0.962ns 3.6ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.33μs 11.3ns 46.6ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.63μs 1.7ns 6.57ns 0.163 0 0 1.1 KB
#7797 CallElasticsearch net6.0 1.81μs 6.24ns 23.4ns 0 0 0 1.03 KB
#7797 CallElasticsearch netcoreapp3.1 2.27μs 10.3ns 40ns 0 0 0 1.03 KB
#7797 CallElasticsearch net472 3.64μs 2.05ns 7.95ns 0.163 0 0 1.04 KB
#7797 CallElasticsearchAsync net6.0 1.94μs 4.91ns 19ns 0 0 0 1.01 KB
#7797 CallElasticsearchAsync netcoreapp3.1 2.41μs 9.19ns 35.6ns 0 0 0 1.08 KB
#7797 CallElasticsearchAsync net472 3.68μs 2.83ns 11ns 0.166 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.97μs 1.77ns 6.84ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.44μs 9.56ns 37ns 0 0 0 952 B
master ExecuteAsync net472 2.68μs 7.96ns 30.8ns 0.134 0 0 915 B
#7797 ExecuteAsync net6.0 1.83μs 5.52ns 19.1ns 0 0 0 952 B
#7797 ExecuteAsync netcoreapp3.1 2.49μs 8.1ns 29.2ns 0 0 0 952 B
#7797 ExecuteAsync net472 2.62μs 3.12ns 12.1ns 0.145 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.06μs 19.8ns 76.7ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.87μs 24.7ns 92.4ns 0 0 0 2.9 KB
master SendAsync net472 12.6μs 10.7ns 41.5ns 0.504 0 0 3.18 KB
#7797 SendAsync net6.0 7.05μs 6.11ns 22ns 0 0 0 2.36 KB
#7797 SendAsync netcoreapp3.1 8.58μs 15.3ns 57.1ns 0 0 0 2.9 KB
#7797 SendAsync net472 12.6μs 10.7ns 41.6ns 0.502 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7797

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.34 KB 65.54 KB 8.19 KB 14.29%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 256.27 KB 277.7 KB 21.43 KB 8.36%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 45.34 KB 45.75 KB 408 B 0.90%

Fewer allocations 🎉 in #7797

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 43.14 KB 42.8 KB -344 B -0.80%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 260.24 KB 249.98 KB -10.26 KB -3.94%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 48.1μs 306ns 2.95μs 0 0 0 45.34 KB
master StringConcatBenchmark netcoreapp3.1 50.9μs 391ns 3.71μs 0 0 0 43.14 KB
master StringConcatBenchmark net472 58.3μs 117ns 438ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 458μs 1.33μs 4.78μs 0 0 0 260.24 KB
master StringConcatAspectBenchmark netcoreapp3.1 508μs 2.28μs 8.83μs 0 0 0 256.27 KB
master StringConcatAspectBenchmark net472 399μs 1.7μs 6.58μs 0 0 0 286.72 KB
#7797 StringConcatBenchmark net6.0 47.6μs 265ns 1.55μs 0 0 0 45.75 KB
#7797 StringConcatBenchmark netcoreapp3.1 54.8μs 745ns 7.37μs 0 0 0 42.8 KB
#7797 StringConcatBenchmark net472 58.4μs 240ns 931ns 0 0 0 65.54 KB
#7797 StringConcatAspectBenchmark net6.0 459μs 2.35μs 11.3μs 0 0 0 249.98 KB
#7797 StringConcatAspectBenchmark netcoreapp3.1 564μs 1.61μs 5.57μs 0 0 0 277.7 KB
#7797 StringConcatAspectBenchmark net472 401μs 2.08μs 10.2μs 0 0 0 286.86 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.65μs 0.571ns 2.21ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.65μs 14.5ns 54.2ns 0 0 0 1.7 KB
master EnrichedLog net472 3.81μs 3.36ns 13ns 0.248 0 0 1.64 KB
#7797 EnrichedLog net6.0 2.66μs 13.7ns 64.2ns 0 0 0 1.7 KB
#7797 EnrichedLog netcoreapp3.1 3.75μs 4.08ns 15.8ns 0 0 0 1.7 KB
#7797 EnrichedLog net472 4.06μs 5.71ns 22.1ns 0.243 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 128μs 606ns 2.5μs 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 132μs 463ns 1.79μs 0 0 0 4.31 KB
master EnrichedLog net472 175μs 444ns 1.72μs 0 0 0 4.51 KB
#7797 EnrichedLog net6.0 123μs 147ns 548ns 0 0 0 4.31 KB
#7797 EnrichedLog netcoreapp3.1 127μs 28.6ns 111ns 0 0 0 4.31 KB
#7797 EnrichedLog net472 167μs 64.1ns 248ns 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 4.99μs 6.8ns 26.3ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.87μs 8.36ns 32.4ns 0 0 0 2.26 KB
master EnrichedLog net472 7.63μs 5.06ns 18.9ns 0.304 0 0 2.08 KB
#7797 EnrichedLog net6.0 5.05μs 3.53ns 13.2ns 0 0 0 2.26 KB
#7797 EnrichedLog netcoreapp3.1 6.97μs 9.03ns 33.8ns 0 0 0 2.26 KB
#7797 EnrichedLog net472 7.56μs 7.89ns 30.5ns 0.301 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.06μs 6.65ns 25.8ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.63μs 12.5ns 48.5ns 0 0 0 1.2 KB
master SendReceive net472 3.03μs 6.35ns 24.6ns 0.18 0 0 1.2 KB
#7797 SendReceive net6.0 1.95μs 4.25ns 16.4ns 0 0 0 1.2 KB
#7797 SendReceive netcoreapp3.1 2.63μs 12.8ns 55.8ns 0 0 0 1.2 KB
#7797 SendReceive net472 3.05μs 1.09ns 3.94ns 0.18 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.27μs 15.3ns 57.1ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.83μs 14.6ns 56.4ns 0 0 0 1.63 KB
master EnrichedLog net472 6.63μs 7.92ns 30.7ns 0.297 0 0 2.03 KB
#7797 EnrichedLog net6.0 4.33μs 6.27ns 24.3ns 0 0 0 1.58 KB
#7797 EnrichedLog netcoreapp3.1 5.46μs 9.11ns 35.3ns 0 0 0 1.63 KB
#7797 EnrichedLog net472 6.78μs 5.14ns 19.9ns 0.301 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 772ns 3.4ns 12.7ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 998ns 4.54ns 18.2ns 0 0 0 576 B
master StartFinishSpan net472 958ns 0.106ns 0.396ns 0.0911 0 0 578 B
master StartFinishScope net6.0 953ns 1.49ns 5.79ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.22μs 0.707ns 2.74ns 0 0 0 696 B
master StartFinishScope net472 1.17μs 2.6ns 10.1ns 0.1 0 0 658 B
#7797 StartFinishSpan net6.0 787ns 0.528ns 1.97ns 0 0 0 576 B
#7797 StartFinishSpan netcoreapp3.1 1.02μs 4.58ns 17.7ns 0 0 0 576 B
#7797 StartFinishSpan net472 957ns 0.232ns 0.897ns 0.0905 0 0 578 B
#7797 StartFinishScope net6.0 923ns 1.57ns 6.09ns 0 0 0 696 B
#7797 StartFinishScope netcoreapp3.1 1.23μs 6.45ns 31.6ns 0 0 0 697 B
#7797 StartFinishScope net472 1.13μs 0.237ns 0.918ns 0.102 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.07μs 5.12ns 21.7ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.4μs 0.489ns 1.9ns 0 0 0 696 B
master RunOnMethodBegin net472 1.44μs 0.501ns 1.87ns 0.101 0 0 658 B
#7797 RunOnMethodBegin net6.0 1.04μs 5.27ns 23.6ns 0 0 0 696 B
#7797 RunOnMethodBegin netcoreapp3.1 1.41μs 6.75ns 26.1ns 0 0 0 696 B
#7797 RunOnMethodBegin net472 1.45μs 0.699ns 2.61ns 0.102 0 0 658 B

@andrewlock andrewlock changed the title Dispose ManualResetEventSlim instances tests Dispose ManualResetEventSlim instances in tests Nov 10, 2025
@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7797) 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
duration75.39 ± (75.04 - 75.82) ms74.88 ± (74.69 - 75.28) ms-0.7%
.NET Framework 4.8 - Bailout
duration79.26 ± (79.00 - 79.47) ms79.28 ± (78.86 - 79.47) ms+0.0%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1108.38 ± (1111.88 - 1122.66) ms1100.37 ± (1100.81 - 1110.16) ms-0.7%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.91 ± (22.83 - 22.98) ms22.78 ± (22.70 - 22.85) ms-0.6%
process.time_to_main_ms87.06 ± (86.78 - 87.34) ms87.30 ± (86.92 - 87.67) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.88 ± (10.88 - 10.88) MB10.88 ± (10.88 - 10.89) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.87 ± (22.81 - 22.93) ms22.84 ± (22.76 - 22.92) ms-0.1%
process.time_to_main_ms88.78 ± (88.49 - 89.07) ms89.20 ± (88.81 - 89.59) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.92 - 10.92) MB10.92 ± (10.92 - 10.92) MB+0.0%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms219.93 ± (218.58 - 221.29) ms219.69 ± (218.33 - 221.05) ms-0.1%
process.time_to_main_ms548.73 ± (547.60 - 549.86) ms545.68 ± (544.47 - 546.89) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.60 ± (52.57 - 52.62) MB52.37 ± (52.35 - 52.39) MB-0.4%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.60 ± (21.53 - 21.67) ms21.70 ± (21.65 - 21.76) ms+0.5%✅⬆️
process.time_to_main_ms75.20 ± (74.85 - 75.55) ms76.07 ± (75.76 - 76.39) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.59 ± (10.58 - 10.59) MB10.59 ± (10.59 - 10.59) MB+0.0%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.56 ± (21.48 - 21.64) ms21.48 ± (21.42 - 21.53) ms-0.4%
process.time_to_main_ms77.09 ± (76.76 - 77.43) ms76.07 ± (75.78 - 76.36) ms-1.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.64 ± (10.63 - 10.64) MB10.64 ± (10.64 - 10.65) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms205.68 ± (204.42 - 206.94) ms207.25 ± (205.96 - 208.54) ms+0.8%✅⬆️
process.time_to_main_ms510.72 ± (509.74 - 511.69) ms508.30 ± (507.30 - 509.30) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.78 ± (51.74 - 51.82) MB51.36 ± (51.33 - 51.39) MB-0.8%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.76 ± (19.69 - 19.82) ms19.57 ± (19.52 - 19.62) ms-1.0%
process.time_to_main_ms75.24 ± (74.90 - 75.58) ms73.89 ± (73.57 - 74.22) ms-1.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.61 ± (7.61 - 7.62) MB7.63 ± (7.62 - 7.63) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.58 ± (19.53 - 19.63) ms19.66 ± (19.61 - 19.72) ms+0.4%✅⬆️
process.time_to_main_ms75.46 ± (75.13 - 75.80) ms75.81 ± (75.49 - 76.13) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.66 - 7.67) MB7.68 ± (7.67 - 7.68) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms188.91 ± (187.99 - 189.83) ms190.42 ± (189.51 - 191.33) ms+0.8%✅⬆️
process.time_to_main_ms488.40 ± (487.39 - 489.41) ms485.70 ± (484.63 - 486.76) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.86 ± (38.83 - 38.90) MB38.59 ± (38.55 - 38.63) MB-0.7%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.1%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration191.55 ± (191.38 - 192.05) ms192.90 ± (192.93 - 193.77) ms+0.7%✅⬆️
.NET Framework 4.8 - Bailout
duration194.96 ± (194.79 - 195.34) ms199.18 ± (199.18 - 200.14) ms+2.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1206.94 ± (1197.95 - 1208.71) ms1171.58 ± (1174.25 - 1183.81) ms-2.9%
.NET Core 3.1 - Baseline
process.internal_duration_ms200.58 ± (200.09 - 201.06) ms191.23 ± (190.81 - 191.64) ms-4.7%
process.time_to_main_ms87.03 ± (86.78 - 87.29) ms82.44 ± (82.22 - 82.66) ms-5.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed15.97 ± (15.95 - 15.99) MB16.09 ± (16.06 - 16.11) MB+0.8%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-1.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms202.57 ± (202.12 - 203.01) ms191.05 ± (190.56 - 191.54) ms-5.7%
process.time_to_main_ms89.15 ± (88.91 - 89.39) ms84.03 ± (83.84 - 84.23) ms-5.7%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed15.99 ± (15.97 - 16.01) MB16.11 ± (16.09 - 16.13) MB+0.8%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.1%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms400.87 ± (398.26 - 403.48) ms400.67 ± (398.22 - 403.12) ms-0.1%
process.time_to_main_ms532.09 ± (530.75 - 533.42) ms517.99 ± (517.10 - 518.88) ms-2.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed63.40 ± (63.27 - 63.53) MB63.05 ± (62.91 - 63.18) MB-0.6%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 6 - Baseline
process.internal_duration_ms194.11 ± (193.65 - 194.58) ms193.55 ± (193.08 - 194.02) ms-0.3%
process.time_to_main_ms70.60 ± (70.41 - 70.79) ms70.57 ± (70.35 - 70.79) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.35 ± (16.32 - 16.38) MB16.01 ± (15.87 - 16.16) MB-2.1%
runtime.dotnet.threads.count19 ± (19 - 19)18 ± (18 - 19)-2.5%
.NET 6 - Bailout
process.internal_duration_ms194.30 ± (193.83 - 194.77) ms191.38 ± (191.03 - 191.74) ms-1.5%
process.time_to_main_ms72.12 ± (71.95 - 72.29) ms71.01 ± (70.87 - 71.14) ms-1.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.39 ± (16.32 - 16.45) MB16.25 ± (16.15 - 16.36) MB-0.8%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.5%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms420.35 ± (417.48 - 423.21) ms418.15 ± (414.73 - 421.57) ms-0.5%
process.time_to_main_ms498.03 ± (496.84 - 499.21) ms485.97 ± (485.26 - 486.68) ms-2.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.46 ± (62.33 - 62.59) MB61.96 ± (61.82 - 62.10) MB-0.8%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 29)-0.2%
.NET 8 - Baseline
process.internal_duration_ms192.85 ± (192.40 - 193.29) ms191.25 ± (190.87 - 191.64) ms-0.8%
process.time_to_main_ms70.22 ± (70.04 - 70.41) ms69.92 ± (69.72 - 70.12) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.67 ± (11.65 - 11.69) MB11.68 ± (11.65 - 11.70) MB+0.0%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.3%
.NET 8 - Bailout
process.internal_duration_ms191.73 ± (191.36 - 192.11) ms191.13 ± (190.82 - 191.44) ms-0.3%
process.time_to_main_ms71.47 ± (71.30 - 71.64) ms70.91 ± (70.74 - 71.08) ms-0.8%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.72 - 11.76) MB11.76 ± (11.74 - 11.79) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.0%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms361.21 ± (359.95 - 362.48) ms366.57 ± (365.18 - 367.97) ms+1.5%✅⬆️
process.time_to_main_ms468.46 ± (467.76 - 469.15) ms467.38 ± (466.47 - 468.29) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.51 ± (50.48 - 50.54) MB50.16 ± (50.12 - 50.19) MB-0.7%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
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 (7797) - mean (75ms)  : 71, 79
    master - mean (75ms)  : 70, 81

    section Bailout
    This PR (7797) - mean (79ms)  : 75, 84
    master - mean (79ms)  : 76, 83

    section CallTarget+Inlining+NGEN
    This PR (7797) - mean (1,105ms)  : 1038, 1173
    master - mean (1,117ms)  : 1037, 1197

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 (7797) - mean (118ms)  : 111, 124
    master - mean (117ms)  : 112, 122

    section Bailout
    This PR (7797) - mean (119ms)  : 112, 126
    master - mean (119ms)  : 114, 124

    section CallTarget+Inlining+NGEN
    This PR (7797) - mean (801ms)  : 767, 836
    master - mean (806ms)  : 764, 847

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7797) - mean (105ms)  : 99, 111
    master - mean (104ms)  : 96, 111

    section Bailout
    This PR (7797) - mean (105ms)  : 99, 111
    master - mean (106ms)  : 99, 112

    section CallTarget+Inlining+NGEN
    This PR (7797) - mean (746ms)  : 715, 776
    master - mean (745ms)  : 714, 777

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7797) - mean (102ms)  : 96, 107
    master - mean (103ms)  : 96, 111

    section Bailout
    This PR (7797) - mean (104ms)  : 98, 110
    master - mean (103ms)  : 96, 110

    section CallTarget+Inlining+NGEN
    This PR (7797) - mean (712ms)  : 678, 745
    master - mean (707ms)  : 669, 746

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 (7797) - mean (193ms)  : 189, 197
    master - mean (192ms)  : 189, 195

    section Bailout
    This PR (7797) - mean (200ms)  : 194, 205
    master - mean (195ms)  : 192, 198

    section CallTarget+Inlining+NGEN
    This PR (7797) - mean (1,179ms)  : 1111, 1247
    master - mean (1,203ms)  : 1127, 1280

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 (7797) - mean (283ms)  : 273, 292
    master - mean (297ms)  : 288, 306

    section Bailout
    This PR (7797) - mean (284ms)  : 273, 294
    master - mean (301ms)  : 294, 308

    section CallTarget+Inlining+NGEN
    This PR (7797) - mean (958ms)  : 908, 1008
    master - mean (977ms)  : 931, 1023

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

    section Bailout
    This PR (7797) - mean (270ms)  : 265, 275
    master - mean (275ms)  : 267, 283

    section CallTarget+Inlining+NGEN
    This PR (7797) - mean (939ms)  : 888, 990
    master - mean (958ms)  : 897, 1019

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7797) - mean (271ms)  : 265, 277
    master - mean (273ms)  : 264, 281

    section Bailout
    This PR (7797) - mean (271ms)  : 268, 275
    master - mean (273ms)  : 266, 279

    section CallTarget+Inlining+NGEN
    This PR (7797) - mean (866ms)  : 837, 894
    master - mean (862ms)  : 834, 890

Loading

@datadog-official
Copy link

datadog-official bot commented Nov 10, 2025

⚠️ Tests

⚠️ Warnings

❄️ 1 New flaky test detected

SubmitsTracesInMySql8 from Datadog.Trace.ClrProfiler.IntegrationTests.AdoNet.MySqlCommandTests (Datadog)
Expected exit code: 0, actual exit code: 134.

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8b07d1f | Docs | Datadog PR Page | Was this helpful? Give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests unit tests, integration tests type:cleanup Minor code clean up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants