Skip to content

Conversation

@andrewlock
Copy link
Member

Summary of changes

Use ScopedTracer in tests, so that everything gets disposed properly

Reason for change

If you don't use `ScopedTacer, or clean up manually, threads leak

Implementation details

Use the existing ScopedTracer (via TracerHelper)

Test coverage

Same

@andrewlock andrewlock added the area:tests unit tests, integration tests label Nov 4, 2025
@andrewlock andrewlock requested a review from a team as a code owner November 4, 2025 12:48
@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7770) 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
duration67.98 ± (67.95 - 68.15) ms69.37 ± (69.40 - 69.68) ms+2.0%✅⬆️
.NET Framework 4.8 - Bailout
duration71.84 ± (71.66 - 71.94) ms73.40 ± (73.17 - 73.51) ms+2.2%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1044.59 ± (1047.15 - 1054.69) ms1052.50 ± (1053.50 - 1060.54) ms+0.8%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.05 ± (22.01 - 22.08) ms22.43 ± (22.33 - 22.53) ms+1.7%✅⬆️
process.time_to_main_ms78.86 ± (78.68 - 79.03) ms81.40 ± (81.04 - 81.76) ms+3.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.88 ± (10.88 - 10.89) MB10.88 ± (10.87 - 10.88) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.95 ± (21.93 - 21.97) ms22.12 ± (22.08 - 22.15) ms+0.7%✅⬆️
process.time_to_main_ms79.59 ± (79.49 - 79.68) ms81.75 ± (81.63 - 81.87) ms+2.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.90 - 10.91) MB10.92 ± (10.91 - 10.92) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms208.96 ± (207.59 - 210.33) ms210.83 ± (209.33 - 212.33) ms+0.9%✅⬆️
process.time_to_main_ms513.98 ± (513.31 - 514.65) ms518.60 ± (517.82 - 519.37) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.63 ± (52.61 - 52.65) MB52.50 ± (52.48 - 52.52) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 6 - Baseline
process.internal_duration_ms20.80 ± (20.77 - 20.83) ms21.12 ± (21.09 - 21.16) ms+1.6%✅⬆️
process.time_to_main_ms68.12 ± (67.99 - 68.24) ms70.06 ± (69.91 - 70.20) ms+2.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.59 ± (10.58 - 10.59) MB10.59 ± (10.58 - 10.59) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.72 ± (20.69 - 20.74) ms20.95 ± (20.92 - 20.98) ms+1.1%✅⬆️
process.time_to_main_ms68.95 ± (68.89 - 69.02) ms70.98 ± (70.84 - 71.13) ms+2.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.61 - 10.62) MB10.61 ± (10.61 - 10.62) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms201.09 ± (198.44 - 203.75) ms200.20 ± (198.26 - 202.14) ms-0.4%
process.time_to_main_ms483.64 ± (483.07 - 484.21) ms482.66 ± (482.07 - 483.25) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.70 ± (51.64 - 51.77) MB51.32 ± (51.25 - 51.39) MB-0.7%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms18.87 ± (18.84 - 18.91) ms19.10 ± (19.08 - 19.13) ms+1.2%✅⬆️
process.time_to_main_ms67.32 ± (67.19 - 67.44) ms69.19 ± (69.05 - 69.33) ms+2.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.66) MB7.64 ± (7.63 - 7.64) MB-0.2%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.85 ± (18.83 - 18.87) ms19.01 ± (18.98 - 19.04) ms+0.9%✅⬆️
process.time_to_main_ms68.36 ± (68.29 - 68.43) ms70.03 ± (69.92 - 70.15) ms+2.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.69) MB7.68 ± (7.67 - 7.69) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms178.45 ± (177.55 - 179.35) ms179.95 ± (179.30 - 180.60) ms+0.8%✅⬆️
process.time_to_main_ms460.83 ± (460.26 - 461.41) ms458.80 ± (458.24 - 459.36) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.85 ± (38.82 - 38.88) MB38.59 ± (38.57 - 38.62) MB-0.7%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.1%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration191.78 ± (191.77 - 192.71) ms192.25 ± (192.29 - 193.17) ms+0.2%✅⬆️
.NET Framework 4.8 - Bailout
duration195.03 ± (194.90 - 195.58) ms196.11 ± (195.86 - 196.36) ms+0.6%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1165.21 ± (1166.16 - 1175.84) ms1161.94 ± (1167.13 - 1176.73) ms-0.3%
.NET Core 3.1 - Baseline
process.internal_duration_ms185.80 ± (185.44 - 186.16) ms186.94 ± (186.58 - 187.30) ms+0.6%✅⬆️
process.time_to_main_ms80.44 ± (80.22 - 80.65) ms80.91 ± (80.68 - 81.14) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.09 ± (16.04 - 16.15) MB16.14 ± (16.11 - 16.16) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 20)20 ± (19 - 20)+0.3%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms186.21 ± (185.90 - 186.53) ms186.57 ± (186.21 - 186.93) ms+0.2%✅⬆️
process.time_to_main_ms81.92 ± (81.74 - 82.09) ms82.02 ± (81.85 - 82.19) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.17 ± (16.15 - 16.19) MB16.21 ± (16.18 - 16.23) MB+0.2%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.6%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms393.59 ± (390.87 - 396.31) ms397.76 ± (395.16 - 400.35) ms+1.1%✅⬆️
process.time_to_main_ms514.99 ± (514.20 - 515.79) ms515.01 ± (514.36 - 515.65) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.81 ± (62.66 - 62.96) MB63.02 ± (62.87 - 63.17) MB+0.3%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 6 - Baseline
process.internal_duration_ms190.81 ± (190.47 - 191.16) ms190.52 ± (190.27 - 190.78) ms-0.2%
process.time_to_main_ms69.83 ± (69.62 - 70.05) ms69.98 ± (69.82 - 70.13) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.87 ± (15.70 - 16.03) MB16.27 ± (16.17 - 16.36) MB+2.5%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 19)+1.9%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms190.36 ± (190.06 - 190.65) ms190.36 ± (190.06 - 190.65) ms+0.0%✅⬆️
process.time_to_main_ms70.54 ± (70.42 - 70.66) ms70.96 ± (70.84 - 71.09) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.86 ± (15.69 - 16.04) MB16.22 ± (16.08 - 16.36) MB+2.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+1.3%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms411.01 ± (407.54 - 414.48) ms413.10 ± (410.06 - 416.14) ms+0.5%✅⬆️
process.time_to_main_ms486.78 ± (486.16 - 487.39) ms482.53 ± (481.81 - 483.26) ms-0.9%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.87 ± (61.72 - 62.02) MB62.20 ± (62.06 - 62.34) MB+0.5%✅⬆️
runtime.dotnet.threads.count30 ± (29 - 30)30 ± (29 - 30)-0.0%
.NET 8 - Baseline
process.internal_duration_ms188.61 ± (188.31 - 188.92) ms189.27 ± (189.02 - 189.53) ms+0.3%✅⬆️
process.time_to_main_ms68.91 ± (68.76 - 69.06) ms69.48 ± (69.32 - 69.65) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.74 - 11.78) MB11.73 ± (11.70 - 11.75) MB-0.3%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.4%
.NET 8 - Bailout
process.internal_duration_ms188.04 ± (187.84 - 188.24) ms189.66 ± (189.35 - 189.97) ms+0.9%✅⬆️
process.time_to_main_ms69.84 ± (69.76 - 69.92) ms70.89 ± (70.76 - 71.01) ms+1.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.80 ± (11.77 - 11.82) MB11.83 ± (11.80 - 11.86) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms357.16 ± (355.73 - 358.60) ms359.06 ± (357.63 - 360.49) ms+0.5%✅⬆️
process.time_to_main_ms463.51 ± (462.79 - 464.24) ms458.21 ± (457.64 - 458.78) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.47 ± (50.43 - 50.52) MB50.25 ± (50.22 - 50.28) MB-0.4%
runtime.dotnet.threads.count29 ± (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 (7770) - mean (70ms)  : 68, 71
    master - mean (68ms)  : 67, 69

    section Bailout
    This PR (7770) - mean (73ms)  : 72, 75
    master - mean (72ms)  : 70, 73

    section CallTarget+Inlining+NGEN
    This PR (7770) - mean (1,057ms)  : 1007, 1107
    master - mean (1,051ms)  : 1002, 1099

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 (7770) - mean (110ms)  : 101, 120
    master - mean (106ms)  : 104, 108

    section Bailout
    This PR (7770) - mean (110ms)  : 108, 111
    master - mean (107ms)  : 105, 108

    section CallTarget+Inlining+NGEN
    This PR (7770) - mean (765ms)  : 728, 801
    master - mean (749ms)  : 727, 772

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

    section Bailout
    This PR (7770) - mean (97ms)  : 95, 99
    master - mean (94ms)  : 93, 95

    section CallTarget+Inlining+NGEN
    This PR (7770) - mean (712ms)  : 676, 748
    master - mean (718ms)  : 665, 771

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7770) - mean (95ms)  : 92, 98
    master - mean (92ms)  : 90, 95

    section Bailout
    This PR (7770) - mean (95ms)  : 93, 97
    master - mean (93ms)  : 92, 94

    section CallTarget+Inlining+NGEN
    This PR (7770) - mean (675ms)  : 652, 697
    master - mean (670ms)  : 651, 689

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 (7770) - mean (193ms)  : 188, 197
    master - mean (192ms)  : 188, 197

    section Bailout
    This PR (7770) - mean (196ms)  : 194, 199
    master - mean (195ms)  : 192, 199

    section CallTarget+Inlining+NGEN
    This PR (7770) - mean (1,172ms)  : 1102, 1242
    master - mean (1,171ms)  : 1101, 1241

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 (7770) - mean (276ms)  : 271, 281
    master - mean (275ms)  : 270, 280

    section Bailout
    This PR (7770) - mean (277ms)  : 272, 282
    master - mean (276ms)  : 272, 280

    section CallTarget+Inlining+NGEN
    This PR (7770) - mean (955ms)  : 909, 1002
    master - mean (951ms)  : 904, 999

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

    section Bailout
    This PR (7770) - mean (270ms)  : 266, 273
    master - mean (269ms)  : 265, 272

    section CallTarget+Inlining+NGEN
    This PR (7770) - mean (930ms)  : 882, 979
    master - mean (934ms)  : 870, 998

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7770) - mean (269ms)  : 264, 273
    master - mean (268ms)  : 264, 272

    section Bailout
    This PR (7770) - mean (270ms)  : 266, 274
    master - mean (268ms)  : 265, 271

    section CallTarget+Inlining+NGEN
    This PR (7770) - mean (849ms)  : 829, 869
    master - mean (852ms)  : 837, 867

Loading

@andrewlock andrewlock enabled auto-merge (squash) November 4, 2025 13:45
@andrewlock andrewlock merged commit 8e7aeec into master Nov 4, 2025
153 checks passed
@andrewlock andrewlock deleted the andrew/use-scoped-tracer branch November 4, 2025 14:16
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tests unit tests, integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants