Skip to content

Conversation

@daniel-romano-DD
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD commented Dec 2, 2025

Summary of changes

Replaced custom mutex guard with std::lock_guard, using std::recursive_mutex instead of CRITICAL_SECTION in windows and std::mutex with railings in Linux

Reason for change

Some locks have been spotted in smoke test wich could be cause by the lack of thread recursive lock in the std::mutex

Implementation details

Test coverage

Other details

@datadog-datadog-prod-us1

This comment has been minimized.

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

dd-trace-dotnet-ci-bot bot commented Dec 2, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7890) 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.78 ± (76.02 - 76.80) ms75.01 ± (75.29 - 76.07) ms-1.0%
.NET Framework 4.8 - Bailout
duration80.91 ± (80.67 - 81.50) ms79.11 ± (79.16 - 79.99) ms-2.2%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1063.22 ± (1063.81 - 1073.64) ms1071.03 ± (1069.45 - 1079.02) ms+0.7%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.97 ± (22.90 - 23.04) ms23.05 ± (22.97 - 23.13) ms+0.4%✅⬆️
process.time_to_main_ms88.51 ± (88.08 - 88.94) ms89.05 ± (88.53 - 89.57) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.93 - 10.93) MB10.92 ± (10.91 - 10.92) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.70 ± (22.64 - 22.76) ms22.91 ± (22.85 - 22.98) ms+0.9%✅⬆️
process.time_to_main_ms88.05 ± (87.69 - 88.42) ms90.41 ± (89.99 - 90.82) ms+2.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (10.97 - 10.97) MB10.95 ± (10.95 - 10.96) MB-0.2%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms223.07 ± (221.45 - 224.69) ms224.68 ± (223.24 - 226.11) ms+0.7%✅⬆️
process.time_to_main_ms502.34 ± (501.02 - 503.66) ms506.51 ± (505.15 - 507.88) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.86 ± (47.84 - 47.88) MB47.93 ± (47.91 - 47.95) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.64 ± (21.57 - 21.71) ms21.92 ± (21.85 - 21.99) ms+1.3%✅⬆️
process.time_to_main_ms76.06 ± (75.70 - 76.41) ms77.74 ± (77.34 - 78.14) ms+2.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.60 - 10.61) MB10.63 ± (10.63 - 10.64) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.74 ± (21.66 - 21.81) ms22.15 ± (22.07 - 22.22) ms+1.9%✅⬆️
process.time_to_main_ms77.98 ± (77.60 - 78.36) ms80.19 ± (79.80 - 80.57) ms+2.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.65 - 10.66) MB10.67 ± (10.67 - 10.68) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms212.39 ± (211.31 - 213.48) ms212.10 ± (210.89 - 213.31) ms-0.1%
process.time_to_main_ms469.41 ± (468.30 - 470.51) ms471.01 ± (469.91 - 472.12) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.09 ± (48.07 - 48.12) MB48.07 ± (48.04 - 48.09) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.84 ± (19.77 - 19.91) ms20.07 ± (19.98 - 20.16) ms+1.2%✅⬆️
process.time_to_main_ms75.06 ± (74.68 - 75.44) ms76.72 ± (76.23 - 77.21) ms+2.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.64 ± (7.64 - 7.65) MB7.67 ± (7.66 - 7.68) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.91 ± (19.84 - 19.98) ms20.00 ± (19.93 - 20.08) ms+0.5%✅⬆️
process.time_to_main_ms76.54 ± (76.18 - 76.90) ms76.58 ± (76.25 - 76.91) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.69 ± (7.69 - 7.70) MB7.72 ± (7.71 - 7.73) MB+0.4%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms193.56 ± (192.56 - 194.56) ms194.12 ± (192.95 - 195.29) ms+0.3%✅⬆️
process.time_to_main_ms458.42 ± (457.18 - 459.67) ms460.43 ± (459.10 - 461.77) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.45 ± (36.41 - 36.49) MB36.52 ± (36.48 - 36.55) MB+0.2%✅⬆️
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
duration192.46 ± (192.34 - 193.09) ms198.20 ± (197.64 - 198.56) ms+3.0%✅⬆️
.NET Framework 4.8 - Bailout
duration196.54 ± (196.21 - 196.83) ms201.18 ± (200.59 - 201.55) ms+2.4%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1108.29 ± (1110.88 - 1118.91) ms1124.06 ± (1126.88 - 1135.25) ms+1.4%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms189.21 ± (188.75 - 189.67) ms188.41 ± (188.17 - 188.66) ms-0.4%
process.time_to_main_ms81.08 ± (80.85 - 81.31) ms80.84 ± (80.67 - 81.02) ms-0.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.06 ± (16.04 - 16.08) MB16.16 ± (16.13 - 16.19) MB+0.6%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)-0.2%
.NET Core 3.1 - Bailout
process.internal_duration_ms187.00 ± (186.71 - 187.28) ms188.54 ± (188.21 - 188.86) ms+0.8%✅⬆️
process.time_to_main_ms81.57 ± (81.45 - 81.70) ms82.40 ± (82.25 - 82.56) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.12 - 16.18) MB16.16 ± (16.13 - 16.20) MB+0.1%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)-0.1%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms399.83 ± (397.27 - 402.39) ms401.13 ± (398.33 - 403.92) ms+0.3%✅⬆️
process.time_to_main_ms473.22 ± (472.45 - 473.99) ms475.29 ± (474.54 - 476.04) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.58 ± (58.45 - 58.72) MB58.64 ± (58.50 - 58.77) MB+0.1%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 30)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms191.84 ± (191.52 - 192.17) ms192.51 ± (192.16 - 192.86) ms+0.3%✅⬆️
process.time_to_main_ms69.86 ± (69.72 - 70.01) ms70.08 ± (69.88 - 70.29) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.11 ± (15.98 - 16.24) MB16.10 ± (15.96 - 16.25) MB-0.0%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 19)+1.5%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.96 ± (191.59 - 192.33) ms196.24 ± (195.69 - 196.80) ms+2.2%✅⬆️
process.time_to_main_ms70.85 ± (70.73 - 70.96) ms72.64 ± (72.40 - 72.87) ms+2.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.91 ± (15.74 - 16.08) MB16.38 ± (16.36 - 16.41) MB+3.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (20 - 20)+6.4%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms407.36 ± (405.13 - 409.59) ms414.67 ± (412.52 - 416.81) ms+1.8%✅⬆️
process.time_to_main_ms440.63 ± (440.02 - 441.24) ms450.16 ± (449.09 - 451.22) ms+2.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.93 ± (58.79 - 59.07) MB59.27 ± (59.18 - 59.37) MB+0.6%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (29 - 30)-0.2%
.NET 8 - Baseline
process.internal_duration_ms190.83 ± (190.41 - 191.25) ms192.34 ± (192.07 - 192.60) ms+0.8%✅⬆️
process.time_to_main_ms69.55 ± (69.34 - 69.75) ms70.15 ± (69.96 - 70.35) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.75 - 11.81) MB11.74 ± (11.72 - 11.76) MB-0.4%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.1%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms189.75 ± (189.48 - 190.01) ms195.87 ± (195.33 - 196.42) ms+3.2%✅⬆️
process.time_to_main_ms70.30 ± (70.19 - 70.41) ms72.56 ± (72.32 - 72.79) ms+3.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.81 ± (11.76 - 11.87) MB11.71 ± (11.70 - 11.73) MB-0.8%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.8%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms365.71 ± (364.37 - 367.06) ms369.62 ± (368.02 - 371.22) ms+1.1%✅⬆️
process.time_to_main_ms426.97 ± (426.38 - 427.56) ms436.72 ± (435.83 - 437.60) ms+2.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.93 ± (47.91 - 47.96) MB47.95 ± (47.92 - 47.98) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.7%
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 (7890) - mean (76ms)  : 70, 81
    master - mean (76ms)  : 71, 82

    section Bailout
    This PR (7890) - mean (80ms)  : 73, 86
    master - mean (81ms)  : 75, 88

    section CallTarget+Inlining+NGEN
    This PR (7890) - mean (1,074ms)  : 1000, 1148
    master - mean (1,069ms)  : 997, 1140

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 (7890) - mean (120ms)  : 111, 129
    master - mean (119ms)  : 110, 129

    section Bailout
    This PR (7890) - mean (121ms)  : 112, 130
    master - mean (118ms)  : 112, 124

    section CallTarget+Inlining+NGEN
    This PR (7890) - mean (771ms)  : 732, 810
    master - mean (765ms)  : 721, 808

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

    section Bailout
    This PR (7890) - mean (110ms)  : 101, 119
    master - mean (107ms)  : 99, 115

    section CallTarget+Inlining+NGEN
    This PR (7890) - mean (709ms)  : 676, 743
    master - mean (709ms)  : 683, 735

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7890) - mean (105ms)  : 96, 114
    master - mean (103ms)  : 96, 110

    section Bailout
    This PR (7890) - mean (105ms)  : 97, 114
    master - mean (105ms)  : 97, 112

    section CallTarget+Inlining+NGEN
    This PR (7890) - mean (691ms)  : 654, 727
    master - mean (684ms)  : 642, 727

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 (7890) - mean (198ms)  : 192, 205
    master - mean (193ms)  : 189, 196

    section Bailout
    This PR (7890) - mean (201ms)  : 196, 206
    master - mean (197ms)  : 193, 200

    section CallTarget+Inlining+NGEN
    This PR (7890) - mean (1,131ms)  : 1072, 1191
    master - mean (1,115ms)  : 1056, 1173

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 (7890) - mean (278ms)  : 274, 282
    master - mean (279ms)  : 270, 288

    section Bailout
    This PR (7890) - mean (279ms)  : 274, 285
    master - mean (277ms)  : 273, 280

    section CallTarget+Inlining+NGEN
    This PR (7890) - mean (909ms)  : 861, 956
    master - mean (910ms)  : 866, 953

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7890) - mean (271ms)  : 266, 276
    master - mean (270ms)  : 266, 274

    section Bailout
    This PR (7890) - mean (278ms)  : 264, 292
    master - mean (271ms)  : 267, 275

    section CallTarget+Inlining+NGEN
    This PR (7890) - mean (900ms)  : 847, 952
    master - mean (882ms)  : 836, 928

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7890) - mean (272ms)  : 267, 277
    master - mean (271ms)  : 263, 279

    section Bailout
    This PR (7890) - mean (278ms)  : 266, 290
    master - mean (269ms)  : 265, 273

    section CallTarget+Inlining+NGEN
    This PR (7890) - mean (838ms)  : 808, 868
    master - mean (824ms)  : 806, 843

