[Code Origin] Skip exit-span hook in Tracer.StartSpan#8635
Conversation
Exit-span Code Origin has been hard-disabled since 3.28.0 by the constant-true ShouldSkipExitSpan(). The call from Tracer.StartSpan still paid a virtual call, a WebTags pattern-match, and a structured Debug log on every server entry span. Drop the call site to avoid that per-span tax while the feature is off; the method and its tests are kept so re-enabling is a small revert.
BenchmarksBenchmark execution time: 2026-05-14 10:51:05 Comparing candidate commit ffdf346 in PR branch Some scenarios are present only in baseline or only in candidate runs. If you didn't create or remove some scenarios in your branch, this maybe a sign of crashed benchmarks 💥💥💥 Scenarios present only in baseline:
Found 1 performance improvements and 3 performance regressions! Performance is the same for 49 metrics, 19 unstable metrics, 88 known flaky benchmarks, 38 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8635) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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:
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 chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8635) - mean (73ms) : 70, 76
master - mean (74ms) : 70, 78
section Bailout
This PR (8635) - mean (78ms) : 74, 81
master - mean (77ms) : 75, 79
section CallTarget+Inlining+NGEN
This PR (8635) - mean (1,107ms) : 1042, 1172
master - mean (1,103ms) : 1043, 1164
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 (8635) - mean (116ms) : 109, 122
master - mean (114ms) : 109, 120
section Bailout
This PR (8635) - mean (117ms) : 112, 122
master - mean (114ms) : 110, 117
section CallTarget+Inlining+NGEN
This PR (8635) - mean (791ms) : 760, 822
master - mean (793ms) : 762, 823
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8635) - mean (105ms) : 98, 112
master - mean (102ms) : 97, 108
section Bailout
This PR (8635) - mean (103ms) : 99, 108
master - mean (102ms) : 100, 104
section CallTarget+Inlining+NGEN
This PR (8635) - mean (952ms) : 903, 1002
master - mean (947ms) : 902, 991
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8635) - mean (100ms) : 94, 105
master - mean (101ms) : 96, 107
section Bailout
This PR (8635) - mean (104ms) : 99, 109
master - mean (103ms) : 98, 108
section CallTarget+Inlining+NGEN
This PR (8635) - mean (819ms) : 784, 854
master - mean (821ms) : 778, 864
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 (8635) - mean (200ms) : 195, 205
master - mean (199ms) : 193, 205
section Bailout
This PR (8635) - mean (204ms) : 200, 208
master - mean (202ms) : 199, 206
section CallTarget+Inlining+NGEN
This PR (8635) - mean (1,201ms) : 1155, 1246
master - mean (1,197ms) : 1153, 1240
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 (8635) - mean (290ms) : 283, 297
master - mean (287ms) : 278, 296
section Bailout
This PR (8635) - mean (288ms) : 281, 295
master - mean (287ms) : 281, 294
section CallTarget+Inlining+NGEN
This PR (8635) - mean (967ms) : 950, 984
master - mean (961ms) : 945, 978
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8635) - mean (282ms) : 275, 289
master - mean (276ms) : 268, 285
section Bailout
This PR (8635) - mean (281ms) : 273, 289
master - mean (278ms) : 272, 284
section CallTarget+Inlining+NGEN
This PR (8635) - mean (1,160ms) : 1120, 1199
master - mean (1,157ms) : 1125, 1190
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8635) - mean (280ms) : 273, 287
master - mean (279ms) : 274, 285
section Bailout
This PR (8635) - mean (279ms) : 272, 286
master - mean (279ms) : 275, 284
section CallTarget+Inlining+NGEN
This PR (8635) - mean (1,039ms) : 992, 1087
master - mean (1,037ms) : 995, 1078
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary of changes
DebuggerManager.Instance.CodeOrigin?.SetCodeOriginForExitSpan(span)call fromTracer.StartSpanso the exit-span Code Origin hook is no longer invoked on every span.SpanCodeOrigin.ShouldSkipExitSpan()so re-enablers know to restore the call site inTracer.StartSpanin addition to updating the existing tests.Reason for change
ShouldSkipExitSpan()returnstrue), soSetCodeOriginForExitSpanis a behavioral no-op today.StartSpan, paying a virtual call +WebTagstype/property check on every span, plus a structuredLog.Debugon every server entry span. Per-span overhead with no observable effect.Implementation details
SetCodeOriginForExitSpan,AddExitSpanTags,PopulateUserFrames,ShouldSkipExitSpan) is intentionally left in place so:SpanCodeOriginTests.ExitSpanTests(which invokes the method directly) stays green.Tracer.StartSpanand flipShouldSkipExitSpan).SetCodeOriginForExitSpanare now the method definition itself and the direct test callers.