Skip to content

Conversation

@andrewlock
Copy link
Member

Summary of changes

Avoid having the callback from a Timer reconfigure itself

Reason for change

We have seem some instances of StackOverflowExceptions that point the finger at the RuntimeMetricsWriter and the way it handles PushEvents:

0x7FF9817A3F64 Datadog.Trace.dll!Datadog.Trace.RuntimeMetrics.RuntimeMetricsWriter.PushEvents
0x7FF980CC7FD7 Datadog.Trace.dll!Datadog.Trace.RuntimeMetrics.RuntimeMetricsWriter.GetCurrentProcessMetrics
0x7FF980CC81DC Datadog.Trace.dll!Datadog.Trace.RuntimeMetrics.ProcessSnapshotRuntimeInformation.GetCurrentProcessMetrics
0x7FF980CC7ECD Datadog.Trace.dll!Datadog.Trace.RuntimeMetrics.RuntimeMetricsWriter.GetCurrentProcessMetrics
0x7FF9817A392C Datadog.Trace.dll!Datadog.Trace.RuntimeMetrics.RuntimeMetricsWriter.PushEvents
0x7FF9DD2110A2 mscorlib.dll!System.Threading.ExecutionContext.RunInternal
0x7FF9DD210F25 mscorlib.dll!System.Threading.ExecutionContext.Run
0x7FF9DD29AC8A mscorlib.dll!System.Threading.TimerQueueTimer.CallCallback
0x7FF9DD29AA7B mscorlib.dll!System.Threading.TimerQueueTimer.Fire
0x7FF9DD2283F8 mscorlib.dll!System.Threading.TimerQueue.FireNextTimers

Today, the RuntimeMetricsWriter creates a timer that doesn't repeat, and fires PushEvents() after the delay. Inside the PushEvents() method, after grabbing the metrics, it calculates the required delay (accounting for drift) and reconfigures the timer. This ensures we don't have concurrent collections, and we avoid drift as much as possible.

However, as best as we can tell, if the calculated delay required is very small, it looks like this can handle the callback on the same thread, and we could end up in a recursive situation:

When a user-mode APC is queued, the thread is not directed to call the APC function unless it is in an alertable state. After the thread is in an alertable state, the thread handles all pending APCs in first in, first out (FIFO) order, and the wait operation returns WAIT_IO_COMPLETION. A thread enters an alertable state by using SleepEx function, SignalObjectAndWait function, WaitForSingleObjectEx function, WaitForMultipleObjectsEx function, or MsgWaitForMultipleObjectsEx function.

If an application queues an APC before the thread begins running, the thread begins by calling the APC function. After the thread calls an APC function, it calls the APC functions for all APCs in its APC queue.

It is possible to sleep or wait for an object within the APC. If you perform an alertable wait inside an APC, it will recursively dispatch the APCs. This can cause a stack overflow.

Implementation details

To avoid the possibility of recursion (and all the weirdness that comes with timers), we switch away from the Timer approach, and instead use a long-running task (i.e. dedicated thread) and just Thread.Sleep for the delay. This is suboptimal because:

  • We can't interrupt the Thread.Sleep(), so we have to sleep for small periods, check if we're disposed and wake up. This will likely cause a small amount of drift (the time to wake up and execute the loop logic). We could account for this by setting a "deadline" for DateTime.UtcNow instead of the "duration requirement". Both have pros and cons.
  • It uses another dedicated thread (not from the thread pool)

We could switch to making things async instead, and use the ThreadPool but it's not clear whether all the kernel calls are a bit time consuming for a threadpool thread 🤷‍♂️

Finally, we've only seen this issue in .NET Framework, so to try to minimize the blast radius, this PR limits the change to .NET Framework.

Test coverage

Should be covered by existing, as it's an internal refactoring