Loading

@pr-commenter
Copy link

pr-commenter bot commented Dec 2, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7890 compared to master:

  • 1 benchmarks are slower, with geometric mean 2.342
  • 2 benchmarks have fewer allocations
  • 2 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 #7890

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 5.95 KB 5.98 KB 35 B 0.59%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 11.1μs 62.3ns 389ns 0 0 0 5.49 KB
master StartStopWithChild netcoreapp3.1 14.1μs 74ns 355ns 0 0 0 5.71 KB
master StartStopWithChild net472 22.6μs 106ns 397ns 0.987 0.329 0.11 5.95 KB
#7890 StartStopWithChild net6.0 10.6μs 59.9ns 402ns 0 0 0 5.51 KB
#7890 StartStopWithChild netcoreapp3.1 14.7μs 70.4ns 273ns 0 0 0 5.7 KB
#7890 StartStopWithChild net472 22.1μs 109ns 513ns 0.898 0.112 0 5.98 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 1.25ms 65.6ns 246ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.38ms 206ns 797ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.74ms 943ns 3.53μs 0 0 0 3.26 KB
#7890 WriteAndFlushEnrichedTraces net6.0 1.25ms 145ns 560ns 0 0 0 2.7 KB
#7890 WriteAndFlushEnrichedTraces netcoreapp3.1 1.39ms 263ns 985ns 0 0 0 2.7 KB
#7890 WriteAndFlushEnrichedTraces net472 1.73ms 1.85μs 7.18μs 0 0 0 3.26 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.08μs 5.58ns 27.3ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.4μs 7.94ns 56.1ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.08μs 0.268ns 1.04ns 0.194 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.19μs 25.8ns 100ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.06μs 47ns 230ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.76μs 2.41ns 9.32ns 0.737 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 327ns 1.83ns 12ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 393ns 2.23ns 15.9ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 300ns 0.0373ns 0.134ns 0.0439 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.36μs 4.06ns 15.7ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.9μs 39.9ns 187ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.8μs 0.708ns 2.65ns 0.579 0 0 3.8 KB
#7890 AllCycleSimpleBody net6.0 1.07μs 1.05ns 4.06ns 0 0 0 1.22 KB
#7890 AllCycleSimpleBody netcoreapp3.1 1.39μs 7.88ns 52.8ns 0 0 0 1.2 KB
#7890 AllCycleSimpleBody net472 1.01μs 0.429ns 1.49ns 0.191 0 0 1.23 KB
#7890 AllCycleMoreComplexBody net6.0 7.27μs 36.1ns 157ns 0 0 0 4.72 KB
#7890 AllCycleMoreComplexBody netcoreapp3.1 8.95μs 46.8ns 234ns 0 0 0 4.62 KB
#7890 AllCycleMoreComplexBody net472 7.86μs 4.9ns 19ns 0.744 0 0 4.74 KB
#7890 ObjectExtractorSimpleBody net6.0 324ns 1.57ns 7.86ns 0 0 0 280 B
#7890 ObjectExtractorSimpleBody netcoreapp3.1 386ns 2.18ns 15.4ns 0 0 0 272 B
#7890 ObjectExtractorSimpleBody net472 299ns 0.0912ns 0.353ns 0.0436 0 0 281 B
#7890 ObjectExtractorMoreComplexBody net6.0 6.27μs 32.2ns 161ns 0 0 0 3.78 KB
#7890 ObjectExtractorMoreComplexBody netcoreapp3.1 8.06μs 20.5ns 79.6ns 0 0 0 3.69 KB
#7890 ObjectExtractorMoreComplexBody net472 6.78μs 3.32ns 12.8ns 0.577 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.9μs 27.3ns 102ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 97.4μs 332ns 1.28μs 0 0 0 32.4 KB
master EncodeArgs net472 108μs 16.1ns 62.4ns 4.88 0 0 32.5 KB
master EncodeLegacyArgs net6.0 147μs 51.5ns 193ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 199μs 169ns 654ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 262μs 26.2ns 101ns 0 0 0 2.14 KB
#7890 EncodeArgs net6.0 77.6μs 99.1ns 357ns 0 0 0 32.4 KB
#7890 EncodeArgs netcoreapp3.1 97.3μs 289ns 1.12μs 0 0 0 32.4 KB
#7890 EncodeArgs net472 109μs 29ns 112ns 4.93 0 0 32.5 KB
#7890 EncodeLegacyArgs net6.0 143μs 9.25ns 32ns 0 0 0 2.14 KB
#7890 EncodeLegacyArgs netcoreapp3.1 201μs 107ns 401ns 0 0 0 2.14 KB
#7890 EncodeLegacyArgs net472 262μs 28ns 108ns 0 0 0 2.15 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 423μs 618ns 2.14μs 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 450μs 1.37μs 4.93μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 497μs 192ns 667ns 0 0 0 0 b
master RunWafRealisticBenchmarkWithAttack net6.0 311μs 581ns 2.01μs 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 349μs 2.71μs 25.9μs 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 371μs 219ns 789ns 0 0 0 0 b
#7890 RunWafRealisticBenchmark net6.0 428μs 1.01μs 3.5μs 0 0 0 4.55 KB
#7890 RunWafRealisticBenchmark netcoreapp3.1 461μs 3.1μs 29.2μs 0 0 0 4.48 KB
#7890 RunWafRealisticBenchmark net472 497μs 502ns 1.88μs 0 0 0 0 b
#7890 RunWafRealisticBenchmarkWithAttack net6.0 309μs 665ns 2.4μs 0 0 0 2.24 KB
#7890 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 346μs 822ns 2.85μs 0 0 0 2.22 KB
#7890 RunWafRealisticBenchmarkWithAttack net472 370μs 326ns 1.17μs 0 0 0 0 b
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 86.3μs 389ns 1.4μs 0 0 0 19.03 KB
master SendRequest netcoreapp3.1 97.4μs 400ns 2.62μs 0 0 0 21.25 KB
master SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#7890 SendRequest net6.0 86.7μs 459ns 2.3μs 0 0 0 19.03 KB
#7890 SendRequest netcoreapp3.1 97.3μs 332ns 1.94μs 0 0 0 21.25 KB
#7890 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7890

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 2.342 817,050.00 1,913,250.00

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 2.01ms 1.97μs 7.38μs 0 0 0 640 KB
master OriginalCharSlice netcoreapp3.1 3.96ms 1.08μs 4.2μs 0 0 0 640.05 KB
master OriginalCharSlice net472 2.58ms 810ns 3.03μs 0 0 0 638.98 KB
master OptimizedCharSlice net6.0 1.42ms 937ns 3.63μs 0 0 0 0 b
master OptimizedCharSlice netcoreapp3.1 2.79ms 793ns 2.97μs 0 0 0 0 b
master OptimizedCharSlice net472 1.96ms 630ns 2.27μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 1.07ms 720ns 2.79μs 0 0 0 0 b
master OptimizedCharSliceWithPool netcoreapp3.1 817μs 249ns 1.69μs 0 0 0 0 b
master OptimizedCharSliceWithPool net472 1.2ms 376ns 1.46μs 0 0 0 0 b
#7890 OriginalCharSlice net6.0 2.05ms 1.02μs 3.8μs 0 0 0 640 KB
#7890 OriginalCharSlice netcoreapp3.1 4.03ms 895ns 3.35μs 0 0 0 640.05 KB
#7890 OriginalCharSlice net472 2.66ms 958ns 3.71μs 0 0 0 638.98 KB
#7890 OptimizedCharSlice net6.0 1.43ms 508ns 1.97μs 0 0 0 0 b
#7890 OptimizedCharSlice netcoreapp3.1 3.04ms 2.11μs 8.17μs 0 0 0 0 b
#7890 OptimizedCharSlice net472 1.91ms 665ns 2.4μs 0 0 0 0 b
#7890 OptimizedCharSliceWithPool net6.0 1.03ms 732ns 2.84μs 0 0 0 0 b
#7890 OptimizedCharSliceWithPool netcoreapp3.1 1.91ms 872ns 3.26μs 0 0 0 0 b
#7890 OptimizedCharSliceWithPool net472 1.15ms 433ns 1.68μs 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7890

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 56.39 KB 55.8 KB -589 B -1.04%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 661μs 436ns 1.69μs 0 0 0 41.68 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 664μs 1.94μs 7.24μs 0 0 0 41.96 KB
master WriteAndFlushEnrichedTraces net472 931μs 2.24μs 8.67μs 8.33 4.17 0 56.39 KB
#7890 WriteAndFlushEnrichedTraces net6.0 719μs 808ns 3.13μs 0 0 0 41.78 KB
#7890 WriteAndFlushEnrichedTraces netcoreapp3.1 730μs 3.89μs 20.6μs 0 0 0 41.88 KB
#7890 WriteAndFlushEnrichedTraces net472 971μs 4.39μs 17μs 4.81 0 0 55.8 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.95μs 9.02ns 37.2ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.6μs 8.32ns 32.2ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.74μs 3.22ns 12.5ns 0.149 0 0 987 B
#7890 ExecuteNonQuery net6.0 1.93μs 5.33ns 20ns 0 0 0 1.02 KB
#7890 ExecuteNonQuery netcoreapp3.1 2.76μs 13.1ns 50.9ns 0 0 0 1.02 KB
#7890 ExecuteNonQuery net472 2.75μs 5.6ns 21.7ns 0.15 0 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.73μs 7.72ns 28.9ns 0 0 0 1.01 KB
master CallElasticsearch netcoreapp3.1 2.28μs 11.5ns 48.7ns 0 0 0 1.02 KB
master CallElasticsearch net472 3.36μs 4.52ns 16.9ns 0.152 0 0 1.01 KB
master CallElasticsearchAsync net6.0 1.75μs 4.96ns 18.6ns 0 0 0 984 B
master CallElasticsearchAsync netcoreapp3.1 2.56μs 2.14ns 8.28ns 0 0 0 1.07 KB
master CallElasticsearchAsync net472 3.58μs 2.99ns 11.2ns 0.161 0 0 1.07 KB
#7890 CallElasticsearch net6.0 1.7μs 6.94ns 26.9ns 0 0 0 1.01 KB
#7890 CallElasticsearch netcoreapp3.1 2.35μs 7.9ns 30.6ns 0 0 0 1.02 KB
#7890 CallElasticsearch net472 3.44μs 7.02ns 27.2ns 0.154 0 0 1.01 KB
#7890 CallElasticsearchAsync net6.0 1.75μs 3.73ns 14ns 0 0 0 984 B
#7890 CallElasticsearchAsync netcoreapp3.1 2.48μs 2.53ns 9.46ns 0 0 0 1.07 KB
#7890 CallElasticsearchAsync net472 3.57μs 1.73ns 6.71ns 0.16 0 0 1.07 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.98μs 3.82ns 14.8ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.41μs 3.51ns 13.1ns 0 0 0 952 B
master ExecuteAsync net472 2.69μs 2.55ns 9.88ns 0.136 0 0 915 B
#7890 ExecuteAsync net6.0 1.94μs 9.11ns 35.3ns 0 0 0 952 B
#7890 ExecuteAsync netcoreapp3.1 2.41μs 9.5ns 36.8ns 0 0 0 952 B
#7890 ExecuteAsync net472 2.72μs 11.1ns 43ns 0.142 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.05μs 13.5ns 52.3ns 0 0 0 2.35 KB
master SendAsync netcoreapp3.1 8.73μs 23.8ns 92.4ns 0 0 0 2.89 KB
master SendAsync net472 12.2μs 7.5ns 28.1ns 0.486 0 0 3.14 KB
#7890 SendAsync net6.0 6.85μs 10.7ns 41.5ns 0 0 0 2.34 KB
#7890 SendAsync netcoreapp3.1 8.36μs 35ns 136ns 0 0 0 2.89 KB
#7890 SendAsync net472 12.4μs 7.06ns 27.3ns 0.495 0 0 3.14 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7890

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 273.38 KB 275.71 KB 2.33 KB 0.85%

