Skip to content

Comments

[Runtime Metrics] Stop Sync Over Async in StatsD#8213

Draft
link04 wants to merge 1 commit intomasterfrom
maximo/making-statsd-dispose-async
Draft

[Runtime Metrics] Stop Sync Over Async in StatsD#8213
link04 wants to merge 1 commit intomasterfrom
maximo/making-statsd-dispose-async

Conversation

@link04
Copy link
Contributor

@link04 link04 commented Feb 17, 2026

Summary of changes

Reason for change

Implementation details

Test coverage

Other details

Co-authored-by: Cursor <cursoragent@cursor.com>
@link04 link04 force-pushed the maximo/making-statsd-dispose-async branch from 7913fac to 0ce6f8d Compare February 17, 2026 23:46
@pr-commenter
Copy link

pr-commenter bot commented Feb 18, 2026

Benchmarks

Benchmark execution time: 2026-02-18 00:27:55

Comparing candidate commit 0ce6f8d in PR branch maximo/making-statsd-dispose-async with baseline commit bbb12d2 in branch master.

Found 10 performance improvements and 8 performance regressions! Performance is the same for 159 metrics, 15 unstable metrics.

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟩 execution_time [-100.803ms; -100.671ms] or [-50.206%; -50.140%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟥 execution_time [+85.316ms; +89.387ms] or [+74.619%; +78.179%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟥 execution_time [+20.092ms; +24.853ms] or [+10.157%; +12.564%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟩 execution_time [-29.307ms; -28.994ms] or [-14.298%; -14.145%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟩 execution_time [-102.847ms; -101.649ms] or [-52.990%; -52.372%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0

  • 🟩 execution_time [-110.244µs; -99.689µs] or [-7.200%; -6.510%]
  • 🟩 throughput [+45.573op/s; +50.601op/s] or [+6.978%; +7.748%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0

  • 🟩 execution_time [-75.545µs; -71.055µs] or [-6.951%; -6.538%]
  • 🟩 throughput [+64.494op/s; +68.595op/s] or [+7.009%; +7.455%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1

  • 🟩 execution_time [-213.584µs; -204.789µs] or [-10.223%; -9.802%]
  • 🟩 throughput [+52.106op/s; +54.403op/s] or [+10.887%; +11.367%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟥 execution_time [+145.181µs; +150.046µs] or [+7.503%; +7.755%]
  • 🟥 throughput [-37.237op/s; -36.033op/s] or [-7.205%; -6.972%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 throughput [-30030.309op/s; -22415.139op/s] or [-7.128%; -5.321%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • 🟥 throughput [-402.550op/s; -194.927op/s] or [-18.316%; -8.869%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+31.073ms; +32.720ms] or [+19.165%; +20.181%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟩 throughput [+11450.623op/s; +15609.916op/s] or [+5.074%; +6.917%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472

  • 🟥 throughput [-47735.855op/s; -46493.144op/s] or [-6.993%; -6.811%]

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

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8213) 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
duration76.02 ± (76.01 - 76.45) ms73.61 ± (73.58 - 73.86) ms-3.2%
.NET Framework 4.8 - Bailout
duration80.98 ± (80.79 - 81.23) ms78.63 ± (78.50 - 78.86) ms-2.9%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1091.08 ± (1089.52 - 1095.58) ms1074.40 ± (1074.05 - 1079.45) ms-1.5%
.NET Core 3.1 - Baseline
process.internal_duration_ms23.59 ± (23.54 - 23.65) ms22.59 ± (22.54 - 22.63) ms-4.3%
process.time_to_main_ms95.88 ± (95.65 - 96.10) ms85.06 ± (84.88 - 85.24) ms-11.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.46 ± (15.46 - 15.47) MB10.91 ± (10.91 - 10.91) MB-29.5%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms23.34 ± (23.29 - 23.39) ms22.60 ± (22.56 - 22.65) ms-3.1%
process.time_to_main_ms97.08 ± (96.85 - 97.31) ms86.95 ± (86.74 - 87.16) ms-10.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.51 ± (15.51 - 15.51) MB10.95 ± (10.94 - 10.96) MB-29.4%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms279.50 ± (278.22 - 280.79) ms249.93 ± (245.90 - 253.96) ms-10.6%
process.time_to_main_ms525.68 ± (524.81 - 526.56) ms488.19 ± (487.56 - 488.82) ms-7.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.01 ± (51.98 - 52.03) MB47.62 ± (47.60 - 47.64) MB-8.4%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 6 - Baseline
process.internal_duration_ms22.45 ± (22.40 - 22.50) ms21.41 ± (21.37 - 21.45) ms-4.7%
process.time_to_main_ms84.46 ± (84.25 - 84.67) ms74.69 ± (74.55 - 74.84) ms-11.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.19 ± (15.18 - 15.19) MB10.66 ± (10.66 - 10.66) MB-29.8%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms22.36 ± (22.30 - 22.42) ms21.37 ± (21.32 - 21.42) ms-4.4%
process.time_to_main_ms85.65 ± (85.43 - 85.86) ms76.13 ± (75.94 - 76.33) ms-11.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.31 ± (15.30 - 15.31) MB10.77 ± (10.77 - 10.77) MB-29.7%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms272.92 ± (271.26 - 274.58) ms254.62 ± (251.42 - 257.82) ms-6.7%
process.time_to_main_ms506.10 ± (505.19 - 507.02) ms467.02 ± (466.47 - 467.58) ms-7.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.94 ± (52.92 - 52.96) MB48.25 ± (48.23 - 48.28) MB-8.9%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.2%
.NET 8 - Baseline
process.internal_duration_ms20.01 ± (19.96 - 20.06) ms19.68 ± (19.64 - 19.72) ms-1.7%
process.time_to_main_ms75.77 ± (75.58 - 75.95) ms73.75 ± (73.58 - 73.92) ms-2.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.67) MB7.66 ± (7.66 - 7.67) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms20.27 ± (20.21 - 20.33) ms19.62 ± (19.57 - 19.66) ms-3.2%
process.time_to_main_ms78.26 ± (78.07 - 78.45) ms74.66 ± (74.51 - 74.81) ms-4.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.74 ± (7.73 - 7.75) MB7.72 ± (7.71 - 7.72) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms193.54 ± (192.50 - 194.58) ms189.56 ± (188.63 - 190.48) ms-2.1%
process.time_to_main_ms462.65 ± (461.73 - 463.58) ms450.26 ± (449.62 - 450.90) ms-2.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.09 ± (36.03 - 36.15) MB36.07 ± (36.03 - 36.11) MB-0.1%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.4%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration222.57 ± (222.41 - 224.60) ms206.72 ± (206.57 - 207.80) ms-7.1%
.NET Framework 4.8 - Bailout
duration225.94 ± (226.07 - 228.02) ms210.02 ± (209.91 - 210.88) ms-7.0%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1250.50 ± (1247.14 - 1254.90) ms1201.35 ± (1202.12 - 1208.59) ms-3.9%
.NET Core 3.1 - Baseline
process.internal_duration_ms222.05 ± (221.01 - 223.08) ms201.24 ± (200.72 - 201.76) ms-9.4%
process.time_to_main_ms102.37 ± (101.98 - 102.75) ms87.36 ± (87.09 - 87.62) ms-14.7%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed20.37 ± (20.35 - 20.39) MB16.01 ± (16.00 - 16.03) MB-21.4%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-1.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms225.46 ± (224.30 - 226.61) ms201.16 ± (200.65 - 201.67) ms-10.8%
process.time_to_main_ms105.42 ± (105.02 - 105.82) ms88.93 ± (88.69 - 89.18) ms-15.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed20.41 ± (20.39 - 20.42) MB16.12 ± (16.11 - 16.14) MB-21.0%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-1.9%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms492.70 ± (490.24 - 495.16) ms438.36 ± (434.90 - 441.82) ms-11.0%
process.time_to_main_ms559.63 ± (558.53 - 560.74) ms504.31 ± (503.29 - 505.33) ms-9.9%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed60.47 ± (60.34 - 60.60) MB58.12 ± (58.00 - 58.23) MB-3.9%
runtime.dotnet.threads.count30 ± (30 - 30)29 ± (29 - 29)-1.1%
.NET 6 - Baseline
process.internal_duration_ms228.80 ± (227.48 - 230.12) ms204.78 ± (204.24 - 205.32) ms-10.5%
process.time_to_main_ms82.25 ± (81.86 - 82.65) ms75.60 ± (75.36 - 75.83) ms-8.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.07 ± (16.06 - 16.09) MB16.27 ± (16.25 - 16.29) MB+1.2%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)19 ± (19 - 19)-1.2%
.NET 6 - Bailout
process.internal_duration_ms226.40 ± (224.97 - 227.83) ms204.94 ± (204.44 - 205.44) ms-9.5%
process.time_to_main_ms83.57 ± (83.17 - 83.98) ms76.95 ± (76.75 - 77.15) ms-7.9%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.10 - 16.13) MB16.31 ± (16.29 - 16.33) MB+1.2%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)-0.2%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms476.94 ± (472.91 - 480.98) ms466.00 ± (462.82 - 469.17) ms-2.3%
process.time_to_main_ms496.86 ± (495.85 - 497.87) ms476.60 ± (475.45 - 477.75) ms-4.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed57.48 ± (57.31 - 57.66) MB57.56 ± (57.38 - 57.75) MB+0.1%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-1.1%
.NET 8 - Baseline
process.internal_duration_ms226.81 ± (225.88 - 227.75) ms203.50 ± (202.86 - 204.14) ms-10.3%
process.time_to_main_ms87.02 ± (86.70 - 87.34) ms74.63 ± (74.39 - 74.87) ms-14.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.90 ± (15.89 - 15.92) MB11.68 ± (11.67 - 11.70) MB-26.5%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-2.1%
.NET 8 - Bailout
process.internal_duration_ms228.05 ± (226.91 - 229.20) ms203.01 ± (202.52 - 203.50) ms-11.0%
process.time_to_main_ms88.95 ± (88.64 - 89.26) ms75.77 ± (75.58 - 75.95) ms-14.8%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.95 ± (15.93 - 15.97) MB11.67 ± (11.66 - 11.68) MB-26.8%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-1.6%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms514.36 ± (512.49 - 516.24) ms414.12 ± (407.12 - 421.11) ms-19.5%
process.time_to_main_ms513.35 ± (512.33 - 514.37) ms462.75 ± (461.94 - 463.56) ms-9.9%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed54.27 ± (54.25 - 54.30) MB48.81 ± (48.64 - 48.99) MB-10.1%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.8%✅⬆️
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 (8213) - mean (74ms)  : 72, 76
    master - mean (76ms)  : 73, 80

    section Bailout
    This PR (8213) - mean (79ms)  : 77, 80
    master - mean (81ms)  : 78, 84

    section CallTarget+Inlining+NGEN
    This PR (8213) - mean (1,077ms)  : 1038, 1116
    master - mean (1,093ms)  : 1049, 1136

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 (8213) - mean (115ms)  : 112, 117
    master - mean (127ms)  : 124, 131

    section Bailout
    This PR (8213) - mean (116ms)  : 114, 119
    master - mean (128ms)  : 125, 130

    section CallTarget+Inlining+NGEN
    This PR (8213) - mean (776ms)  : 718, 834
    master - mean (843ms)  : 808, 878

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

    section Bailout
    This PR (8213) - mean (104ms)  : 101, 107
    master - mean (115ms)  : 112, 118

    section CallTarget+Inlining+NGEN
    This PR (8213) - mean (758ms)  : 707, 809
    master - mean (817ms)  : 783, 851

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8213) - mean (101ms)  : 98, 104
    master - mean (104ms)  : 100, 108

    section Bailout
    This PR (8213) - mean (102ms)  : 100, 104
    master - mean (107ms)  : 104, 109

    section CallTarget+Inlining+NGEN
    This PR (8213) - mean (682ms)  : 663, 700
    master - mean (700ms)  : 681, 718

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 (8213) - mean (207ms)  : 198, 216
    master - mean (224ms)  : 207, 240

    section Bailout
    This PR (8213) - mean (210ms)  : 203, 217
    master - mean (227ms)  : 213, 241

    section CallTarget+Inlining+NGEN
    This PR (8213) - mean (1,205ms)  : 1159, 1251
    master - mean (1,251ms)  : 1192, 1310

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 (8213) - mean (298ms)  : 289, 308
    master - mean (337ms)  : 317, 356

    section Bailout
    This PR (8213) - mean (300ms)  : 289, 311
    master - mean (342ms)  : 321, 363

    section CallTarget+Inlining+NGEN
    This PR (8213) - mean (986ms)  : 924, 1047
    master - mean (1,094ms)  : 1044, 1143

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8213) - mean (289ms)  : 280, 299
    master - mean (321ms)  : 294, 349

    section Bailout
    This PR (8213) - mean (291ms)  : 280, 301
    master - mean (320ms)  : 295, 346

    section CallTarget+Inlining+NGEN
    This PR (8213) - mean (979ms)  : 918, 1041
    master - mean (1,010ms)  : 949, 1071

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8213) - mean (289ms)  : 282, 295
    master - mean (326ms)  : 305, 347

    section Bailout
    This PR (8213) - mean (290ms)  : 278, 301
    master - mean (329ms)  : 304, 355

    section CallTarget+Inlining+NGEN
    This PR (8213) - mean (920ms)  : 815, 1025
    master - mean (1,065ms)  : 1016, 1114

Loading

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.

1 participant