@andrewlock andrewlock requested a review from a team as a code owner November 17, 2025 13:35
@github-actions github-actions bot added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Nov 17, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@andrewlock andrewlock force-pushed the andrew/rewrite-runtime-metrics-to-avoid-recurrsion branch from 30045c7 to 7ac1ff6 Compare November 17, 2025 13:42
@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Nov 17, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7830) 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
duration75.76 ± (75.75 - 76.44) ms75.38 ± (75.36 - 76.18) ms-0.5%
.NET Framework 4.8 - Bailout
duration79.19 ± (79.45 - 80.50) ms79.62 ± (79.71 - 80.59) ms+0.5%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1121.95 ± (1119.71 - 1133.13) ms1119.31 ± (1123.01 - 1138.44) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.89 ± (22.82 - 22.97) ms23.01 ± (22.92 - 23.09) ms+0.5%✅⬆️
process.time_to_main_ms87.21 ± (86.86 - 87.57) ms89.13 ± (88.72 - 89.53) ms+2.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.91 ± (10.91 - 10.92) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.92 ± (22.84 - 22.99) ms22.96 ± (22.90 - 23.03) ms+0.2%✅⬆️
process.time_to_main_ms89.94 ± (89.55 - 90.33) ms89.18 ± (88.84 - 89.53) ms-0.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.94 - 10.95) MB10.96 ± (10.96 - 10.96) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms219.34 ± (217.91 - 220.76) ms222.12 ± (220.86 - 223.38) ms+1.3%✅⬆️
process.time_to_main_ms548.40 ± (547.08 - 549.72) ms554.57 ± (553.26 - 555.88) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.58 ± (52.56 - 52.60) MB52.46 ± (52.44 - 52.48) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms22.05 ± (21.98 - 22.13) ms22.00 ± (21.93 - 22.07) ms-0.2%
process.time_to_main_ms78.32 ± (77.91 - 78.73) ms78.71 ± (78.34 - 79.08) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.59 ± (10.59 - 10.59) MB10.63 ± (10.63 - 10.63) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.80 ± (21.74 - 21.87) ms21.70 ± (21.64 - 21.77) ms-0.5%
process.time_to_main_ms78.70 ± (78.36 - 79.04) ms78.40 ± (78.02 - 78.78) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.66 - 10.66) MB10.66 ± (10.66 - 10.67) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms206.85 ± (205.60 - 208.11) ms207.65 ± (206.39 - 208.90) ms+0.4%✅⬆️
process.time_to_main_ms517.87 ± (516.78 - 518.97) ms512.98 ± (511.85 - 514.11) ms-0.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.83 ± (51.80 - 51.86) MB51.63 ± (51.60 - 51.67) MB-0.4%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.2%
.NET 8 - Baseline
process.internal_duration_ms19.94 ± (19.87 - 20.00) ms20.21 ± (20.14 - 20.29) ms+1.4%✅⬆️
process.time_to_main_ms76.13 ± (75.80 - 76.46) ms76.84 ± (76.46 - 77.22) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.64 ± (7.63 - 7.65) MB7.67 ± (7.66 - 7.68) MB+0.4%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.86 ± (19.80 - 19.92) ms20.04 ± (19.97 - 20.11) ms+0.9%✅⬆️
process.time_to_main_ms76.54 ± (76.24 - 76.85) ms77.26 ± (76.91 - 77.60) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.70 ± (7.69 - 7.70) MB7.70 ± (7.69 - 7.70) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms191.89 ± (190.98 - 192.81) ms193.17 ± (192.30 - 194.04) ms+0.7%✅⬆️
process.time_to_main_ms495.38 ± (494.22 - 496.54) ms488.88 ± (487.86 - 489.90) ms-1.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed39.03 ± (38.99 - 39.07) MB38.89 ± (38.85 - 38.93) MB-0.4%
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
duration193.65 ± (193.42 - 194.25) ms195.46 ± (195.12 - 196.08) ms+0.9%✅⬆️
.NET Framework 4.8 - Bailout
duration197.45 ± (197.24 - 198.16) ms199.17 ± (199.48 - 200.67) ms+0.9%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1165.94 ± (1171.13 - 1180.86) ms1182.76 ± (1187.49 - 1198.79) ms+1.4%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms188.26 ± (187.87 - 188.64) ms191.88 ± (191.45 - 192.32) ms+1.9%✅⬆️
process.time_to_main_ms80.86 ± (80.58 - 81.13) ms82.14 ± (81.89 - 82.39) ms+1.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.03 ± (16.01 - 16.06) MB15.98 ± (15.96 - 16.01) MB-0.3%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)-0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms187.78 ± (187.39 - 188.17) ms189.84 ± (189.37 - 190.31) ms+1.1%✅⬆️
process.time_to_main_ms81.80 ± (81.65 - 81.95) ms82.80 ± (82.58 - 83.02) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.08 - 16.14) MB16.13 ± (16.11 - 16.15) MB+0.2%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.4%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms394.74 ± (392.15 - 397.34) ms398.60 ± (396.26 - 400.94) ms+1.0%✅⬆️
process.time_to_main_ms517.34 ± (516.69 - 517.98) ms522.64 ± (521.67 - 523.60) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.87 ± (62.72 - 63.03) MB63.19 ± (63.05 - 63.33) MB+0.5%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 30)+0.2%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.96 ± (192.47 - 193.45) ms192.74 ± (192.32 - 193.15) ms-0.1%
process.time_to_main_ms70.13 ± (69.93 - 70.34) ms70.11 ± (69.88 - 70.33) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.32 ± (16.27 - 16.37) MB16.34 ± (16.27 - 16.41) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.6%
.NET 6 - Bailout
process.internal_duration_ms191.18 ± (190.90 - 191.46) ms193.04 ± (192.62 - 193.46) ms+1.0%✅⬆️
process.time_to_main_ms70.83 ± (70.72 - 70.94) ms71.34 ± (71.14 - 71.53) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.01 ± (15.85 - 16.16) MB16.20 ± (16.08 - 16.32) MB+1.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (20 - 20)+3.2%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms413.14 ± (410.11 - 416.18) ms416.72 ± (413.66 - 419.78) ms+0.9%✅⬆️
process.time_to_main_ms490.90 ± (490.13 - 491.66) ms487.30 ± (486.48 - 488.11) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.22 ± (62.08 - 62.36) MB62.25 ± (62.11 - 62.38) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)30 ± (29 - 30)+0.3%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms193.74 ± (193.15 - 194.34) ms191.02 ± (190.68 - 191.36) ms-1.4%
process.time_to_main_ms70.75 ± (70.46 - 71.04) ms69.65 ± (69.46 - 69.85) ms-1.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.63 ± (11.62 - 11.65) MB11.70 ± (11.67 - 11.73) MB+0.6%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-1.2%
.NET 8 - Bailout
process.internal_duration_ms192.13 ± (191.68 - 192.57) ms191.82 ± (191.38 - 192.26) ms-0.2%
process.time_to_main_ms71.17 ± (70.97 - 71.38) ms70.96 ± (70.79 - 71.14) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.72 ± (11.70 - 11.75) MB11.76 ± (11.73 - 11.79) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.2%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms366.75 ± (365.45 - 368.06) ms363.78 ± (362.38 - 365.19) ms-0.8%
process.time_to_main_ms471.67 ± (470.97 - 472.38) ms459.91 ± (459.26 - 460.56) ms-2.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.51 ± (50.48 - 50.54) MB50.35 ± (50.32 - 50.38) MB-0.3%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+1.0%✅⬆️
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 (7830) - mean (76ms)  : 70, 82
    master - mean (76ms)  : 71, 81

    section Bailout
    This PR (7830) - mean (80ms)  : 74, 87
    master - mean (80ms)  : 74, 86

    section CallTarget+Inlining+NGEN
    This PR (7830) - mean (1,131ms)  : 1041, 1221
    master - mean (1,126ms)  : 1057, 1196

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 (7830) - mean (120ms)  : 111, 129
    master - mean (118ms)  : 111, 124

    section Bailout
    This PR (7830) - mean (120ms)  : 112, 127
    master - mean (120ms)  : 112, 128

    section CallTarget+Inlining+NGEN
    This PR (7830) - mean (816ms)  : 772, 861
    master - mean (804ms)  : 757, 851

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

    section Bailout
    This PR (7830) - mean (107ms)  : 100, 115
    master - mean (108ms)  : 100, 115

    section CallTarget+Inlining+NGEN
    This PR (7830) - mean (753ms)  : 711, 795
    master - mean (756ms)  : 722, 789

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7830) - mean (106ms)  : 98, 113
    master - mean (104ms)  : 97, 112

    section Bailout
    This PR (7830) - mean (106ms)  : 99, 114
    master - mean (105ms)  : 98, 112

    section CallTarget+Inlining+NGEN
    This PR (7830) - mean (718ms)  : 688, 748
    master - mean (719ms)  : 688, 750

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 (7830) - mean (196ms)  : 188, 203
    master - mean (194ms)  : 189, 199

    section Bailout
    This PR (7830) - mean (200ms)  : 191, 209
    master - mean (198ms)  : 193, 202

    section CallTarget+Inlining+NGEN
    This PR (7830) - mean (1,193ms)  : 1105, 1282
    master - mean (1,176ms)  : 1103, 1249

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 (7830) - mean (283ms)  : 274, 292
    master - mean (277ms)  : 272, 283

    section Bailout
    This PR (7830) - mean (281ms)  : 273, 290
    master - mean (278ms)  : 273, 282

    section CallTarget+Inlining+NGEN
    This PR (7830) - mean (960ms)  : 915, 1005
    master - mean (942ms)  : 905, 980

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7830) - mean (271ms)  : 265, 278
    master - mean (271ms)  : 265, 277

    section Bailout
    This PR (7830) - mean (272ms)  : 266, 278
    master - mean (270ms)  : 267, 273

    section CallTarget+Inlining+NGEN
    This PR (7830) - mean (936ms)  : 884, 987
    master - mean (937ms)  : 888, 986

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7830) - mean (270ms)  : 265, 276
    master - mean (274ms)  : 261, 288

    section Bailout
    This PR (7830) - mean (272ms)  : 265, 280
    master - mean (273ms)  : 266, 280

    section CallTarget+Inlining+NGEN
    This PR (7830) - mean (855ms)  : 833, 877
    master - mean (870ms)  : 846, 895

