Skip to content

Conversation

@bouwkast
Copy link
Collaborator

Summary of changes

Try to protect against a TypeInitializationException and FileLoadException being seen in NLog

Reason for change

Thought process is that the previous method was resolving the incorrect NLog assembly? This way may get the exact one?
🤷

https://learn.microsoft.com/en-us/dotnet/fundamentals/reflection/viewing-type-information

Use Assembly.GetType or Assembly.GetTypes to obtain Type objects from assemblies that have not been loaded, passing in the name of the type or types you want. Use Type.GetType to get the Type objects from an assembly that is already loaded. Use Module.GetType and Module.GetTypes to obtain module Type objects.

Implementation details

Swaps from using GetType() to Assembly to bypass the assembly resolution logic.

Test coverage

None, unsure how it actually emerges

Other details

@bouwkast bouwkast requested review from a team as code owners October 29, 2025 15:47
@bouwkast bouwkast added identified-by:telemetry AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos labels Oct 29, 2025
@bouwkast bouwkast force-pushed the steven/nlog-type-init-error branch from 6d1f263 to 957f6b0 Compare November 6, 2025 13:54
@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7736) 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
duration73.60 ± (73.52 - 74.18) ms74.47 ± (74.53 - 75.22) ms+1.2%✅⬆️
.NET Framework 4.8 - Bailout
duration79.50 ± (79.29 - 80.10) ms79.45 ± (79.36 - 80.31) ms-0.1%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1103.68 ± (1110.42 - 1122.48) ms1119.41 ± (1120.16 - 1132.36) ms+1.4%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.80 ± (22.73 - 22.88) ms23.07 ± (22.98 - 23.16) ms+1.2%✅⬆️
process.time_to_main_ms86.53 ± (86.10 - 86.96) ms87.19 ± (86.69 - 87.69) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.89 ± (10.89 - 10.89) MB10.91 ± (10.90 - 10.91) MB+0.2%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.77 ± (22.71 - 22.84) ms22.77 ± (22.71 - 22.84) ms+0.0%✅⬆️
process.time_to_main_ms87.45 ± (87.07 - 87.82) ms88.21 ± (87.78 - 88.64) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.93 - 10.93) 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_ms218.98 ± (217.61 - 220.35) ms219.13 ± (217.85 - 220.40) ms+0.1%✅⬆️
process.time_to_main_ms543.73 ± (542.54 - 544.91) ms546.50 ± (545.30 - 547.71) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.70 ± (52.68 - 52.72) MB52.54 ± (52.52 - 52.56) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.5%
.NET 6 - Baseline
process.internal_duration_ms21.52 ± (21.47 - 21.58) ms21.74 ± (21.67 - 21.81) ms+1.0%✅⬆️
process.time_to_main_ms73.89 ± (73.57 - 74.20) ms75.68 ± (75.31 - 76.05) ms+2.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.58 ± (10.58 - 10.59) MB10.63 ± (10.63 - 10.63) MB+0.4%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.65 ± (21.59 - 21.71) ms21.65 ± (21.58 - 21.72) ms-0.0%
process.time_to_main_ms76.41 ± (76.07 - 76.75) ms76.32 ± (75.95 - 76.69) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.64 ± (10.64 - 10.65) MB10.67 ± (10.67 - 10.67) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms205.47 ± (204.33 - 206.61) ms207.94 ± (206.49 - 209.39) ms+1.2%✅⬆️
process.time_to_main_ms510.54 ± (509.45 - 511.62) ms514.90 ± (513.79 - 516.01) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.81 ± (51.77 - 51.84) MB51.71 ± (51.68 - 51.74) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.64 ± (19.59 - 19.70) ms19.82 ± (19.76 - 19.88) ms+0.9%✅⬆️
process.time_to_main_ms73.72 ± (73.44 - 74.00) ms74.63 ± (74.30 - 74.96) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.63 ± (7.63 - 7.64) MB7.64 ± (7.64 - 7.65) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.71 ± (19.65 - 19.76) ms20.12 ± (20.00 - 20.23) ms+2.1%✅⬆️
process.time_to_main_ms75.63 ± (75.26 - 76.00) ms77.81 ± (77.23 - 78.40) ms+2.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.67 - 7.68) MB7.70 ± (7.69 - 7.70) MB+0.3%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms189.00 ± (188.14 - 189.85) ms190.33 ± (189.35 - 191.30) ms+0.7%✅⬆️
process.time_to_main_ms490.71 ± (489.88 - 491.55) ms485.00 ± (484.07 - 485.92) ms-1.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.98 ± (38.94 - 39.02) MB38.85 ± (38.81 - 38.89) MB-0.3%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.0%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration192.23 ± (191.81 - 192.46) ms192.47 ± (192.30 - 193.05) ms+0.1%✅⬆️
.NET Framework 4.8 - Bailout
duration196.60 ± (196.47 - 197.36) ms195.76 ± (195.71 - 196.23) ms-0.4%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1152.64 ± (1154.01 - 1161.32) ms1154.22 ± (1157.41 - 1165.79) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms187.95 ± (187.48 - 188.42) ms187.27 ± (186.87 - 187.68) ms-0.4%
process.time_to_main_ms80.88 ± (80.67 - 81.08) ms80.42 ± (80.21 - 80.62) ms-0.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.07 - 16.13) MB16.01 ± (15.99 - 16.04) MB-0.5%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.8%
.NET Core 3.1 - Bailout
process.internal_duration_ms186.19 ± (185.92 - 186.47) ms187.20 ± (186.84 - 187.55) ms+0.5%✅⬆️
process.time_to_main_ms81.70 ± (81.55 - 81.85) ms81.75 ± (81.57 - 81.92) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.11 - 16.17) MB16.07 ± (16.05 - 16.10) MB-0.4%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.6%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms391.47 ± (388.99 - 393.95) ms397.45 ± (394.73 - 400.18) ms+1.5%✅⬆️
process.time_to_main_ms516.77 ± (516.14 - 517.40) ms518.42 ± (517.67 - 519.17) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.80 ± (62.64 - 62.95) MB62.84 ± (62.68 - 62.99) MB+0.1%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms191.54 ± (191.14 - 191.94) ms191.08 ± (190.69 - 191.46) ms-0.2%
process.time_to_main_ms69.75 ± (69.55 - 69.95) ms69.55 ± (69.35 - 69.75) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.06 ± (15.93 - 16.20) MB16.05 ± (15.90 - 16.19) MB-0.1%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.7%
.NET 6 - Bailout
process.internal_duration_ms190.74 ± (190.33 - 191.15) ms190.90 ± (190.43 - 191.37) ms+0.1%✅⬆️
process.time_to_main_ms70.64 ± (70.50 - 70.78) ms70.40 ± (70.26 - 70.53) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.99 ± (15.83 - 16.14) MB15.99 ± (15.83 - 16.15) MB-0.0%
runtime.dotnet.threads.count19 ± (19 - 20)19 ± (19 - 19)-1.4%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms410.46 ± (407.37 - 413.56) ms409.76 ± (406.83 - 412.70) ms-0.2%
process.time_to_main_ms488.12 ± (487.51 - 488.72) ms487.00 ± (486.32 - 487.68) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.20 ± (62.05 - 62.35) MB62.18 ± (62.03 - 62.33) MB-0.0%
runtime.dotnet.threads.count30 ± (29 - 30)29 ± (29 - 30)-0.0%
.NET 8 - Baseline
process.internal_duration_ms189.00 ± (188.65 - 189.35) ms189.16 ± (188.90 - 189.43) ms+0.1%✅⬆️
process.time_to_main_ms69.15 ± (68.99 - 69.32) ms68.84 ± (68.68 - 69.00) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.71 ± (11.68 - 11.74) MB11.73 ± (11.70 - 11.75) MB+0.2%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.8%
.NET 8 - Bailout
process.internal_duration_ms188.25 ± (188.04 - 188.46) ms189.86 ± (189.46 - 190.26) ms+0.9%✅⬆️
process.time_to_main_ms70.13 ± (70.04 - 70.23) ms70.42 ± (70.25 - 70.58) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.84 ± (11.81 - 11.87) MB11.74 ± (11.71 - 11.77) MB-0.8%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.3%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms359.55 ± (358.02 - 361.08) ms360.72 ± (359.14 - 362.30) ms+0.3%✅⬆️
process.time_to_main_ms466.78 ± (466.19 - 467.38) ms460.53 ± (459.87 - 461.19) ms-1.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.46 ± (50.42 - 50.50) MB50.35 ± (50.31 - 50.39) MB-0.2%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.1%
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 (7736) - mean (75ms)  : 70, 80
    master - mean (74ms)  : 69, 79

    section Bailout
    This PR (7736) - mean (80ms)  : 72, 87
    master - mean (80ms)  : 73, 86

    section CallTarget+Inlining+NGEN
    This PR (7736) - mean (1,126ms)  : 1031, 1221
    master - mean (1,116ms)  : 1023, 1210

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 (7736) - mean (118ms)  : 108, 128
    master - mean (117ms)  : 110, 124

    section Bailout
    This PR (7736) - mean (119ms)  : 109, 128
    master - mean (118ms)  : 111, 124

    section CallTarget+Inlining+NGEN
    This PR (7736) - mean (806ms)  : 775, 837
    master - mean (802ms)  : 764, 840

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7736) - mean (104ms)  : 96, 113
    master - mean (102ms)  : 97, 108

    section Bailout
    This PR (7736) - mean (105ms)  : 98, 112
    master - mean (105ms)  : 98, 112

    section CallTarget+Inlining+NGEN
    This PR (7736) - mean (762ms)  : 725, 799
    master - mean (747ms)  : 715, 779

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

    section Bailout
    This PR (7736) - mean (107ms)  : 96, 117
    master - mean (104ms)  : 97, 110

    section CallTarget+Inlining+NGEN
    This PR (7736) - mean (717ms)  : 682, 752
    master - mean (716ms)  : 690, 742

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

    section Bailout
    This PR (7736) - mean (196ms)  : 193, 198
    master - mean (197ms)  : 192, 201

    section CallTarget+Inlining+NGEN
    This PR (7736) - mean (1,162ms)  : 1101, 1222
    master - mean (1,158ms)  : 1105, 1211

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 (7736) - mean (276ms)  : 270, 282
    master - mean (277ms)  : 271, 283

    section Bailout
    This PR (7736) - mean (277ms)  : 272, 282
    master - mean (276ms)  : 271, 281

    section CallTarget+Inlining+NGEN
    This PR (7736) - mean (946ms)  : 891, 1001
    master - mean (944ms)  : 908, 980

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7736) - mean (269ms)  : 263, 275
    master - mean (269ms)  : 263, 276

    section Bailout
    This PR (7736) - mean (269ms)  : 264, 274
    master - mean (270ms)  : 264, 275

    section CallTarget+Inlining+NGEN
    This PR (7736) - mean (927ms)  : 881, 973
    master - mean (934ms)  : 873, 995

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

    section Bailout
    This PR (7736) - mean (270ms)  : 264, 275
    master - mean (268ms)  : 265, 271

    section CallTarget+Inlining+NGEN
    This PR (7736) - mean (852ms)  : 836, 869
    master - mean (858ms)  : 838, 878

