[Dynamic Instrumentation] DEBUG-4877 Stabilize snapshot serializer#7989
[Dynamic Instrumentation] DEBUG-4877 Stabilize snapshot serializer#7989dudikeleti merged 1 commit intomasterfrom
Conversation
BenchmarksBenchmark execution time: 2025-12-20 13:34:57 Comparing candidate commit 8137222 in PR branch Found 7 performance improvements and 3 performance regressions! Performance is the same for 156 metrics, 20 unstable metrics. scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
scenario:Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery net6.0
scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
|
8137222 to
3f7c97e
Compare
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7989) 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 (7989) - mean (69ms) : 66, 71
master - mean (68ms) : 67, 70
section Bailout
This PR (7989) - mean (72ms) : 71, 73
master - mean (73ms) : 72, 73
section CallTarget+Inlining+NGEN
This PR (7989) - mean (1,015ms) : 942, 1087
master - mean (1,007ms) : 954, 1061
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 (7989) - mean (106ms) : 103, 109
master - mean (106ms) : 103, 109
section Bailout
This PR (7989) - mean (107ms) : 106, 108
master - mean (107ms) : 106, 108
section CallTarget+Inlining+NGEN
This PR (7989) - mean (748ms) : 700, 795
master - mean (736ms) : 673, 799
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7989) - mean (94ms) : 92, 97
master - mean (94ms) : 91, 97
section Bailout
This PR (7989) - mean (95ms) : 94, 96
master - mean (95ms) : 94, 96
section CallTarget+Inlining+NGEN
This PR (7989) - mean (716ms) : 665, 768
master - mean (715ms) : 669, 761
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7989) - mean (92ms) : 90, 94
master - mean (92ms) : 90, 95
section Bailout
This PR (7989) - mean (93ms) : 92, 95
master - mean (93ms) : 92, 95
section CallTarget+Inlining+NGEN
This PR (7989) - mean (635ms) : 621, 648
master - mean (634ms) : 621, 647
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 (7989) - mean (195ms) : 190, 200
master - mean (194ms) : 190, 198
section Bailout
This PR (7989) - mean (197ms) : 194, 200
master - mean (198ms) : 194, 201
section CallTarget+Inlining+NGEN
This PR (7989) - mean (1,126ms) : 1067, 1185
master - mean (1,140ms) : 1048, 1233
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 (7989) - mean (278ms) : 272, 283
master - mean (278ms) : 272, 284
section Bailout
This PR (7989) - mean (279ms) : 273, 286
master - mean (278ms) : 275, 281
section CallTarget+Inlining+NGEN
This PR (7989) - mean (931ms) : 892, 971
master - mean (939ms) : 904, 975
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7989) - mean (271ms) : 266, 276
master - mean (272ms) : 265, 280
section Bailout
This PR (7989) - mean (270ms) : 266, 274
master - mean (270ms) : 266, 274
section CallTarget+Inlining+NGEN
This PR (7989) - mean (924ms) : 881, 968
master - mean (929ms) : 879, 980
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7989) - mean (269ms) : 264, 274
master - mean (270ms) : 265, 275
section Bailout
This PR (7989) - mean (270ms) : 266, 275
master - mean (270ms) : 266, 274
section CallTarget+Inlining+NGEN
This PR (7989) - mean (835ms) : 813, 857
master - mean (836ms) : 817, 854
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Reason for change In some cases, we cannot rely on the method metadata to determine whether method arguments and locals exist, as they may still be skipped. ## Implementation details Track open nodes and open/close them as required. ## Test coverage #7987 ## Other details This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end. #7986 #7989
…l and LogArg to detect null byrefs (#7986) ## Reason for change Some methods can legitimately produce null managed byrefs (e.g., MemoryMarshal.GetReference(emptySpan)), which makes ref T point to address 0. Attempting to capture such locals/args would dereference an invalid reference and could crash in LogLocal/LogArg (NullReferenceException). This change makes DI runs stable and keeps probes installed while avoiding unsafe dereferences ## Implementation details Before reading a ref T capture input, we check Unsafe.IsNullRef(ref value) and return early to avoid dereferencing an invalid reference. Current behavior is to skip capturing that member entirely (no misleading null value for non-nullable types like byte). Follow-up option: if we decide we want the snapshot to explicitly show this case, we can reuse the existing snapshot notCapturedReason mechanism (no new reason added in this PR). ## Test coverage #7987 ## Other details This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end. #7988 #7989
## Summary of changes Add a new test that uncovers two bugs: 1. When a null address is passed into our instrumentation code. 2. When locals or arguments exist but are skipped, resulting in an invalid JSON structure. ## Implementation details When a null address is passed to our debugger invoker classes, it must be handled explicitly by checking `Unsafe.IsNullRef`. ## Other details The test is currently skipped and will be enabled once the following PRs are merged: #7986 #7988 #7989
Summary of changes
Add defensive checks for open nodes before closing them, and delay writing
noCaptureReasonuntil we are certain that the array node is closed.Test coverage
#7987
Other details
This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end.
Related PRs:
#7986
#7988