Loading

@pr-commenter
Copy link

pr-commenter bot commented Nov 17, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7830 compared to master:

  • 4 benchmarks are faster, with geometric mean 1.316
  • 5 benchmarks have fewer allocations
  • 4 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 #7830

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.68 KB 5.72 KB 32 B 0.56%

Fewer allocations 🎉 in #7830

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.09 KB 6.01 KB -84 B -1.38%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.9μs 57.2ns 297ns 0 0 0 5.53 KB
master StartStopWithChild netcoreapp3.1 13.5μs 34.9ns 126ns 0 0 0 5.68 KB
master StartStopWithChild net472 21.6μs 118ns 710ns 0.888 0.222 0 6.09 KB
#7830 StartStopWithChild net6.0 10.9μs 59.1ns 319ns 0 0 0 5.52 KB
#7830 StartStopWithChild netcoreapp3.1 14.2μs 56ns 217ns 0 0 0 5.72 KB
#7830 StartStopWithChild net472 22.4μs 112ns 513ns 1.02 0.34 0.113 6.01 KB
Benchmarks.Trace.AgentWriterBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 N/A N/A N/A NaN NaN NaN 0 b
master WriteAndFlushEnrichedTraces netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master WriteAndFlushEnrichedTraces net472 N/A N/A N/A NaN NaN NaN 0 b
#7830 WriteAndFlushEnrichedTraces net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7830 WriteAndFlushEnrichedTraces netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7830 WriteAndFlushEnrichedTraces net472 N/A N/A N/A NaN NaN NaN 0 b
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 0.68ns 2.54ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.38μs 7.81ns 55.8ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.07μs 0.45ns 1.69ns 0.192 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7.27μs 8.12ns 30.4ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 8.76μs 46.1ns 226ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.56μs 5.77ns 22.4ns 0.717 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 320ns 1.82ns 12.1ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 393ns 2.1ns 10.7ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 299ns 0.218ns 0.815ns 0.0443 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.36μs 29.6ns 119ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.78μs 34ns 132ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.67μs 1.84ns 7.11ns 0.6 0 0 3.8 KB
#7830 AllCycleSimpleBody net6.0 1.08μs 5.42ns 23.6ns 0 0 0 1.22 KB
#7830 AllCycleSimpleBody netcoreapp3.1 1.43μs 1.03ns 3.84ns 0 0 0 1.2 KB
#7830 AllCycleSimpleBody net472 1.05μs 0.542ns 2.1ns 0.195 0 0 1.23 KB
#7830 AllCycleMoreComplexBody net6.0 7.24μs 38.3ns 191ns 0 0 0 4.72 KB
#7830 AllCycleMoreComplexBody netcoreapp3.1 8.98μs 42.8ns 171ns 0 0 0 4.62 KB
#7830 AllCycleMoreComplexBody net472 7.54μs 3.5ns 13.5ns 0.721 0 0 4.74 KB
#7830 ObjectExtractorSimpleBody net6.0 342ns 0.0788ns 0.305ns 0 0 0 280 B
#7830 ObjectExtractorSimpleBody netcoreapp3.1 387ns 2.18ns 14.4ns 0 0 0 272 B
#7830 ObjectExtractorSimpleBody net472 300ns 0.333ns 1.29ns 0.0443 0 0 281 B
#7830 ObjectExtractorMoreComplexBody net6.0 6.32μs 32.5ns 152ns 0 0 0 3.78 KB
#7830 ObjectExtractorMoreComplexBody netcoreapp3.1 7.91μs 21.2ns 82ns 0 0 0 3.69 KB
#7830 ObjectExtractorMoreComplexBody net472 6.66μs 4.57ns 17.7ns 0.6 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7830

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs‑net472 2.16 KB 2.17 KB 13 B 0.60%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 79.3μs 345ns 1.29μs 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 97.5μs 273ns 1.06μs 0 0 0 32.4 KB
master EncodeArgs net472 110μs 28.3ns 110ns 4.97 0 0 32.51 KB
master EncodeLegacyArgs net6.0 149μs 17.2ns 64.5ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 198μs 449ns 1.74μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 262μs 46ns 178ns 0 0 0 2.16 KB
#7830 EncodeArgs net6.0 75.9μs 210ns 786ns 0 0 0 32.4 KB
#7830 EncodeArgs netcoreapp3.1 96μs 289ns 1.12μs 0 0 0 32.4 KB
#7830 EncodeArgs net472 111μs 15.5ns 60.1ns 5 0 0 32.51 KB
#7830 EncodeLegacyArgs net6.0 149μs 33.6ns 130ns 0 0 0 2.15 KB
#7830 EncodeLegacyArgs netcoreapp3.1 197μs 134ns 482ns 0 0 0 2.14 KB
#7830 EncodeLegacyArgs net472 266μs 197ns 762ns 0 0 0 2.17 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 430μs 1.21μs 4.35μs 0 0 0 5.48 KB
master RunWafRealisticBenchmark netcoreapp3.1 527μs 11.5μs 107μs 0 0 0 4.58 KB
master RunWafRealisticBenchmark net472 501μs 603ns 2.26μs 0 0 0 0 b
master RunWafRealisticBenchmarkWithAttack net6.0 318μs 794ns 2.75μs 0 0 0 3.17 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 377μs 3.98μs 38.6μs 0 0 0 2.32 KB
master RunWafRealisticBenchmarkWithAttack net472 371μs 192ns 691ns 0 0 0 0 b
#7830 RunWafRealisticBenchmark net6.0 437μs 2.34μs 12.6μs 0 0 0 5.48 KB
#7830 RunWafRealisticBenchmark netcoreapp3.1 453μs 2.08μs 7.49μs 0 0 0 4.58 KB
#7830 RunWafRealisticBenchmark net472 498μs 724ns 2.8μs 0 0 0 0 b
#7830 RunWafRealisticBenchmarkWithAttack net6.0 320μs 1.35μs 6.32μs 0 0 0 3.17 KB
#7830 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 351μs 2.99μs 28.7μs 0 0 0 2.32 KB
#7830 RunWafRealisticBenchmarkWithAttack net472 370μs 364ns 1.31μs 0 0 0 0 b
Benchmarks.Trace.AspNetCoreBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #7830

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑net6.0 1.259 76,894.58 61,064.26

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 77.4μs 242ns 939ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.5μs 376ns 1.84μs 0 0 0 17.42 KB
master SendRequest net472 0.00167ns 0.00105ns 0.00408ns 0 0 0 0 b
#7830 SendRequest net6.0 61μs 44.4ns 166ns 0 0 0 14.52 KB
#7830 SendRequest netcoreapp3.1 70.6μs 72.1ns 260ns 0 0 0 17.42 KB
#7830 SendRequest net472 0.151ns 0.00289ns 0.0112ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 Fewer allocations 🎉