Loading

@pr-commenter
Copy link

pr-commenter bot commented Nov 6, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7736 compared to master:

  • 3 benchmarks are slower, with geometric mean 1.489
  • 5 benchmarks have fewer allocations
  • 5 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 #7736

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 5.99 KB 6.1 KB 105 B 1.75%

Fewer allocations 🎉 in #7736

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.67 KB 5.61 KB -63 B -1.11%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.4μs 58.6ns 389ns 0 0 0 5.52 KB
master StartStopWithChild netcoreapp3.1 14.2μs 72.1ns 330ns 0 0 0 5.67 KB
master StartStopWithChild net472 22.4μs 88.4ns 342ns 1.05 0.418 0.105 5.99 KB
#7736 StartStopWithChild net6.0 10.6μs 57.7ns 321ns 0 0 0 5.51 KB
#7736 StartStopWithChild netcoreapp3.1 13.7μs 68.9ns 331ns 0 0 0 5.61 KB
#7736 StartStopWithChild net472 22.3μs 103ns 485ns 0.938 0.312 0 6.1 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7736

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 927μs 64.7ns 242ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.06ms 846ns 3.28μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.19ms 71.4ns 267ns 0 0 0 3.35 KB
#7736 WriteAndFlushEnrichedTraces net6.0 941μs 62.5ns 234ns 0 0 0 2.71 KB
#7736 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 202ns 783ns 0 0 0 2.7 KB
#7736 WriteAndFlushEnrichedTraces net472 1.2ms 1.3μs 5.04μ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.07μs 1.45ns 5.62ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.46μs 7.77ns 38.9ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.03μs 0.654ns 2.53ns 0.195 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 6.99μs 35.2ns 153ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.01μs 24.8ns 96.2ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.6μs 4.46ns 17.3ns 0.726 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 325ns 1.22ns 4.71ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 414ns 2.12ns 9.94ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 295ns 0.0121ns 0.0419ns 0.0432 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.43μs 1.62ns 6.26ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.81μs 36.9ns 143ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.73μs 4.21ns 16.3ns 0.574 0 0 3.8 KB
#7736 AllCycleSimpleBody net6.0 1.07μs 6.25ns 55.9ns 0 0 0 1.22 KB
#7736 AllCycleSimpleBody netcoreapp3.1 1.4μs 6.89ns 29.2ns 0 0 0 1.2 KB
#7736 AllCycleSimpleBody net472 1.05μs 0.284ns 1.03ns 0.192 0 0 1.23 KB
#7736 AllCycleMoreComplexBody net6.0 7.52μs 2.25ns 8.72ns 0 0 0 4.72 KB
#7736 AllCycleMoreComplexBody netcoreapp3.1 8.89μs 28ns 108ns 0 0 0 4.62 KB
#7736 AllCycleMoreComplexBody net472 7.59μs 5.27ns 20.4ns 0.721 0 0 4.74 KB
#7736 ObjectExtractorSimpleBody net6.0 316ns 1.69ns 9.58ns 0 0 0 280 B
#7736 ObjectExtractorSimpleBody netcoreapp3.1 400ns 0.107ns 0.416ns 0 0 0 272 B
#7736 ObjectExtractorSimpleBody net472 299ns 0.0129ns 0.0483ns 0.0436 0 0 281 B
#7736 ObjectExtractorMoreComplexBody net6.0 6.32μs 25.2ns 97.8ns 0 0 0 3.78 KB
#7736 ObjectExtractorMoreComplexBody netcoreapp3.1 7.84μs 34.1ns 132ns 0 0 0 3.69 KB
#7736 ObjectExtractorMoreComplexBody net472 6.66μs 2.52ns 9.75ns 0.602 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.7μs 260ns 971ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 98.4μs 168ns 649ns 0 0 0 32.4 KB
master EncodeArgs net472 112μs 20.3ns 78.5ns 5.04 0 0 32.51 KB
master EncodeLegacyArgs net6.0 146μs 216ns 837ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 201μs 577ns 2.23μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 261μs 20.2ns 75.7ns 0 0 0 2.17 KB
#7736 EncodeArgs net6.0 76.3μs 354ns 1.37μs 0 0 0 32.4 KB
#7736 EncodeArgs netcoreapp3.1 97.9μs 280ns 1.08μs 0 0 0 32.4 KB
#7736 EncodeArgs net472 111μs 43.4ns 168ns 4.98 0 0 32.51 KB
#7736 EncodeLegacyArgs net6.0 143μs 13.1ns 50.8ns 0 0 0 2.14 KB
#7736 EncodeLegacyArgs netcoreapp3.1 195μs 92.5ns 334ns 0 0 0 2.14 KB
#7736 EncodeLegacyArgs net472 263μs 17.3ns 62.3ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7736

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.383 309,215.00 736,882.12

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 400μs 102ns 368ns 0 0 0 4.56 KB
master RunWafRealisticBenchmark netcoreapp3.1 828μs 13.1μs 131μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 429μs 30.2ns 113ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 287μs 85.1ns 318ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 309μs 221ns 827ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 309μs 29.2ns 109ns 0 0 0 2.29 KB
#7736 RunWafRealisticBenchmark net6.0 397μs 88.6ns 331ns 0 0 0 4.55 KB
#7736 RunWafRealisticBenchmark netcoreapp3.1 850μs 5.41μs 53.6μs 0 0 0 4.48 KB
#7736 RunWafRealisticBenchmark net472 429μs 50.6ns 196ns 0 0 0 4.68 KB
#7736 RunWafRealisticBenchmarkWithAttack net6.0 282μs 59ns 221ns 0 0 0 2.24 KB
#7736 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 687μs 10.1μs 101μs 0 0 0 2.22 KB
#7736 RunWafRealisticBenchmarkWithAttack net472 310μs 42.9ns 161ns 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.1μs 60.4ns 218ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 72.8μs 98.1ns 367ns 0 0 0 17.42 KB
master SendRequest net472 0.00895ns 0.0023ns 0.00862ns 0 0 0 0 b
#7736 SendRequest net6.0 61.7μs 56.5ns 211ns 0 0 0 14.52 KB
#7736 SendRequest netcoreapp3.1 73μs 278ns 1μs 0 0 0 17.42 KB
#7736 SendRequest net472 0.00183ns 0.00124ns 0.00479ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7736

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 1 B 18 B 17 B 1,700.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 4 B 5 B 1 B 25.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.95ms 5.87μs 22.7μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.08ms 6.07μs 23.5μs 0 0 0 640 KB
master OriginalCharSlice net472 2.59ms 529ns 1.91μs 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.46ms 320ns 1.24μs 0 0 0 4 B
master OptimizedCharSlice netcoreapp3.1 1.75ms 544ns 2.11μs 0 0 0 1 B
master OptimizedCharSlice net472 1.9ms 262ns 1.02μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 826μs 26.8ns 100ns 0 0 0 4 B
master OptimizedCharSliceWithPool netcoreapp3.1 840μs 141ns 544ns 0 0 0 1 B
master OptimizedCharSliceWithPool net472 1.22ms 248ns 959ns 0 0 0 0 b
#7736 OriginalCharSlice net6.0 1.87ms 279ns 1.04μs 0 0 0 640.01 KB
#7736 OriginalCharSlice netcoreapp3.1 2.2ms 7.54μs 26.1μs 0 0 0 640 KB
#7736 OriginalCharSlice net472 2.64ms 111ns 432ns 100 0 0 641.95 KB
#7736 OptimizedCharSlice net6.0 1.38ms 399ns 1.55μs 0 0 0 5 B
#7736 OptimizedCharSlice netcoreapp3.1 1.68ms 386ns 1.5μs 0 0 0 1 B
#7736 OptimizedCharSlice net472 1.91ms 342ns 1.32μs 0 0 0 0 b
#7736 OptimizedCharSliceWithPool net6.0 825μs 41.8ns 162ns 0 0 0 4 B
#7736 OptimizedCharSliceWithPool netcoreapp3.1 811μs 41.3ns 155ns 0 0 0 18 B
#7736 OptimizedCharSliceWithPool net472 1.18ms 121ns 471ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7736

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 1.134 642,108.12 728,180.42

