[Test Optimization] perf: logging/timing helpers#8070
Conversation
BenchmarksBenchmark execution time: 2026-01-30 12:13:33 Comparing candidate commit 90b2923 in PR branch Found 3 performance improvements and 14 performance regressions! Performance is the same for 160 metrics, 15 unstable metrics. scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1
scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0
scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1
scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0
scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0
scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
|
ad6c32d to
f0ccdd2
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8070) and master.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Bailout | ||||
| duration | 72.43 ± (72.33 - 72.57) ms | 77.76 ± (77.54 - 77.92) ms | +7.4% | ❌⬆️ |
Full Metrics Comparison
FakeDbCommand
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 68.49 ± (68.52 - 68.84) ms | 73.16 ± (73.21 - 73.56) ms | +6.8% | ✅⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 72.43 ± (72.33 - 72.57) ms | 77.76 ± (77.54 - 77.92) ms | +7.4% | ❌⬆️ |
| .NET Framework 4.8 - CallTarget+Inlining+NGEN | ||||
| duration | 1023.25 ± (1029.36 - 1039.28) ms | 1053.82 ± (1055.12 - 1062.71) ms | +3.0% | ✅⬆️ |
| .NET Core 3.1 - Baseline | ||||
| process.internal_duration_ms | 21.86 ± (21.83 - 21.88) ms | 22.71 ± (22.66 - 22.75) ms | +3.9% | ✅⬆️ |
| process.time_to_main_ms | 78.76 ± (78.61 - 78.92) ms | 86.37 ± (86.17 - 86.57) ms | +9.7% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.90 ± (10.90 - 10.91) MB | 10.92 ± (10.91 - 10.92) MB | +0.1% | ✅⬆️ |
| runtime.dotnet.threads.count | 12 ± (12 - 12) | 12 ± (12 - 12) | +0.0% | ✅ |
| .NET Core 3.1 - Bailout | ||||
| process.internal_duration_ms | 21.75 ± (21.73 - 21.77) ms | 22.59 ± (22.54 - 22.63) ms | +3.8% | ✅⬆️ |
| process.time_to_main_ms | 80.02 ± (79.91 - 80.12) ms | 87.34 ± (87.16 - 87.52) ms | +9.2% | ✅⬆️ |
| 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 | 241.72 ± (238.00 - 245.43) ms | 238.84 ± (234.92 - 242.77) ms | -1.2% | ✅ |
| process.time_to_main_ms | 474.07 ± (473.38 - 474.76) ms | 505.28 ± (504.39 - 506.18) ms | +6.6% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 48.56 ± (48.54 - 48.59) MB | 48.58 ± (48.56 - 48.60) MB | +0.0% | ✅⬆️ |
| runtime.dotnet.threads.count | 28 ± (28 - 28) | 28 ± (28 - 28) | -0.8% | ✅ |
| .NET 6 - Baseline | ||||
| process.internal_duration_ms | 20.65 ± (20.62 - 20.69) ms | 21.56 ± (21.52 - 21.60) ms | +4.4% | ✅⬆️ |
| process.time_to_main_ms | 68.36 ± (68.23 - 68.49) ms | 74.83 ± (74.65 - 75.00) ms | +9.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.62 ± (10.61 - 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.52 ± (20.49 - 20.54) ms | 21.44 ± (21.39 - 21.49) ms | +4.5% | ✅⬆️ |
| process.time_to_main_ms | 69.27 ± (69.21 - 69.33) ms | 75.20 ± (75.02 - 75.38) ms | +8.6% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 10.67 ± (10.67 - 10.67) MB | 10.75 ± (10.75 - 10.76) MB | +0.8% | ✅⬆️ |
| runtime.dotnet.threads.count | 11 ± (11 - 11) | 11 ± (11 - 11) | +0.0% | ✅ |
| .NET 6 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 250.13 ± (249.04 - 251.22) ms | 238.31 ± (234.35 - 242.26) ms | -4.7% | ✅ |
| process.time_to_main_ms | 451.92 ± (451.43 - 452.42) ms | 478.00 ± (477.30 - 478.70) ms | +5.8% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 49.29 ± (49.26 - 49.32) MB | 49.30 ± (49.27 - 49.32) MB | +0.0% | ✅⬆️ |
| runtime.dotnet.threads.count | 28 ± (28 - 28) | 28 ± (28 - 28) | -0.1% | ✅ |
| .NET 8 - Baseline | ||||
| process.internal_duration_ms | 18.70 ± (18.67 - 18.72) ms | 19.66 ± (19.62 - 19.69) ms | +5.1% | ✅⬆️ |
| process.time_to_main_ms | 67.05 ± (66.95 - 67.16) ms | 73.73 ± (73.56 - 73.90) ms | +10.0% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 7.69 ± (7.68 - 7.69) MB | 7.69 ± (7.68 - 7.70) MB | +0.0% | ✅⬆️ |
| runtime.dotnet.threads.count | 10 ± (10 - 10) | 10 ± (10 - 10) | +0.0% | ✅ |
| .NET 8 - Bailout | ||||
| process.internal_duration_ms | 18.74 ± (18.71 - 18.76) ms | 19.72 ± (19.68 - 19.77) ms | +5.3% | ✅⬆️ |
| process.time_to_main_ms | 68.32 ± (68.25 - 68.38) ms | 75.39 ± (75.22 - 75.57) ms | +10.4% | ✅⬆️ |
| 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.73 - 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.01 ± (177.28 - 178.75) ms | 187.74 ± (187.01 - 188.47) ms | +5.5% | ✅⬆️ |
| process.time_to_main_ms | 435.35 ± (434.71 - 436.00) ms | 459.31 ± (458.52 - 460.09) ms | +5.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 0 ± (0 - 0) | 0 ± (0 - 0) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 36.69 ± (36.66 - 36.72) MB | 36.78 ± (36.75 - 36.81) MB | +0.3% | ✅⬆️ |
| runtime.dotnet.threads.count | 27 ± (27 - 27) | 27 ± (27 - 27) | -0.4% | ✅ |
HttpMessageHandler
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 193.95 ± (194.21 - 195.30) ms | 194.04 ± (193.91 - 194.73) ms | +0.0% | ✅⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 197.41 ± (197.38 - 197.93) ms | 198.06 ± (198.03 - 198.81) ms | +0.3% | ✅⬆️ |
| .NET Framework 4.8 - CallTarget+Inlining+NGEN | ||||
| duration | 1137.50 ± (1138.97 - 1147.41) ms | 1149.20 ± (1154.47 - 1164.46) ms | +1.0% | ✅⬆️ |
| .NET Core 3.1 - Baseline | ||||
| process.internal_duration_ms | 188.25 ± (187.91 - 188.59) ms | 188.52 ± (188.15 - 188.89) ms | +0.1% | ✅⬆️ |
| process.time_to_main_ms | 81.73 ± (81.44 - 82.02) ms | 81.91 ± (81.69 - 82.13) ms | +0.2% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.15 ± (16.12 - 16.18) MB | 16.09 ± (16.07 - 16.11) MB | -0.4% | ✅ |
| runtime.dotnet.threads.count | 20 ± (19 - 20) | 20 ± (19 - 20) | +0.1% | ✅⬆️ |
| .NET Core 3.1 - Bailout | ||||
| process.internal_duration_ms | 187.65 ± (187.35 - 187.95) ms | 187.64 ± (187.36 - 187.93) ms | -0.0% | ✅ |
| process.time_to_main_ms | 82.80 ± (82.66 - 82.94) ms | 83.08 ± (82.94 - 83.23) ms | +0.3% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.20 ± (16.17 - 16.23) MB | 16.13 ± (16.11 - 16.16) MB | -0.4% | ✅ |
| runtime.dotnet.threads.count | 21 ± (20 - 21) | 21 ± (20 - 21) | +0.1% | ✅⬆️ |
| .NET Core 3.1 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 431.37 ± (428.25 - 434.49) ms | 435.02 ± (432.69 - 437.35) ms | +0.8% | ✅⬆️ |
| process.time_to_main_ms | 480.75 ± (480.06 - 481.43) ms | 483.38 ± (482.65 - 484.12) ms | +0.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 3 ± (3 - 3) | 3 ± (3 - 3) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 58.93 ± (58.82 - 59.05) MB | 59.01 ± (58.91 - 59.11) MB | +0.1% | ✅⬆️ |
| runtime.dotnet.threads.count | 29 ± (29 - 29) | 29 ± (29 - 29) | +0.0% | ✅⬆️ |
| .NET 6 - Baseline | ||||
| process.internal_duration_ms | 192.54 ± (192.22 - 192.86) ms | 193.50 ± (193.07 - 193.93) ms | +0.5% | ✅⬆️ |
| process.time_to_main_ms | 70.78 ± (70.58 - 70.97) ms | 71.14 ± (70.88 - 71.39) ms | +0.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.34 ± (16.31 - 16.37) MB | 16.33 ± (16.27 - 16.40) MB | -0.0% | ✅ |
| runtime.dotnet.threads.count | 19 ± (19 - 19) | 19 ± (19 - 19) | +0.3% | ✅⬆️ |
| .NET 6 - Bailout | ||||
| process.internal_duration_ms | 191.96 ± (191.62 - 192.31) ms | 192.38 ± (192.00 - 192.75) ms | +0.2% | ✅⬆️ |
| process.time_to_main_ms | 71.94 ± (71.80 - 72.09) ms | 72.24 ± (72.09 - 72.39) ms | +0.4% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 16.28 ± (16.16 - 16.40) MB | 16.34 ± (16.24 - 16.43) MB | +0.4% | ✅⬆️ |
| runtime.dotnet.threads.count | 20 ± (20 - 20) | 20 ± (20 - 20) | +0.5% | ✅⬆️ |
| .NET 6 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 441.98 ± (438.85 - 445.10) ms | 450.82 ± (448.32 - 453.31) ms | +2.0% | ✅⬆️ |
| process.time_to_main_ms | 458.69 ± (458.22 - 459.15) ms | 460.18 ± (459.66 - 460.71) ms | +0.3% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 59.06 ± (58.93 - 59.19) MB | 59.06 ± (58.95 - 59.18) MB | +0.0% | ✅⬆️ |
| runtime.dotnet.threads.count | 29 ± (29 - 29) | 29 ± (29 - 29) | +0.0% | ✅⬆️ |
| .NET 8 - Baseline | ||||
| process.internal_duration_ms | 190.42 ± (190.04 - 190.81) ms | 191.16 ± (190.76 - 191.55) ms | +0.4% | ✅⬆️ |
| process.time_to_main_ms | 70.12 ± (69.92 - 70.31) ms | 70.47 ± (70.27 - 70.67) ms | +0.5% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 11.75 ± (11.72 - 11.78) MB | 11.75 ± (11.73 - 11.78) MB | +0.0% | ✅⬆️ |
| runtime.dotnet.threads.count | 18 ± (18 - 18) | 18 ± (18 - 18) | -0.0% | ✅ |
| .NET 8 - Bailout | ||||
| process.internal_duration_ms | 189.30 ± (189.05 - 189.56) ms | 190.62 ± (190.26 - 190.97) ms | +0.7% | ✅⬆️ |
| process.time_to_main_ms | 70.96 ± (70.86 - 71.06) ms | 71.69 ± (71.52 - 71.85) ms | +1.0% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 11.82 ± (11.79 - 11.85) MB | 11.79 ± (11.76 - 11.82) MB | -0.2% | ✅ |
| runtime.dotnet.threads.count | 19 ± (19 - 19) | 19 ± (19 - 19) | +0.5% | ✅⬆️ |
| .NET 8 - CallTarget+Inlining+NGEN | ||||
| process.internal_duration_ms | 367.13 ± (365.75 - 368.50) ms | 366.63 ± (365.10 - 368.16) ms | -0.1% | ✅ |
| process.time_to_main_ms | 442.90 ± (441.99 - 443.81) ms | 447.10 ± (446.28 - 447.91) ms | +0.9% | ✅⬆️ |
| runtime.dotnet.exceptions.count | 4 ± (4 - 4) | 4 ± (4 - 4) | +0.0% | ✅ |
| runtime.dotnet.mem.committed | 48.37 ± (48.33 - 48.40) MB | 48.32 ± (48.29 - 48.36) MB | -0.1% | ✅ |
| runtime.dotnet.threads.count | 29 ± (29 - 29) | 29 ± (29 - 29) | +0.6% | ✅⬆️ |
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 (8070) - mean (73ms) : 71, 76
master - mean (69ms) : 67, 71
section Bailout
This PR (8070) - mean (78ms) : crit, 76, 80
master - mean (72ms) : 71, 74
section CallTarget+Inlining+NGEN
This PR (8070) - mean (1,059ms) : 1004, 1113
master - mean (1,034ms) : 962, 1106
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 (8070) - mean (116ms) : 113, 120
master - mean (106ms) : 104, 108
section Bailout
This PR (8070) - mean (117ms) : crit, 115, 119
master - mean (107ms) : 106, 108
section CallTarget+Inlining+NGEN
This PR (8070) - mean (784ms) : 726, 841
master - mean (741ms) : 683, 799
FakeDbCommand (.NET 6)
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8070) - mean (103ms) : 99, 106
master - mean (94ms) : 91, 96
section Bailout
This PR (8070) - mean (103ms) : crit, 101, 106
master - mean (94ms) : 93, 95
section CallTarget+Inlining+NGEN
This PR (8070) - mean (747ms) : 666, 828
master - mean (728ms) : 703, 753
FakeDbCommand (.NET 8)
gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8070) - mean (101ms) : 98, 104
master - mean (92ms) : 89, 95
section Bailout
This PR (8070) - mean (103ms) : crit, 100, 106
master - mean (93ms) : 92, 94
section CallTarget+Inlining+NGEN
This PR (8070) - mean (686ms) : crit, 662, 710
master - mean (644ms) : 628, 660
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 (8070) - mean (194ms) : 190, 199
master - mean (195ms) : 189, 201
section Bailout
This PR (8070) - mean (198ms) : 195, 202
master - mean (198ms) : 195, 200
section CallTarget+Inlining+NGEN
This PR (8070) - mean (1,159ms) : 1083, 1236
master - mean (1,143ms) : 1082, 1204
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 (8070) - mean (279ms) : 273, 284
master - mean (278ms) : 272, 284
section Bailout
This PR (8070) - mean (279ms) : 276, 283
master - mean (279ms) : 275, 282
section CallTarget+Inlining+NGEN
This PR (8070) - mean (945ms) : 893, 998
master - mean (942ms) : 894, 990
HttpMessageHandler (.NET 6)
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8070) - mean (273ms) : 266, 280
master - mean (272ms) : 266, 278
section Bailout
This PR (8070) - mean (273ms) : 268, 277
master - mean (272ms) : 267, 277
section CallTarget+Inlining+NGEN
This PR (8070) - mean (940ms) : 904, 976
master - mean (928ms) : 874, 982
HttpMessageHandler (.NET 8)
gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8070) - mean (272ms) : 267, 277
master - mean (270ms) : 264, 276
section Bailout
This PR (8070) - mean (272ms) : 268, 276
master - mean (270ms) : 267, 273
section CallTarget+Inlining+NGEN
This PR (8070) - mean (844ms) : 826, 863
master - mean (841ms) : 825, 857
This comment has been minimized.
This comment has been minimized.
| { | ||
| // Tells us which types are loaded, when, and how often. | ||
| SharedLogger.Debug("Logger retrieved for: {AssemblyQualifiedName}", classType.AssemblyQualifiedName); | ||
| if (SharedLogger.IsEnabled(LogEventLevel.Debug)) |
There was a problem hiding this comment.
RuntimeType.AssemblyQualifiedName always allocates a new string and do some internals QCalls, is fast but we can avoid it.
| using var array = FixedSizeArrayPool<object?>.OneItemPool.Get(); | ||
| array.Array[0] = property; |
There was a problem hiding this comment.
previously we allocate an array for every single log line, here the idea is to have a small pool for it and reuse it.
| { | ||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| get => _utcStart.Add(Elapsed); | ||
| get => _utcStart.AddTicks(StopwatchHelpers.GetElapsedTicks(Stopwatch.GetTimestamp() - _timestamp)); |
There was a problem hiding this comment.
we really don't need to create a TimeSpan struct for this by calling Elapsed, we just count the ticks and add them.
There was a problem hiding this comment.
is this measurably faster?
There was a problem hiding this comment.
not in recent frameworks, in olders frameworks the codegen is just a little better.
|
|
||
| namespace Datadog.Trace.Util; | ||
|
|
||
| internal struct CodeDuration : IDisposable |
There was a problem hiding this comment.
This is the version for use in an async/await method because we cannot use ref struct there. So creating a CodeDuration in that case will allocate in the heap (struct boxing).
Below there's the ref struct version to avoid any heap allocation in a normal sync method.
There was a problem hiding this comment.
Would it make sense to add a short comment in code about when to use CodeDuration vs CodeDurationRef?
My concern is that if someone uses the struct version in a non async methos and in a non-local way (copied by value) he could end up calling Dispose() on multiple copies and get an incorrect CodeDurationBase.Count.
| } | ||
| } | ||
|
|
||
| internal ref struct CodeDurationRef |
There was a problem hiding this comment.
ref struct version to avoid an allocation in the heap.
There was a problem hiding this comment.
NIT: wondering if the code inside the methods / ctors could have been shared between the two via some static helpers , for maintenance
| #endif | ||
|
|
||
| #if NETCOREAPP3_0_OR_GREATER | ||
| if (RuntimeHelpers.IsReferenceOrContainsReferences<T>()) |
There was a problem hiding this comment.
we clear the array if we know that T is a reference type (so we don't hold any reference from the GC)
7a2fadb to
c58aa40
Compare
|
|
||
| namespace Datadog.Trace.Util; | ||
|
|
||
| internal struct CodeDuration : IDisposable |
There was a problem hiding this comment.
Would it make sense to add a short comment in code about when to use CodeDuration vs CodeDurationRef?
My concern is that if someone uses the struct version in a non async methos and in a non-local way (copied by value) he could end up calling Dispose() on multiple copies and get an incorrect CodeDurationBase.Count.
4a649b1 to
3f3f143
Compare
| } | ||
| } | ||
|
|
||
| internal ref struct CodeDurationRef |
There was a problem hiding this comment.
NIT: wondering if the code inside the methods / ctors could have been shared between the two via some static helpers , for maintenance
## Summary of changes - Introduce Test Optimization RunId and EnsureRunId with cache folder lifecycle. - Add `_DD_INTERNAL_TOPT_RUNID` to config mapping/docs and regenerate keys. - Update CI integration tests to set/print RunId for deterministic runs. - Adjust test helper thread naming for clearer CI debugging. ## Reason for change Provide a stable RunId before caching work that depends on it and keep configuration in sync. ## Implementation details - Add RunId/EnsureRunId to `ITestOptimization`/`TestOptimization` with environment propagation. - Update configuration mapping and generated CI visibility keys. - Update CI integration tests for RunId coverage. ## Test coverage CI passes then all changes are good. ## Other details - Stacked PRs (current marked): - PR1 #8070 - **CURRENT**: PR2 #8071 - PR3 #8072 - PR4 #8073
## Summary of changes - Add git command caching and telemetry improvements for CI visibility. - Update GitInfo discovery and CI environment logging. - Update impacted tests for new git discovery behavior. JIRA: SDTEST-3226 ## Reason for change Reduce git command overhead and improve visibility into CI git metadata collection. ## Implementation details - Disk cache keyed by RunId in GitCommandHelper with safe.directory handling. - JSON annotations in ProcessHelpers for cache serialization. - Adjusted CI runner git discovery logic and tests. ## Test coverage CI passes then all changes are good. ## Other details - Stacked PRs (current marked): - PR1 #8070 - PR2 #8071 - **CURRENT**: PR3 #8072 - PR4 #8073
## Summary of changes - Add cached/file Test Optimization clients and update client wrappers. - Reduce feature init overhead and adjust background initialization. - Improve runner logging and CI workspace cache usage. ## Reason for change Reduce repeated HTTP calls and improve initialization performance for CI visibility features. ## Implementation details - New cached/file client implementations for disk/memory caching. - Feature creation updated to reduce dependencies on client calls. - CodeDuration instrumentation added to CI initialization paths. ## Test coverage CI passes then all changes are good. ## Other details - Stacked PRs (current marked): - PR1 #8070 - PR2 #8071 - PR3 #8072 - **CURRENT**: PR4 #8073
Summary of changes
Reason for change
Reduce allocations and improve timing diagnostics in hot paths.
Implementation details
Datadog.Trace.Utilfor allocation-free timing and pooling.Test coverage
CI passes then all changes are good.
Other details