Faster 🎉 in #7830

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice‑netcoreapp3.1 1.832 3,922,200.00 2,140,550.00
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 1.135 1,157,350.00 1,019,400.00

Fewer allocations 🎉 in #7830

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net6.0 352 B 304 B -48 B -13.64%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 2.01ms 580ns 2.09μs 0 0 0 640.3 KB
master OriginalCharSlice netcoreapp3.1 3.92ms 1.18μs 4.58μs 0 0 0 640.1 KB
master OriginalCharSlice net472 2.67ms 1.12μs 4.05μs 0 0 0 647.17 KB
master OptimizedCharSlice net6.0 1.56ms 1.06μs 3.97μs 0 0 0 352 B
master OptimizedCharSlice netcoreapp3.1 2.76ms 661ns 2.47μs 0 0 0 104 B
master OptimizedCharSlice net472 2.04ms 1.65μs 6.38μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 1.16ms 1.1μs 4.11μs 0 0 0 640 B
master OptimizedCharSliceWithPool netcoreapp3.1 1.91ms 1.38μs 5.36μs 0 0 0 104 B
master OptimizedCharSliceWithPool net472 1.13ms 739ns 2.86μs 0 0 0 0 b
#7830 OriginalCharSlice net6.0 2.1ms 413ns 1.55μs 0 0 0 640.64 KB
#7830 OriginalCharSlice netcoreapp3.1 2.15ms 4.69μs 29.7μs 0 0 0 640.1 KB
#7830 OriginalCharSlice net472 2.61ms 971ns 3.76μs 0 0 0 647.17 KB
#7830 OptimizedCharSlice net6.0 1.47ms 1.14μs 4.4μs 0 0 0 304 B
#7830 OptimizedCharSlice netcoreapp3.1 2.79ms 1.36μs 5.09μs 0 0 0 104 B
#7830 OptimizedCharSlice net472 1.97ms 829ns 3.1μs 0 0 0 0 b
#7830 OptimizedCharSliceWithPool net6.0 1.02ms 1.17μs 4.52μs 0 0 0 640 B
#7830 OptimizedCharSliceWithPool netcoreapp3.1 1.88ms 1.75μs 6.54μs 0 0 0 104 B
#7830 OptimizedCharSliceWithPool net472 1.14ms 770ns 2.98μs 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #7830

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 1.145 777,934.77 679,643.57