More allocations ⚠️ in #7736

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.65 KB 42.59 KB 942 B 2.26%
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 56.12 KB 56.46 KB 340 B 0.61%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 642μs 488ns 1.89μs 0 0 0 41.65 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 692μs 2.32μs 8.38μs 0 0 0 42.17 KB
master WriteAndFlushEnrichedTraces net472 897μs 4.28μs 16.6μs 8.33 0 0 56.12 KB
#7736 WriteAndFlushEnrichedTraces net6.0 717μs 4.1μs 32μs 0 0 0 42.59 KB
#7736 WriteAndFlushEnrichedTraces netcoreapp3.1 756μs 684ns 2.65μs 0 0 0 42.29 KB
#7736 WriteAndFlushEnrichedTraces net472 841μs 2.16μs 8.1μs 8.33 0 0 56.46 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.9μs 1.28ns 4.78ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.68μs 11.8ns 45.6ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.9μs 6.14ns 21.3ns 0.144 0.0144 0 987 B
#7736 ExecuteNonQuery net6.0 1.96μs 3.34ns 12.9ns 0 0 0 1.02 KB
#7736 ExecuteNonQuery netcoreapp3.1 2.69μs 4.61ns 17.8ns 0 0 0 1.02 KB
#7736 ExecuteNonQuery net472 2.93μs 4.58ns 17.7ns 0.146 0.0146 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.74μs 0.596ns 2.31ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.2μs 11.4ns 54.5ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.52μs 1.9ns 7.36ns 0.158 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.92μs 4.09ns 15.3ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.35μs 8.99ns 33.6ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.7μs 1.85ns 6.93ns 0.166 0 0 1.1 KB
#7736 CallElasticsearch net6.0 1.67μs 8.93ns 49.7ns 0 0 0 1.03 KB
#7736 CallElasticsearch netcoreapp3.1 2.21μs 9.56ns 37ns 0 0 0 1.03 KB
#7736 CallElasticsearch net472 3.51μs 2.97ns 11.1ns 0.158 0 0 1.04 KB
#7736 CallElasticsearchAsync net6.0 1.86μs 1.05ns 4.08ns 0 0 0 1.01 KB
#7736 CallElasticsearchAsync netcoreapp3.1 2.33μs 10.1ns 39.1ns 0 0 0 1.08 KB
#7736 CallElasticsearchAsync net472 3.67μs 2.28ns 8.53ns 0.165 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.83μs 1.05ns 3.95ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.53μs 11.6ns 44.8ns 0 0 0 952 B
master ExecuteAsync net472 2.56μs 1.3ns 5.04ns 0.142 0 0 915 B
#7736 ExecuteAsync net6.0 1.89μs 6.57ns 25.4ns 0 0 0 952 B
#7736 ExecuteAsync netcoreapp3.1 2.42μs 9.73ns 37.7ns 0 0 0 952 B
#7736 ExecuteAsync net472 2.55μs 4.88ns 18.9ns 0.141 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 6.86μs 10.9ns 40.8ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.33μs 26.3ns 102ns 0 0 0 2.9 KB
master SendAsync net472 12.1μs 7.49ns 28ns 0.482 0 0 3.18 KB
#7736 SendAsync net6.0 6.8μs 17.8ns 68.8ns 0 0 0 2.36 KB
#7736 SendAsync netcoreapp3.1 8.58μs 24.9ns 96.5ns 0 0 0 2.9 KB
#7736 SendAsync net472 12.2μs 7.3ns 27.3ns 0.484 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ Fewer allocations 🎉