Fewer allocations 🎉 in #7890

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 276 KB 255.59 KB -20.41 KB -7.39%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 44.3μs 223ns 996ns 0 0 0 42.51 KB
master StringConcatBenchmark netcoreapp3.1 49.5μs 261ns 1.22μs 0 0 0 42.54 KB
master StringConcatBenchmark net472 57.3μs 255ns 919ns 0 0 0 49.15 KB
master StringConcatAspectBenchmark net6.0 492μs 2.34μs 9.07μs 0 0 0 273.38 KB
master StringConcatAspectBenchmark netcoreapp3.1 532μs 1.19μs 5.19μs 0 0 0 276 KB
master StringConcatAspectBenchmark net472 418μs 2.39μs 18.2μs 0 0 0 270.34 KB
#7890 StringConcatBenchmark net6.0 44.8μs 234ns 1.12μs 0 0 0 42.51 KB
#7890 StringConcatBenchmark netcoreapp3.1 54.6μs 489ns 4.64μs 0 0 0 42.54 KB
#7890 StringConcatBenchmark net472 56.5μs 288ns 1.38μs 0 0 0 49.15 KB
#7890 StringConcatAspectBenchmark net6.0 482μs 2.28μs 9.13μs 0 0 0 275.71 KB
#7890 StringConcatAspectBenchmark netcoreapp3.1 509μs 2.64μs 15.6μs 0 0 0 255.59 KB
#7890 StringConcatAspectBenchmark net472 399μs 1.68μs 6.28μs 0 0 0 270.34 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.7μs 10.6ns 41.1ns 0 0 0 1.69 KB
master EnrichedLog netcoreapp3.1 3.66μs 2.73ns 10.2ns 0 0 0 1.7 KB
master EnrichedLog net472 3.86μs 4.4ns 17.1ns 0.25 0 0 1.6 KB
#7890 EnrichedLog net6.0 2.67μs 2.22ns 8.59ns 0 0 0 1.69 KB
#7890 EnrichedLog netcoreapp3.1 3.44μs 17.7ns 81.2ns 0 0 0 1.7 KB
#7890 EnrichedLog net472 3.87μs 3.58ns 13.9ns 0.252 0 0 1.6 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 124μs 49.7ns 186ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 54.8ns 198ns 0 0 0 4.31 KB
master EnrichedLog net472 168μs 109ns 423ns 0 0 0 4.51 KB
#7890 EnrichedLog net6.0 124μs 68.3ns 256ns 0 0 0 4.31 KB
#7890 EnrichedLog netcoreapp3.1 127μs 105ns 405ns 0 0 0 4.31 KB
#7890 EnrichedLog net472 168μs 143ns 553ns 0 0 0 4.51 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.07ns 7.46ns 0 0 0 2.24 KB
master EnrichedLog netcoreapp3.1 7.03μs 19.3ns 74.7ns 0 0 0 2.26 KB
master EnrichedLog net472 7.65μs 4.52ns 17.5ns 0.307 0 0 2.05 KB
#7890 EnrichedLog net6.0 5.03μs 14.5ns 56ns 0 0 0 2.24 KB
#7890 EnrichedLog netcoreapp3.1 6.94μs 15ns 58.1ns 0 0 0 2.26 KB
#7890 EnrichedLog net472 7.63μs 8.74ns 33.9ns 0.304 0 0 2.05 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 1.95μs 10.3ns 50.6ns 0 0 0 1.18 KB
master SendReceive netcoreapp3.1 2.62μs 10.2ns 39.4ns 0 0 0 1.19 KB
master SendReceive net472 2.92μs 1.69ns 6.1ns 0.175 0 0 1.17 KB
#7890 SendReceive net6.0 1.95μs 8.96ns 35.8ns 0 0 0 1.18 KB
#7890 SendReceive netcoreapp3.1 2.65μs 9.61ns 35.9ns 0 0 0 1.19 KB
#7890 SendReceive net472 2.98μs 8.31ns 32.2ns 0.174 0 0 1.17 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.47μs 3.76ns 14.5ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.5μs 16.8ns 62.8ns 0 0 0 1.63 KB
master EnrichedLog net472 6.74μs 6.37ns 24.7ns 0.301 0 0 2.03 KB
#7890 EnrichedLog net6.0 4.56μs 14ns 54.2ns 0 0 0 1.58 KB
#7890 EnrichedLog netcoreapp3.1 5.6μs 13.5ns 52.2ns 0 0 0 1.63 KB
#7890 EnrichedLog net472 6.56μs 8.13ns 30.4ns 0.297 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 796ns 0.493ns 1.91ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 952ns 5.19ns 27.9ns 0 0 0 576 B
master StartFinishSpan net472 908ns 0.706ns 2.73ns 0.0907 0 0 578 B
master StartFinishScope net6.0 923ns 4.72ns 22.2ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.16μs 6.05ns 31.4ns 0 0 0 696 B
master StartFinishScope net472 1.1μs 0.796ns 2.98ns 0.0992 0 0 658 B
master StartFinishTwoScopes net6.0 1.76μs 8.9ns 42.7ns 0 0 0 1.19 KB
master StartFinishTwoScopes netcoreapp3.1 2.15μs 10.8ns 49.3ns 0 0 0 1.19 KB
master StartFinishTwoScopes net472 2.13μs 0.541ns 1.87ns 0.17 0 0 1.08 KB
#7890 StartFinishSpan net6.0 801ns 0.679ns 2.63ns 0 0 0 576 B
#7890 StartFinishSpan netcoreapp3.1 979ns 0.577ns 2.23ns 0 0 0 576 B
#7890 StartFinishSpan net472 924ns 0.748ns 2.9ns 0.0877 0 0 578 B
#7890 StartFinishScope net6.0 945ns 4.56ns 18.2ns 0 0 0 696 B
#7890 StartFinishScope netcoreapp3.1 1.17μs 5.29ns 20.5ns 0 0 0 696 B
#7890 StartFinishScope net472 1.1μs 0.626ns 2.34ns 0.104 0 0 658 B
#7890 StartFinishTwoScopes net6.0 1.76μs 9.35ns 48.6ns 0 0 0 1.19 KB
#7890 StartFinishTwoScopes netcoreapp3.1 2.14μs 11.1ns 52.1ns 0 0 0 1.19 KB
#7890 StartFinishTwoScopes net472 2.14μs 1.22ns 4.74ns 0.16 0 0 1.08 KB
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.11μs 5.61ns 25.7ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.43μs 7.28ns 32.5ns 0 0 0 696 B
master RunOnMethodBegin net472 1.46μs 1.1ns 4.27ns 0.103 0 0 658 B
#7890 RunOnMethodBegin net6.0 1.08μs 5.79ns 30.1ns 0 0 0 696 B
#7890 RunOnMethodBegin netcoreapp3.1 1.48μs 4.81ns 18.6ns 0 0 0 696 B
#7890 RunOnMethodBegin net472 1.46μs 0.437ns 1.64ns 0.103 0 0 658 B

@daniel-romano-DD daniel-romano-DD marked this pull request as ready for review December 2, 2025 17:45
@daniel-romano-DD daniel-romano-DD requested review from a team as code owners December 2, 2025 17:45
Copy link
Member

@e-n-0 e-n-0 left a comment

Choose a reason for hiding this comment

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

Not an expert on C++ but LGTM!

@daniel-romano-DD daniel-romano-DD merged commit c288107 into master Dec 3, 2025
149 checks passed
@daniel-romano-DD daniel-romano-DD deleted the dani/iast/cs_refactor branch December 3, 2025 09:24
@github-actions github-actions bot added this to the vNext-v3 milestone Dec 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.

4 participants