More allocations ⚠️ in #7830

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 55.63 KB 56.19 KB 563 B 1.01%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 771μs 3.65μs 14.1μs 0 0 0 41.83 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 685μs 1.01μs 3.77μs 0 0 0 41.94 KB
master WriteAndFlushEnrichedTraces net472 867μs 4.4μs 21.6μs 4.46 0 0 55.63 KB
#7830 WriteAndFlushEnrichedTraces net6.0 681μs 1.3μs 5.04μs 0 0 0 41.69 KB
#7830 WriteAndFlushEnrichedTraces netcoreapp3.1 666μs 2.42μs 9.05μs 0 0 0 42.04 KB
#7830 WriteAndFlushEnrichedTraces net472 887μs 4.4μs 19.7μs 7.81 0 0 56.19 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.86μs 6.69ns 25ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.58μs 13ns 59.7ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.79μs 6.36ns 24.6ns 0.154 0 0 987 B
#7830 ExecuteNonQuery net6.0 1.93μs 3.6ns 13.5ns 0 0 0 1.02 KB
#7830 ExecuteNonQuery netcoreapp3.1 2.53μs 9.93ns 38.5ns 0 0 0 1.02 KB
#7830 ExecuteNonQuery net472 2.95μs 3.19ns 12.3ns 0.148 0 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.77μs 2.66ns 10.3ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.32μs 7.37ns 28.5ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.49μs 7.93ns 30.7ns 0.159 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.8μs 9.28ns 41.5ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.38μs 11.4ns 48.5ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.73μs 5.03ns 19.5ns 0.166 0 0 1.1 KB
#7830 CallElasticsearch net6.0 1.74μs 8.34ns 33.3ns 0 0 0 1.03 KB
#7830 CallElasticsearch netcoreapp3.1 2.26μs 8.87ns 33.2ns 0 0 0 1.03 KB
#7830 CallElasticsearch net472 3.41μs 4.01ns 15.5ns 0.154 0 0 1.04 KB
#7830 CallElasticsearchAsync net6.0 1.79μs 9.27ns 42.5ns 0 0 0 1.01 KB
#7830 CallElasticsearchAsync netcoreapp3.1 2.51μs 3.64ns 14.1ns 0 0 0 1.08 KB
#7830 CallElasticsearchAsync net472 3.59μs 5.4ns 20.9ns 0.163 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.94μs 4.71ns 18.3ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.45μs 11.9ns 49.1ns 0 0 0 952 B
master ExecuteAsync net472 2.61μs 5.42ns 21ns 0.142 0 0 915 B
#7830 ExecuteAsync net6.0 1.93μs 3.48ns 13ns 0 0 0 952 B
#7830 ExecuteAsync netcoreapp3.1 2.41μs 7.74ns 30ns 0 0 0 952 B
#7830 ExecuteAsync net472 2.71μs 4.35ns 16.9ns 0.136 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.99μs 21.3ns 82.5ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.59μs 32.3ns 125ns 0 0 0 2.9 KB
master SendAsync net472 12.2μs 9.13ns 34.2ns 0.486 0 0 3.18 KB
#7830 SendAsync net6.0 6.77μs 4.38ns 17ns 0 0 0 2.36 KB
#7830 SendAsync netcoreapp3.1 8.62μs 31.8ns 123ns 0 0 0 2.9 KB
#7830 SendAsync net472 12.1μs 10.4ns 39ns 0.485 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7830

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 258.27 KB 274.51 KB 16.24 KB 6.29%