Slower ⚠️ in #7736

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 1.221 46,700.00 57,000.00 several?

Fewer allocations 🎉 in #7736

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 44.04 KB 42.85 KB -1.19 KB -2.71%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 46.16 KB 44.65 KB -1.51 KB -3.28%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 274.06 KB 255.45 KB -18.61 KB -6.79%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 43.2μs 260ns 2.45μs 0 0 0 46.16 KB
master StringConcatBenchmark netcoreapp3.1 46.8μs 168ns 606ns 0 0 0 44.04 KB
master StringConcatBenchmark net472 56.8μs 227ns 849ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 470μs 1.36μs 4.71μs 0 0 0 278.21 KB
master StringConcatAspectBenchmark netcoreapp3.1 553μs 1.31μs 4.9μs 0 0 0 274.06 KB
master StringConcatAspectBenchmark net472 411μs 2.01μs 13.3μs 0 0 0 278.53 KB
#7736 StringConcatBenchmark net6.0 49.3μs 826ns 8.14μs 0 0 0 44.65 KB
#7736 StringConcatBenchmark netcoreapp3.1 57.3μs 688ns 6.77μs 0 0 0 42.85 KB
#7736 StringConcatBenchmark net472 57.1μs 301ns 1.48μs 0 0 0 57.34 KB
#7736 StringConcatAspectBenchmark net6.0 504μs 1.89μs 6.82μs 0 0 0 279.14 KB
#7736 StringConcatAspectBenchmark netcoreapp3.1 507μs 1.94μs 7.5μs 0 0 0 255.45 KB
#7736 StringConcatAspectBenchmark net472 403μs 1.98μs 7.91μs 0 0 0 278.53 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.68μs 10.7ns 41.6ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.6μs 17ns 70.3ns 0 0 0 1.7 KB
master EnrichedLog net472 4.04μs 4.82ns 18ns 0.24 0 0 1.64 KB
#7736 EnrichedLog net6.0 2.69μs 12.4ns 49.6ns 0 0 0 1.7 KB
#7736 EnrichedLog netcoreapp3.1 3.55μs 17ns 65.9ns 0 0 0 1.7 KB
#7736 EnrichedLog net472 4.06μs 6.83ns 26.4ns 0.242 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 137μs 243ns 875ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 130μs 678ns 3.96μs 0 0 0 4.31 KB
master EnrichedLog net472 174μs 980ns 6.65μs 0 0 0 4.51 KB
#7736 EnrichedLog net6.0 128μs 328ns 1.23μs 0 0 0 4.31 KB
#7736 EnrichedLog netcoreapp3.1 129μs 58.4ns 210ns 0 0 0 4.31 KB
#7736 EnrichedLog net472 168μs 51.8ns 187ns 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.96μs 25.1ns 109ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.68μs 30.2ns 117ns 0 0 0 2.26 KB
master EnrichedLog net472 7.55μs 9.55ns 37ns 0.3 0 0 2.08 KB
#7736 EnrichedLog net6.0 5.08μs 7.21ns 27ns 0 0 0 2.26 KB
#7736 EnrichedLog netcoreapp3.1 6.82μs 14.2ns 54.9ns 0 0 0 2.26 KB
#7736 EnrichedLog net472 7.58μs 5.82ns 22.5ns 0.303 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.04μs 3.2ns 12.4ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.69μs 12ns 43.1ns 0 0 0 1.2 KB
master SendReceive net472 3.04μs 2.74ns 10.6ns 0.183 0 0 1.2 KB
#7736 SendReceive net6.0 1.95μs 10.6ns 56.1ns 0 0 0 1.2 KB
#7736 SendReceive netcoreapp3.1 2.67μs 12.6ns 48.7ns 0 0 0 1.2 KB
#7736 SendReceive net472 3.1μs 1.76ns 6.81ns 0.187 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.31μs 16.4ns 61.5ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.77μs 9.03ns 35ns 0 0 0 1.63 KB
master EnrichedLog net472 6.52μs 7.68ns 29.7ns 0.293 0 0 2.03 KB
#7736 EnrichedLog net6.0 4.2μs 17.2ns 66.6ns 0 0 0 1.58 KB
#7736 EnrichedLog netcoreapp3.1 5.45μs 13.3ns 49.8ns 0 0 0 1.63 KB
#7736 EnrichedLog net472 6.64μs 5.03ns 19.5ns 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 769ns 4.12ns 21.8ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 943ns 4.54ns 17.6ns 0 0 0 576 B
master StartFinishSpan net472 919ns 0.765ns 2.96ns 0.0877 0 0 578 B
master StartFinishScope net6.0 938ns 0.458ns 1.71ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.2μs 5.39ns 20.9ns 0 0 0 696 B
master StartFinishScope net472 1.13μs 0.537ns 2.08ns 0.101 0 0 658 B
#7736 StartFinishSpan net6.0 794ns 4.09ns 18.3ns 0 0 0 576 B
#7736 StartFinishSpan netcoreapp3.1 973ns 0.664ns 2.48ns 0 0 0 576 B
#7736 StartFinishSpan net472 916ns 0.526ns 2.04ns 0.0875 0 0 578 B
#7736 StartFinishScope net6.0 922ns 4.63ns 21.2ns 0 0 0 696 B
#7736 StartFinishScope netcoreapp3.1 1.2μs 5.62ns 22.5ns 0 0 0 696 B
#7736 StartFinishScope net472 1.11μs 0.627ns 2.43ns 0.0998 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.05μs 0.921ns 3.57ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.43μs 5.48ns 21.2ns 0 0 0 696 B
master RunOnMethodBegin net472 1.46μs 0.823ns 3.19ns 0.102 0 0 658 B
#7736 RunOnMethodBegin net6.0 1.09μs 5.35ns 22ns 0 0 0 696 B
#7736 RunOnMethodBegin netcoreapp3.1 1.43μs 7.22ns 31.5ns 0 0 0 696 B
#7736 RunOnMethodBegin net472 1.45μs 1.06ns 4.1ns 0.102 0 0 658 B

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

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos area:integrations identified-by:telemetry type:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants