Add a ValueStringBuilder for .NET 6#7962
Conversation
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7962) and master.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 68.13 ± (68.13 - 68.35) ms | 73.94 ± (73.95 - 74.24) ms | +8.5% | ❌⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 71.94 ± (71.81 - 72.01) ms | 78.20 ± (78.12 - 78.47) ms | +8.7% | ❌⬆️ |
Full Metrics Comparison
FakeDbCommand
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 68.13 ± (68.13 - 68.35) ms | 73.94 ± (73.95 - 74.24) ms | +8.5% | ❌⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 71.94 ± (71.81 - 72.01) ms | 78.20 ± (78.12 - 78.47) ms | +8.7% | ❌⬆️ |
| .NET Framework 4.8 - CallTarget+Inlining+NGEN | ||||
| duration | 1001.47 ± (1007.97 - 1017.63) ms | 1049.00 ± (1052.06 - 1062.10) ms | +4.7% | ✅⬆️ |
| .NET Core 3.1 - Baseline | ||||
| process.internal_duration_ms | 21.96 ± (21.94 - 21.99) ms | 22.82 ± (22.78 - 22.86) ms | +3.9% | ✅⬆️ |
| process.time_to_main_ms | 78.40 ± (78.23 - 78.56) ms | 84.43 ± (84.23 - 84.62) ms | +7.7% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.91 ± (10.90 - 10.91) MB | 10.93 ± (10.92 - 10.94) MB | +0.2% | ✅⬆️ |
| runtime.dotnet.threads.count | 12 ± (12 - 12) | 12 ± (12 - 12) | +0.0% | ✅ |
| .NET Core 3.1 - Bailout | ||||
| process.internal_duration_ms | 21.90 ± (21.88 - 21.92) ms | 22.73 ± (22.70 - 22.77) ms | +3.8% | ✅⬆️ |
| process.time_to_main_ms | 79.42 ± (79.33 - 79.52) ms | 86.10 ± (85.91 - 86.29) ms | +8.4% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.94 ± (10.94 - 10.94) MB | 10.95 ± (10.95 - 10.96) MB | +0.1% | ✅⬆️ |
| runtime.dotnet.threads.count | 13 ± (13 - 13) | 13 ± (13 - 13) | +0.0% | ✅ |
| .NET Core 3.1 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 211.56 ± (209.85 - 213.28) ms | 221.32 ± (219.68 - 222.96) ms | +4.6% | ✅⬆️ |
| process.time_to_main_ms | 471.87 ± (471.29 - 472.45) ms | 495.45 ± (494.67 - 496.24) ms | +5.0% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 48.05 ± (48.03 - 48.07) MB | 48.04 ± (48.02 - 48.06) MB | -0.0% | ✅ |
| runtime.dotnet.threads.count | 28 ± (28 - 28) | 28 ± (28 - 28) | +0.0% | ✅ |
| .NET 6 - Baseline | ||||
| process.internal_duration_ms | 20.59 ± (20.55 - 20.62) ms | 21.35 ± (21.32 - 21.38) ms | +3.7% | ✅⬆️ |
| process.time_to_main_ms | 67.89 ± (67.74 - 68.03) ms | 73.17 ± (73.01 - 73.33) ms | +7.8% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.62 ± (10.62 - 10.62) MB | 10.64 ± (10.64 - 10.64) MB | +0.2% | ✅⬆️ |
| runtime.dotnet.threads.count | 10 ± (10 - 10) | 10 ± (10 - 10) | +0.0% | ✅ |
| .NET 6 - Bailout | ||||
| process.internal_duration_ms | 20.51 ± (20.49 - 20.54) ms | 21.45 ± (21.40 - 21.50) ms | +4.6% | ✅⬆️ |
| process.time_to_main_ms | 68.69 ± (68.64 - 68.75) ms | 74.40 ± (74.24 - 74.55) ms | +8.3% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.68 ± (10.68 - 10.69) MB | 10.68 ± (10.67 - 10.68) MB | -0.1% | ✅ |
| runtime.dotnet.threads.count | 11 ± (11 - 11) | 11 ± (11 - 11) | +0.0% | ✅ |
| .NET 6 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 201.55 ± (200.42 - 202.69) ms | 207.08 ± (206.08 - 208.08) ms | +2.7% | ✅⬆️ |
| process.time_to_main_ms | 440.63 ± (439.88 - 441.38) ms | 463.98 ± (463.24 - 464.72) ms | +5.3% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 48.41 ± (48.36 - 48.47) MB | 48.52 ± (48.50 - 48.55) MB | +0.2% | ✅⬆️ |
| runtime.dotnet.threads.count | 28 ± (28 - 28) | 28 ± (28 - 28) | -0.1% | ✅ |
| .NET 8 - Baseline | ||||
| process.internal_duration_ms | 18.80 ± (18.78 - 18.82) ms | 19.63 ± (19.60 - 19.67) ms | +4.4% | ✅⬆️ |
| process.time_to_main_ms | 67.01 ± (66.91 - 67.11) ms | 72.91 ± (72.76 - 73.07) ms | +8.8% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 7.69 ± (7.68 - 7.70) MB | 7.68 ± (7.68 - 7.69) MB | -0.1% | ✅ |
| runtime.dotnet.threads.count | 10 ± (10 - 10) | 10 ± (10 - 10) | +0.0% | ✅ |
| .NET 8 - Bailout | ||||
| process.internal_duration_ms | 18.76 ± (18.73 - 18.78) ms | 19.57 ± (19.53 - 19.60) ms | +4.3% | ✅⬆️ |
| process.time_to_main_ms | 67.95 ± (67.89 - 68.02) ms | 74.18 ± (74.03 - 74.34) ms | +9.2% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 7.73 ± (7.72 - 7.74) MB | 7.73 ± (7.71 - 7.74) MB | -0.1% | ✅ |
| runtime.dotnet.threads.count | 11 ± (11 - 11) | 11 ± (11 - 11) | +0.0% | ✅ |
| .NET 8 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 178.28 ± (177.29 - 179.26) ms | 188.58 ± (187.64 - 189.52) ms | +5.8% | ✅⬆️ |
| process.time_to_main_ms | 421.86 ± (421.31 - 422.41) ms | 444.40 ± (443.75 - 445.06) ms | +5.3% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 36.26 ± (36.22 - 36.30) MB | 36.47 ± (36.42 - 36.51) MB | +0.6% | ✅⬆️ |
| runtime.dotnet.threads.count | 27 ± (27 - 27) | 27 ± (27 - 27) | -0.0% | ✅ |
HttpMessageHandler
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 193.44 ± (193.61 - 194.53) ms | 197.92 ± (197.97 - 198.92) ms | +2.3% | ✅⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 196.93 ± (196.66 - 197.21) ms | 198.22 ± (197.94 - 198.61) ms | +0.7% | ✅⬆️ |
| .NET Framework 4.8 - CallTarget+Inlining+NGEN | ||||
| duration | 1108.26 ± (1109.47 - 1116.57) ms | 1134.90 ± (1134.70 - 1144.31) ms | +2.4% | ✅⬆️ |
| .NET Core 3.1 - Baseline | ||||
| process.internal_duration_ms | 188.24 ± (187.80 - 188.68) ms | 191.34 ± (190.81 - 191.86) ms | +1.6% | ✅⬆️ |
| process.time_to_main_ms | 80.54 ± (80.34 - 80.74) ms | 82.21 ± (81.95 - 82.47) ms | +2.1% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.11 ± (16.08 - 16.14) MB | 16.07 ± (16.05 - 16.09) MB | -0.2% | ✅ |
| runtime.dotnet.threads.count | 20 ± (20 - 20) | 20 ± (20 - 20) | -0.6% | ✅ |
| .NET Core 3.1 - Bailout | ||||
| process.internal_duration_ms | 187.26 ± (186.95 - 187.57) ms | 188.89 ± (188.49 - 189.29) ms | +0.9% | ✅⬆️ |
| process.time_to_main_ms | 81.81 ± (81.68 - 81.94) ms | 82.74 ± (82.56 - 82.93) ms | +1.1% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.13 ± (16.10 - 16.16) MB | 16.19 ± (16.16 - 16.22) MB | +0.4% | ✅⬆️ |
| runtime.dotnet.threads.count | 21 ± (21 - 21) | 21 ± (21 - 21) | +0.7% | ✅⬆️ |
| .NET Core 3.1 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 398.33 ± (395.71 - 400.96) ms | 402.35 ± (399.54 - 405.15) ms | +1.0% | ✅⬆️ |
| process.time_to_main_ms | 476.18 ± (475.48 - 476.89) ms | 481.78 ± (480.89 - 482.68) ms | +1.2% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 58.66 ± (58.52 - 58.79) MB | 58.87 ± (58.76 - 58.98) MB | +0.4% | ✅⬆️ |
| runtime.dotnet.threads.count | 29 ± (29 - 30) | 30 ± (29 - 30) | +0.1% | ✅⬆️ |
| .NET 6 - Baseline | ||||
| process.internal_duration_ms | 191.96 ± (191.55 - 192.38) ms | 195.01 ± (194.59 - 195.44) ms | +1.6% | ✅⬆️ |
| process.time_to_main_ms | 69.95 ± (69.76 - 70.14) ms | 70.81 ± (70.61 - 71.01) ms | +1.2% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 15.96 ± (15.81 - 16.11) MB | 16.30 ± (16.27 - 16.32) MB | +2.1% | ✅⬆️ |
| runtime.dotnet.threads.count | 18 ± (18 - 19) | 19 ± (19 - 19) | +4.5% | ✅⬆️ |
| .NET 6 - Bailout | ||||
| process.internal_duration_ms | 191.01 ± (190.74 - 191.28) ms | 193.75 ± (193.27 - 194.23) ms | +1.4% | ✅⬆️ |
| process.time_to_main_ms | 70.83 ± (70.74 - 70.92) ms | 71.88 ± (71.72 - 72.04) ms | +1.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.16 ± (16.03 - 16.30) MB | 16.26 ± (16.17 - 16.36) MB | +0.6% | ✅⬆️ |
| runtime.dotnet.threads.count | 19 ± (19 - 19) | 20 ± (20 - 20) | +3.9% | ✅⬆️ |
| .NET 6 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 412.12 ± (409.68 - 414.56) ms | 411.92 ± (409.78 - 414.06) ms | -0.0% | ✅ |
| process.time_to_main_ms | 444.71 ± (443.94 - 445.49) ms | 448.90 ± (448.18 - 449.61) ms | +0.9% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 59.24 ± (59.11 - 59.36) MB | 59.29 ± (59.18 - 59.41) MB | +0.1% | ✅⬆️ |
| runtime.dotnet.threads.count | 29 ± (29 - 30) | 30 ± (29 - 30) | +0.2% | ✅⬆️ |
| .NET 8 - Baseline | ||||
| process.internal_duration_ms | 189.55 ± (189.25 - 189.84) ms | 193.34 ± (192.91 - 193.78) ms | +2.0% | ✅⬆️ |
| process.time_to_main_ms | 69.08 ± (68.91 - 69.25) ms | 70.67 ± (70.45 - 70.88) ms | +2.3% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 11.68 ± (11.66 - 11.71) MB | 11.65 ± (11.63 - 11.67) MB | -0.3% | ✅ |
| runtime.dotnet.threads.count | 18 ± (18 - 18) | 18 ± (18 - 18) | +0.6% | ✅⬆️ |
| .NET 8 - Bailout | ||||
| process.internal_duration_ms | 190.20 ± (189.78 - 190.61) ms | 193.80 ± (193.27 - 194.33) ms | +1.9% | ✅⬆️ |
| process.time_to_main_ms | 70.35 ± (70.23 - 70.47) ms | 71.97 ± (71.75 - 72.20) ms | +2.3% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 11.77 ± (11.74 - 11.80) MB | 11.72 ± (11.70 - 11.75) MB | -0.4% | ✅ |
| runtime.dotnet.threads.count | 19 ± (19 - 19) | 19 ± (19 - 19) | +0.2% | ✅⬆️ |
| .NET 8 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 363.94 ± (362.59 - 365.29) ms | 372.52 ± (371.06 - 373.99) ms | +2.4% | ✅⬆️ |
| process.time_to_main_ms | 426.63 ± (426.06 - 427.19) ms | 436.10 ± (435.27 - 436.92) ms | +2.2% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 47.96 ± (47.93 - 47.99) MB | 47.97 ± (47.94 - 48.00) MB | +0.0% | ✅⬆️ |
| runtime.dotnet.threads.count | 29 ± (29 - 29) | 29 ± (29 - 29) | -0.4% | ✅ |
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 (7962) - mean (74ms) : 72, 76
master - mean (68ms) : 67, 70
section Bailout
This PR (7962) - mean (78ms) : crit, 76, 80
master - mean (72ms) : 71, 73
section CallTarget+Inlining+NGEN
This PR (7962) - mean (1,057ms) : 985, 1129
master - mean (1,013ms) : 941, 1084
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 (7962) - mean (114ms) : 110, 118
master - mean (106ms) : 103, 108
section Bailout
This PR (7962) - mean (116ms) : crit, 114, 118
master - mean (106ms) : 105, 107
section CallTarget+Inlining+NGEN
This PR (7962) - mean (753ms) : crit, 714, 792
master - mean (709ms) : 681, 737
FakeDbCommand (.NET 6)
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7962) - mean (101ms) : 98, 104
master - mean (93ms) : 91, 96
section Bailout
This PR (7962) - mean (102ms) : crit, 100, 104
master - mean (94ms) : 93, 95
section CallTarget+Inlining+NGEN
This PR (7962) - mean (699ms) : 676, 722
master - mean (669ms) : 644, 695
FakeDbCommand (.NET 8)
gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7962) - mean (100ms) : 98, 103
master - mean (92ms) : 90, 94
section Bailout
This PR (7962) - mean (101ms) : crit, 99, 104
master - mean (93ms) : 91, 94
section CallTarget+Inlining+NGEN
This PR (7962) - mean (663ms) : 644, 682
master - mean (628ms) : 615, 642
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 (7962) - mean (198ms) : 191, 205
master - mean (194ms) : 189, 200
section Bailout
This PR (7962) - mean (198ms) : 195, 202
master - mean (197ms) : 194, 200
section CallTarget+Inlining+NGEN
This PR (7962) - mean (1,140ms) : 1069, 1210
master - mean (1,113ms) : 1062, 1164
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 (7962) - mean (282ms) : 270, 294
master - mean (277ms) : 271, 283
section Bailout
This PR (7962) - mean (280ms) : 275, 285
master - mean (277ms) : 274, 281
section CallTarget+Inlining+NGEN
This PR (7962) - mean (920ms) : 867, 973
master - mean (907ms) : 866, 949
HttpMessageHandler (.NET 6)
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7962) - mean (274ms) : 267, 281
master - mean (270ms) : 265, 276
section Bailout
This PR (7962) - mean (274ms) : 268, 281
master - mean (270ms) : 266, 274
section CallTarget+Inlining+NGEN
This PR (7962) - mean (895ms) : 846, 945
master - mean (890ms) : 845, 934
HttpMessageHandler (.NET 8)
gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7962) - mean (274ms) : 265, 283
master - mean (268ms) : 264, 272
section Bailout
This PR (7962) - mean (275ms) : 263, 288
master - mean (270ms) : 265, 275
section CallTarget+Inlining+NGEN
This PR (7962) - mean (839ms) : 806, 871
master - mean (822ms) : 803, 842
|
I thought we had this already, but it was me in a personal project 😅 I also had a TODO for myself from a long time ago to do this in |
## Summary of changes Small perf tweaks for existing `AspNetCoreDiagnosticObserver` ## Reason for change While experimenting with single span observer, noticed some (safe) tweaks we could make to the existing implementation. There are some other improvements we could make as well, but those are a little riskier, so may be best to delay them. ## Implementation details - Use `HttpContext.Items[string]` instead of `HttpContext.Features.Get<T>` as it's a bit faster - Make `Tracer`/`Security`/`Iast` inputs readonly, instead of using a null-coalesce with every access - Move check outside of `AddHeaderTagsToSpan` given common case is to avoid the function call ## Test coverage Covered by existing tests ## Other details https://datadoghq.atlassian.net/browse/LANGPLAT-842 Part of a stack - #7962 - #7963 👈 - #7964 - #7966 - #7965
## Summary of changes Adds a new `DD_TRACE_SINGLE_SPAN_ASPNETCORE_ENABLED` in which we omit the MVC span ## Reason for change - Addresses #4093 and partially #1147 - Omitting the MVC span has perf and some usability benefits in some cases (See issues above). It _does_ mean a certain amount of less information, particularly in pipeline re-execution scenarios ## Implementation details - Add a new, disabled by default, `DD_TRACE_SINGLE_SPAN_ASPNETCORE_ENABLED` for opting in to the new behaviour. - .NET 6+ only for various reasons - Cloned the original observer, deleted everything related to the MVC span, and then optimized further based on .NET 6+ and other improvements we can make ## Test coverage - Added in-process "integration" tests for the observer (more like unit tests), which mirror the exisitng. - Added "full" sample-based integration tests for basically all scenarios we currently test (IIS in process/out of process / MVC / minimal APIs / proxy spans etc) - Added snapshots by copying existing, and then updating, so if you look at the final commit, you can see the diff, which is basically just "delete the child span" ## Other details https://datadoghq.atlassian.net/browse/LANGPLAT-842 Part of a stack - #7962 - #7963 - #7964 👈 - #7966 - #7965 I experimented with some other perf improvements, but they didn't provide a significant improvement, so I reverted: - Caching the resource name by saving it into the `IEndpointMetadata` collection. The work to do that was too much, and you _can't_ cache in some cases anyway so not worth it - Splitting `WebTags` out to remove the IP headers unless we need them. They're disabled by default, so it just increase the size of the tags object, but wasn't a big enough improvement to make the complexity worth it. - Tried pooling the `RequestTrackingFeature` objects. This one _may_ actually be worth exploring again later, but I didn't see any improvement in my testing, as they're just not very big and only last 1 request. --------- Co-authored-by: Lucas Pimentel <lucas.pimentel@datadoghq.com>
## Summary of changes Creates an optimized version of `AspNetCoreResourceNameHelper` for use by the single-span Diagnostic observer. ## Reason for change We have the opportunity for a variety of optimizations thanks to not creating the MVC span, and the fact that we're .NET 6+. We could potentially include some or all of these optimizations in the existing observer path, but for safety/simplicity I'd rather keep it isolated for now, and we can look at expanding it more broadly later ## Implementation details - Use the `ValueStringBuilder` to build a resource name - Don't pre-grab MVC route values, wait to see if we have route params from them first - Write directly into the builder as `ToLowerInvariant`, instead of doing an extra ToLower() at the end ## Test coverage Added unit tests that use the existing data for the other implementations, to confirm it's identical. It's also covered indirectly by the integration tests ## Other details https://datadoghq.atlassian.net/browse/LANGPLAT-842 Part of a stack - #7962 - #7963 - #7964 - #7966 👈 - #7965
…7965) ## Summary of changes Adds a micro and macro benchmark for the new observer ## Reason for change Want to verify that it has performance benefits ## Implementation details - Added new scenario for macro - Duplicated existing scenario for micro and run. I would like to have had these as the same methods, but the "global" nature of diagnostic observers makes this difficult I think. ## Test coverage I'll manually trigger a run of the macro ## Other details https://datadoghq.atlassian.net/browse/LANGPLAT-842 Part of a stack - #7962 - #7963 - #7964 - #7966 - #7965 👈
Summary of changes
Adds a
ValueStringBuilderimplementation, based on the one used internally in the .NET runtimeReason for change
Span<char>StringBuilderCacheimplementation, and in some places that matters.Implementation details
Test coverage
Imported the unit tests from the runtime too
Other details
https://datadoghq.atlassian.net/browse/LANGPLAT-842
Part of a stack
ValueStringBuilderfor .NET 6 #7962 👈AspNetCoreDiagnosticObserver#7963AspNetCoreResourceNameHelper#7966