Fewer allocations 🎉 in #7830

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 43.19 KB 42.74 KB -456 B -1.06%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 45.32 KB 43.44 KB -1.88 KB -4.15%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 289.19 KB 276.13 KB -13.06 KB -4.52%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 50.8μs 414ns 3.97μs 0 0 0 45.32 KB
master StringConcatBenchmark netcoreapp3.1 50μs 291ns 2.23μs 0 0 0 43.19 KB
master StringConcatBenchmark net472 57.2μs 157ns 586ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 504μs 1.69μs 8.08μs 0 0 0 275.34 KB
master StringConcatAspectBenchmark netcoreapp3.1 491μs 1.28μs 6.38μs 0 0 0 258.27 KB
master StringConcatAspectBenchmark net472 411μs 2.2μs 11.6μs 0 0 0 289.19 KB
#7830 StringConcatBenchmark net6.0 44.3μs 218ns 1.02μs 0 0 0 43.44 KB
#7830 StringConcatBenchmark netcoreapp3.1 50μs 278ns 1.76μs 0 0 0 42.74 KB
#7830 StringConcatBenchmark net472 56.7μs 216ns 778ns 0 0 0 57.34 KB
#7830 StringConcatAspectBenchmark net6.0 456μs 2.08μs 8.04μs 0 0 0 275.68 KB
#7830 StringConcatAspectBenchmark netcoreapp3.1 535μs 892ns 3.22μs 0 0 0 274.51 KB
#7830 StringConcatAspectBenchmark net472 410μs 2.37μs 18.5μs 0 0 0 276.13 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.77μs 3.78ns 14.6ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.57μs 18.9ns 98.4ns 0 0 0 1.7 KB
master EnrichedLog net472 4μs 5.03ns 19.5ns 0.241 0 0 1.64 KB
#7830 EnrichedLog net6.0 2.75μs 12.8ns 49.6ns 0 0 0 1.7 KB
#7830 EnrichedLog netcoreapp3.1 3.71μs 15ns 58.2ns 0 0 0 1.7 KB
#7830 EnrichedLog net472 3.95μs 5.84ns 22.6ns 0.259 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 128μs 623ns 2.65μs 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 129μs 322ns 1.16μs 0 0 0 4.31 KB
master EnrichedLog net472 168μs 137ns 530ns 0 0 0 4.52 KB
#7830 EnrichedLog net6.0 124μs 583ns 2.26μs 0 0 0 4.31 KB
#7830 EnrichedLog netcoreapp3.1 128μs 70.4ns 264ns 0 0 0 4.31 KB
#7830 EnrichedLog net472 168μs 105ns 406ns 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 5.07μs 8.02ns 31.1ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.8μs 27.1ns 105ns 0 0 0 2.26 KB
master EnrichedLog net472 7.78μs 7.7ns 29.8ns 0.307 0 0 2.08 KB
#7830 EnrichedLog net6.0 5.06μs 19.6ns 76.1ns 0 0 0 2.26 KB
#7830 EnrichedLog netcoreapp3.1 6.76μs 18.6ns 72ns 0 0 0 2.26 KB
#7830 EnrichedLog net472 7.65μs 5.57ns 21.6ns 0.306 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 1.95μs 9.1ns 34.1ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.73μs 8.53ns 33ns 0 0 0 1.2 KB
master SendReceive net472 3.09μs 5.53ns 21.4ns 0.185 0 0 1.2 KB
#7830 SendReceive net6.0 2μs 8.59ns 31ns 0 0 0 1.2 KB
#7830 SendReceive netcoreapp3.1 2.68μs 9.1ns 35.2ns 0 0 0 1.2 KB
#7830 SendReceive net472 3.1μs 3.12ns 11.2ns 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.4μs 5.62ns 21.8ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.86μs 10.4ns 40.2ns 0 0 0 1.63 KB
master EnrichedLog net472 6.61μs 8.71ns 33.7ns 0.295 0 0 2.03 KB
#7830 EnrichedLog net6.0 4.32μs 3.96ns 15.3ns 0 0 0 1.58 KB
#7830 EnrichedLog netcoreapp3.1 5.82μs 13.8ns 53.6ns 0 0 0 1.63 KB
#7830 EnrichedLog net472 6.56μs 10.4ns 40.2ns 0.294 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 806ns 0.304ns 1.18ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 981ns 5.14ns 24.7ns 0 0 0 576 B
master StartFinishSpan net472 934ns 0.239ns 0.924ns 0.0899 0 0 578 B
master StartFinishScope net6.0 955ns 3.17ns 12.3ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.14μs 6.08ns 31ns 0 0 0 696 B
master StartFinishScope net472 1.1μs 0.221ns 0.828ns 0.1 0 0 658 B
master StartFinishTwoScopes net6.0 1.82μs 0.764ns 2.96ns 0 0 0 1.19 KB
master StartFinishTwoScopes netcoreapp3.1 2.26μs 11.3ns 49.2ns 0 0 0 1.19 KB
master StartFinishTwoScopes net472 2.12μs 2.43ns 9.42ns 0.17 0 0 1.08 KB
#7830 StartFinishSpan net6.0 784ns 3.74ns 15.4ns 0 0 0 576 B
#7830 StartFinishSpan netcoreapp3.1 982ns 4.38ns 16.9ns 0 0 0 576 B
#7830 StartFinishSpan net472 896ns 0.105ns 0.408ns 0.0902 0 0 578 B
#7830 StartFinishScope net6.0 947ns 4.66ns 19.8ns 0 0 0 696 B
#7830 StartFinishScope netcoreapp3.1 1.18μs 5.71ns 24.2ns 0 0 0 696 B
#7830 StartFinishScope net472 1.11μs 0.154ns 0.598ns 0.1 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.13μs 5.2ns 20.8ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.41μs 6.92ns 29.4ns 0 0 0 696 B
master RunOnMethodBegin net472 1.46μs 0.161ns 0.601ns 0.102 0 0 658 B
#7830 RunOnMethodBegin net6.0 1.1μs 5.58ns 26.7ns 0 0 0 696 B
#7830 RunOnMethodBegin netcoreapp3.1 1.43μs 0.877ns 3.28ns 0 0 0 696 B
#7830 RunOnMethodBegin net472 1.45μs 0.804ns 3.11ns 0.103 0 0 658 B

@lucaspimentel lucaspimentel requested a review from a team November 18, 2025 21:24
Copy link
Collaborator

@NachoEchevarria NachoEchevarria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@andrewlock andrewlock force-pushed the andrew/rewrite-runtime-metrics-to-avoid-recurrsion branch from c6a5e9b to ff9692f Compare November 27, 2025 09:51
@datadog-official
Copy link

datadog-official bot commented Nov 27, 2025

⚠️ Tests

⚠️ Warnings

❄️ 1 New flaky test detected

Profiler_liveheap_cpu_walltime from LiveHeap.windows.json.scenarios (Datadog)

 ########### Finishing run at 11/27/2025 10:39:39 AM44stem.Diagnostics.Tracing.EventPipeEventDispatcher.DispatchEventsToEventListeners()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task+<>c.<.cctor>b__273_0(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(System.Threading.Thread)
   at System.Threading.Tasks.ThreadPoolTaskScheduler+<>c.<.cctor>b__10_0(System.Object)
   at System.Threading.Thread.StartCallback()
PoolTaskScheduler+<>c.<.cctor>b__10_0(System.Object)
...

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ff9692f | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@andrewlock andrewlock enabled auto-merge (squash) November 27, 2025 11:35
@andrewlock andrewlock merged commit 03b420d into master Nov 27, 2025
146 of 149 checks passed
@andrewlock andrewlock deleted the andrew/rewrite-runtime-metrics-to-avoid-recurrsion branch November 27, 2025 11:40
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:runtime-metrics area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) identified-by:crashtracking type:bug type:refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants