Restore null scope check to stop EventBridge injection#7919
Conversation
This comment has been minimized.
This comment has been minimized.
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7919) 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 (7919) - mean (77ms) : 69, 85
master - mean (76ms) : 71, 80
section Bailout
This PR (7919) - mean (80ms) : 74, 86
master - mean (82ms) : 74, 90
section CallTarget+Inlining+NGEN
This PR (7919) - mean (1,084ms) : 1017, 1152
master - mean (1,089ms) : 1025, 1153
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 (7919) - mean (118ms) : 109, 127
master - mean (119ms) : 109, 128
section Bailout
This PR (7919) - mean (119ms) : 111, 127
master - mean (120ms) : 112, 129
section CallTarget+Inlining+NGEN
This PR (7919) - mean (765ms) : 728, 802
master - mean (772ms) : 731, 813
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7919) - mean (104ms) : 97, 111
master - mean (104ms) : 97, 111
section Bailout
This PR (7919) - mean (106ms) : 98, 113
master - mean (108ms) : 99, 117
section CallTarget+Inlining+NGEN
This PR (7919) - mean (716ms) : 676, 755
master - mean (710ms) : 673, 747
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7919) - mean (104ms) : 95, 112
master - mean (103ms) : 95, 111
section Bailout
This PR (7919) - mean (104ms) : 97, 111
master - mean (104ms) : 97, 111
section CallTarget+Inlining+NGEN
This PR (7919) - mean (683ms) : 647, 719
master - mean (681ms) : 645, 717
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 (7919) - mean (196ms) : 190, 201
master - mean (196ms) : 189, 202
section Bailout
This PR (7919) - mean (199ms) : 195, 203
master - mean (198ms) : 195, 202
section CallTarget+Inlining+NGEN
This PR (7919) - mean (1,133ms) : 1072, 1194
master - mean (1,124ms) : 1072, 1176
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 (7919) - mean (281ms) : 274, 287
master - mean (281ms) : 273, 288
section Bailout
This PR (7919) - mean (280ms) : 274, 287
master - mean (279ms) : 273, 285
section CallTarget+Inlining+NGEN
This PR (7919) - mean (917ms) : 867, 967
master - mean (914ms) : 865, 963
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7919) - mean (274ms) : 267, 280
master - mean (274ms) : 266, 282
section Bailout
This PR (7919) - mean (275ms) : 265, 284
master - mean (273ms) : 268, 278
section CallTarget+Inlining+NGEN
This PR (7919) - mean (896ms) : 847, 946
master - mean (897ms) : 848, 945
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7919) - mean (272ms) : 264, 279
master - mean (271ms) : 264, 279
section Bailout
This PR (7919) - mean (272ms) : 265, 278
master - mean (272ms) : 266, 279
section CallTarget+Inlining+NGEN
This PR (7919) - mean (833ms) : 803, 862
master - mean (833ms) : 813, 853
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
andrewlock
left a comment
There was a problem hiding this comment.
I feel like this is a pretty common pattern in the AWS integrations, are there any other examples we need to look at? 🤔
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7919 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ More allocations
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 | 5.94 KB | 5.99 KB | 47 B | 0.79% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartStopWithChild |
net6.0 | 10.5μs | 58.2ns | 382ns | 0 | 0 | 0 | 5.49 KB |
| master | StartStopWithChild |
netcoreapp3.1 | 14.8μs | 75.4ns | 362ns | 0 | 0 | 0 | 5.7 KB |
| master | StartStopWithChild |
net472 | 21.9μs | 116ns | 591ns | 0.965 | 0.429 | 0.107 | 5.94 KB |
| #7919 | StartStopWithChild |
net6.0 | 10.8μs | 56.1ns | 263ns | 0 | 0 | 0 | 5.48 KB |
| #7919 | StartStopWithChild |
netcoreapp3.1 | 13.5μs | 35.4ns | 128ns | 0 | 0 | 0 | 5.7 KB |
| #7919 | StartStopWithChild |
net472 | 21.9μs | 78.6ns | 294ns | 0.859 | 0.215 | 0 | 5.99 KB |
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 1.27ms | 279ns | 1.04μs | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.39ms | 137ns | 530ns | 0 | 0 | 0 | 2.7 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.68ms | 269ns | 968ns | 0 | 0 | 0 | 3.26 KB |
| #7919 | WriteAndFlushEnrichedTraces |
net6.0 | 1.27ms | 116ns | 436ns | 0 | 0 | 0 | 2.7 KB |
| #7919 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 1.37ms | 117ns | 439ns | 0 | 0 | 0 | 2.7 KB |
| #7919 | WriteAndFlushEnrichedTraces |
net472 | 1.7ms | 266ns | 994ns | 0 | 0 | 0 | 3.26 KB |
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #7919
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472
1.139
340.96
299.42
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 | 1.139 | 340.96 | 299.42 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net6.0 | 1.12μs | 6.16ns | 38.9ns | 0 | 0 | 0 | 1.22 KB |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 1.41μs | 6.78ns | 28ns | 0 | 0 | 0 | 1.2 KB |
| master | AllCycleSimpleBody |
net472 | 1.01μs | 1.72ns | 6.65ns | 0.191 | 0 | 0 | 1.23 KB |
| master | AllCycleMoreComplexBody |
net6.0 | 7.35μs | 34.3ns | 128ns | 0 | 0 | 0 | 4.72 KB |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.03μs | 43.4ns | 168ns | 0 | 0 | 0 | 4.62 KB |
| master | AllCycleMoreComplexBody |
net472 | 7.65μs | 2.64ns | 10.2ns | 0.726 | 0 | 0 | 4.74 KB |
| master | ObjectExtractorSimpleBody |
net6.0 | 337ns | 0.113ns | 0.424ns | 0 | 0 | 0 | 280 B |
| master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 404ns | 2.07ns | 9.7ns | 0 | 0 | 0 | 272 B |
| master | ObjectExtractorSimpleBody |
net472 | 341ns | 0.125ns | 0.469ns | 0.0444 | 0 | 0 | 281 B |
| master | ObjectExtractorMoreComplexBody |
net6.0 | 6.43μs | 29.5ns | 114ns | 0 | 0 | 0 | 3.78 KB |
| master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.87μs | 36.3ns | 145ns | 0 | 0 | 0 | 3.69 KB |
| master | ObjectExtractorMoreComplexBody |
net472 | 6.7μs | 1.07ns | 4.15ns | 0.571 | 0 | 0 | 3.8 KB |
| #7919 | AllCycleSimpleBody |
net6.0 | 1.1μs | 6.2ns | 41.1ns | 0 | 0 | 0 | 1.22 KB |
| #7919 | AllCycleSimpleBody |
netcoreapp3.1 | 1.38μs | 7.8ns | 51.2ns | 0 | 0 | 0 | 1.2 KB |
| #7919 | AllCycleSimpleBody |
net472 | 1μs | 0.644ns | 2.32ns | 0.191 | 0 | 0 | 1.23 KB |
| #7919 | AllCycleMoreComplexBody |
net6.0 | 7.29μs | 37.3ns | 171ns | 0 | 0 | 0 | 4.72 KB |
| #7919 | AllCycleMoreComplexBody |
netcoreapp3.1 | 9.06μs | 43ns | 177ns | 0 | 0 | 0 | 4.62 KB |
| #7919 | AllCycleMoreComplexBody |
net472 | 7.77μs | 7.65ns | 29.6ns | 0.737 | 0 | 0 | 4.74 KB |
| #7919 | ObjectExtractorSimpleBody |
net6.0 | 329ns | 1.89ns | 14.8ns | 0 | 0 | 0 | 280 B |
| #7919 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 403ns | 2.23ns | 12.6ns | 0 | 0 | 0 | 272 B |
| #7919 | ObjectExtractorSimpleBody |
net472 | 299ns | 0.0259ns | 0.0896ns | 0.0437 | 0 | 0 | 281 B |
| #7919 | ObjectExtractorMoreComplexBody |
net6.0 | 6.38μs | 28.4ns | 110ns | 0 | 0 | 0 | 3.78 KB |
| #7919 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 7.94μs | 39.6ns | 181ns | 0 | 0 | 0 | 3.69 KB |
| #7919 | ObjectExtractorMoreComplexBody |
net472 | 6.66μs | 1.78ns | 6.88ns | 0.599 | 0 | 0 | 3.8 KB |
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EncodeArgs |
net6.0 | 76.3μs | 174ns | 673ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
netcoreapp3.1 | 97.8μs | 188ns | 730ns | 0 | 0 | 0 | 32.4 KB |
| master | EncodeArgs |
net472 | 109μs | 58.5ns | 226ns | 4.9 | 0 | 0 | 32.5 KB |
| master | EncodeLegacyArgs |
net6.0 | 146μs | 15.9ns | 57.3ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
netcoreapp3.1 | 198μs | 51.2ns | 191ns | 0 | 0 | 0 | 2.14 KB |
| master | EncodeLegacyArgs |
net472 | 263μs | 27ns | 105ns | 0 | 0 | 0 | 2.14 KB |
| #7919 | EncodeArgs |
net6.0 | 76.5μs | 206ns | 797ns | 0 | 0 | 0 | 32.4 KB |
| #7919 | EncodeArgs |
netcoreapp3.1 | 99.8μs | 228ns | 882ns | 0 | 0 | 0 | 32.4 KB |
| #7919 | EncodeArgs |
net472 | 109μs | 19.1ns | 73.9ns | 4.88 | 0 | 0 | 32.5 KB |
| #7919 | EncodeLegacyArgs |
net6.0 | 142μs | 51.3ns | 192ns | 0 | 0 | 0 | 2.14 KB |
| #7919 | EncodeLegacyArgs |
netcoreapp3.1 | 198μs | 89.6ns | 347ns | 0 | 0 | 0 | 2.14 KB |
| #7919 | EncodeLegacyArgs |
net472 | 263μs | 39.5ns | 153ns | 0 | 0 | 0 | 2.14 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 | 418μs | 1.05μs | 4.2μs | 0 | 0 | 0 | 4.55 KB |
| master | RunWafRealisticBenchmark |
netcoreapp3.1 | 466μs | 3.38μs | 31.9μs | 0 | 0 | 0 | 4.48 KB |
| master | RunWafRealisticBenchmark |
net472 | 487μs | 459ns | 1.72μs | 0 | 0 | 0 | 0 b |
| master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 316μs | 1.42μs | 5.51μs | 0 | 0 | 0 | 2.24 KB |
| master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 351μs | 3.52μs | 34.3μs | 0 | 0 | 0 | 2.22 KB |
| master | RunWafRealisticBenchmarkWithAttack |
net472 | 360μs | 417ns | 1.56μs | 0 | 0 | 0 | 0 b |
| #7919 | RunWafRealisticBenchmark |
net6.0 | 428μs | 863ns | 3.11μs | 0 | 0 | 0 | 4.55 KB |
| #7919 | RunWafRealisticBenchmark |
netcoreapp3.1 | 460μs | 2.6μs | 24.4μs | 0 | 0 | 0 | 4.48 KB |
| #7919 | RunWafRealisticBenchmark |
net472 | 497μs | 924ns | 3.33μs | 0 | 0 | 0 | 0 b |
| #7919 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 317μs | 1.55μs | 8.08μs | 0 | 0 | 0 | 2.24 KB |
| #7919 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 357μs | 3.51μs | 33.7μs | 0 | 0 | 0 | 2.22 KB |
| #7919 | RunWafRealisticBenchmarkWithAttack |
net472 | 371μs | 728ns | 2.72μs | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 Fewer allocations 🎉
Fewer allocations 🎉 in #7919
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1
21.34 KB
21.18 KB
-152 B
-0.71%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 | 21.34 KB | 21.18 KB | -152 B | -0.71% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendRequest |
net6.0 | 83.9μs | 166ns | 621ns | 0 | 0 | 0 | 18.98 KB |
| master | SendRequest |
netcoreapp3.1 | 97.7μs | 276ns | 1.68μs | 0 | 0 | 0 | 21.34 KB |
| master | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
| #7919 | SendRequest |
net6.0 | 84.4μs | 229ns | 857ns | 0 | 0 | 0 | 18.97 KB |
| #7919 | SendRequest |
netcoreapp3.1 | 97.7μs | 290ns | 2.34μs | 0 | 0 | 0 | 21.18 KB |
| #7919 | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #7919
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice‑netcoreapp3.1
1.914
4,138,000.00
2,162,500.00
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice‑netcoreapp3.1 | 1.914 | 4,138,000.00 | 2,162,500.00 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 1.99ms | 758ns | 2.84μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 4.12ms | 10.8μs | 42μs | 0 | 0 | 0 | 640.05 KB |
| master | OriginalCharSlice |
net472 | 2.6ms | 655ns | 2.45μs | 0 | 0 | 0 | 638.98 KB |
| master | OptimizedCharSlice |
net6.0 | 1.43ms | 609ns | 2.36μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSlice |
netcoreapp3.1 | 2.73ms | 771ns | 2.99μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSlice |
net472 | 2.01ms | 456ns | 1.77μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 1.01ms | 502ns | 1.81μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.9ms | 1.2μs | 4.5μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net472 | 1.16ms | 693ns | 2.59μs | 0 | 0 | 0 | 0 b |
| #7919 | OriginalCharSlice |
net6.0 | 2.01ms | 779ns | 3.02μs | 0 | 0 | 0 | 640 KB |
| #7919 | OriginalCharSlice |
netcoreapp3.1 | 2.17ms | 4.85μs | 29.5μs | 0 | 0 | 0 | 640 KB |
| #7919 | OriginalCharSlice |
net472 | 2.63ms | 713ns | 2.67μs | 0 | 0 | 0 | 638.98 KB |
| #7919 | OptimizedCharSlice |
net6.0 | 1.38ms | 2.07μs | 8.01μs | 0 | 0 | 0 | 0 b |
| #7919 | OptimizedCharSlice |
netcoreapp3.1 | 2.78ms | 1.89μs | 7.3μs | 0 | 0 | 0 | 0 b |
| #7919 | OptimizedCharSlice |
net472 | 1.92ms | 699ns | 2.71μs | 0 | 0 | 0 | 0 b |
| #7919 | OptimizedCharSliceWithPool |
net6.0 | 1.05ms | 386ns | 1.39μs | 0 | 0 | 0 | 0 b |
| #7919 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.86ms | 1.04μs | 4.03μs | 0 | 0 | 0 | 0 b |
| #7919 | OptimizedCharSliceWithPool |
net472 | 1.13ms | 531ns | 2.05μs | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7919
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0
41.74 KB
42.56 KB
819 B
1.96%
Fewer allocations 🎉 in #7919
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
42.16 KB
41.93 KB
-234 B
-0.56%
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
56.59 KB
55.91 KB
-683 B
-1.21%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.74 KB | 42.56 KB | 819 B | 1.96% |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 42.16 KB | 41.93 KB | -234 B | -0.56% |
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 56.59 KB | 55.91 KB | -683 B | -1.21% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 635μs | 433ns | 1.5μs | 0 | 0 | 0 | 41.74 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 692μs | 4.31μs | 42.9μs | 0 | 0 | 0 | 42.16 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 985μs | 5.61μs | 44.2μs | 8.33 | 4.17 | 0 | 56.59 KB |
| #7919 | WriteAndFlushEnrichedTraces |
net6.0 | 688μs | 3.69μs | 19.9μs | 0 | 0 | 0 | 42.56 KB |
| #7919 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 677μs | 1.06μs | 4.61μs | 0 | 0 | 0 | 41.93 KB |
| #7919 | WriteAndFlushEnrichedTraces |
net472 | 880μs | 2.56μs | 9.93μs | 8.33 | 4.17 | 0 | 55.91 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.82μs | 8.17ns | 31.6ns | 0 | 0 | 0 | 968 B |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.53μs | 8.3ns | 32.1ns | 0 | 0 | 0 | 960 B |
| master | ExecuteNonQuery |
net472 | 2.71μs | 5.47ns | 21.2ns | 0.147 | 0 | 0 | 931 B |
| #7919 | ExecuteNonQuery |
net6.0 | 1.91μs | 6.88ns | 23.8ns | 0 | 0 | 0 | 968 B |
| #7919 | ExecuteNonQuery |
netcoreapp3.1 | 2.55μs | 9.55ns | 37ns | 0 | 0 | 0 | 960 B |
| #7919 | ExecuteNonQuery |
net472 | 2.82μs | 2.6ns | 9.38ns | 0.145 | 0 | 0 | 931 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.7μs | 4.04ns | 15.7ns | 0 | 0 | 0 | 952 B |
| master | CallElasticsearch |
netcoreapp3.1 | 2.14μs | 10.9ns | 53.4ns | 0 | 0 | 0 | 968 B |
| master | CallElasticsearch |
net472 | 3.51μs | 6.15ns | 23ns | 0.141 | 0 | 0 | 955 B |
| master | CallElasticsearchAsync |
net6.0 | 1.71μs | 3.45ns | 12.5ns | 0 | 0 | 0 | 928 B |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.26μs | 11.6ns | 51.9ns | 0 | 0 | 0 | 1.02 KB |
| master | CallElasticsearchAsync |
net472 | 3.48μs | 3.65ns | 14.1ns | 0.157 | 0 | 0 | 1.01 KB |
| #7919 | CallElasticsearch |
net6.0 | 1.68μs | 8.73ns | 44.5ns | 0 | 0 | 0 | 953 B |
| #7919 | CallElasticsearch |
netcoreapp3.1 | 2.29μs | 8.75ns | 33.9ns | 0 | 0 | 0 | 968 B |
| #7919 | CallElasticsearch |
net472 | 3.3μs | 2.84ns | 10.2ns | 0.148 | 0 | 0 | 955 B |
| #7919 | CallElasticsearchAsync |
net6.0 | 1.84μs | 7.52ns | 29.1ns | 0 | 0 | 0 | 928 B |
| #7919 | CallElasticsearchAsync |
netcoreapp3.1 | 2.51μs | 8.4ns | 32.5ns | 0 | 0 | 0 | 1.02 KB |
| #7919 | CallElasticsearchAsync |
net472 | 3.59μs | 0.934ns | 3.5ns | 0.143 | 0 | 0 | 1.01 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.86μs | 6.49ns | 25.1ns | 0 | 0 | 0 | 896 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.41μs | 12.4ns | 56.9ns | 0 | 0 | 0 | 896 B |
| master | ExecuteAsync |
net472 | 2.61μs | 2.2ns | 8.51ns | 0.129 | 0 | 0 | 858 B |
| #7919 | ExecuteAsync |
net6.0 | 1.88μs | 0.385ns | 1.39ns | 0 | 0 | 0 | 896 B |
| #7919 | ExecuteAsync |
netcoreapp3.1 | 2.44μs | 8.74ns | 33.9ns | 0 | 0 | 0 | 896 B |
| #7919 | ExecuteAsync |
net472 | 2.6μs | 7.72ns | 29.9ns | 0.13 | 0 | 0 | 859 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.72μs | 9.46ns | 35.4ns | 0 | 0 | 0 | 2.29 KB |
| master | SendAsync |
netcoreapp3.1 | 8.37μs | 38.4ns | 149ns | 0 | 0 | 0 | 2.83 KB |
| master | SendAsync |
net472 | 12μs | 12.3ns | 47.8ns | 0.479 | 0 | 0 | 3.08 KB |
| #7919 | SendAsync |
net6.0 | 7.16μs | 15.6ns | 60.6ns | 0 | 0 | 0 | 2.29 KB |
| #7919 | SendAsync |
netcoreapp3.1 | 8.54μs | 16.2ns | 62.7ns | 0 | 0 | 0 | 2.83 KB |
| #7919 | SendAsync |
net472 | 12.1μs | 3.21ns | 12ns | 0.482 | 0 | 0 | 3.08 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️
Slower ⚠️ in #7919
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
1.196
428,300.00
512,350.00
Faster 🎉 in #7919
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
1.142
479,650.00
420,150.00
More allocations ⚠️ in #7919
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
248.48 KB
272.21 KB
23.73 KB
9.55%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
254.78 KB
278.49 KB
23.7 KB
9.30%
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 1.196 | 428,300.00 | 512,350.00 |
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 1.142 | 479,650.00 | 420,150.00 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 248.48 KB | 272.21 KB | 23.73 KB | 9.55% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 254.78 KB | 278.49 KB | 23.7 KB | 9.30% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 46.7μs | 258ns | 1.73μs | 0 | 0 | 0 | 42.51 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 48.8μs | 237ns | 1.03μs | 0 | 0 | 0 | 42.54 KB |
| master | StringConcatBenchmark |
net472 | 57.4μs | 147ns | 508ns | 0 | 0 | 0 | 49.15 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 432μs | 1.94μs | 7.5μs | 0 | 0 | 0 | 248.48 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 482μs | 2.49μs | 13.7μs | 0 | 0 | 0 | 254.78 KB |
| master | StringConcatAspectBenchmark |
net472 | 394μs | 1.88μs | 7.98μs | 0 | 0 | 0 | 270.34 KB |
| #7919 | StringConcatBenchmark |
net6.0 | 44.5μs | 237ns | 1.75μs | 0 | 0 | 0 | 42.51 KB |
| #7919 | StringConcatBenchmark |
netcoreapp3.1 | 49.6μs | 375ns | 3.6μs | 0 | 0 | 0 | 42.54 KB |
| #7919 | StringConcatBenchmark |
net472 | 58.3μs | 176ns | 636ns | 0 | 0 | 0 | 49.15 KB |
| #7919 | StringConcatAspectBenchmark |
net6.0 | 514μs | 2.28μs | 7.91μs | 0 | 0 | 0 | 272.21 KB |
| #7919 | StringConcatAspectBenchmark |
netcoreapp3.1 | 423μs | 1.81μs | 14.8μs | 0 | 0 | 0 | 278.49 KB |
| #7919 | StringConcatAspectBenchmark |
net472 | 401μs | 1.4μs | 5.06μs | 0 | 0 | 0 | 270.34 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.65μs | 14.3ns | 74.4ns | 0 | 0 | 0 | 1.69 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.53μs | 15.5ns | 60ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.81μs | 4ns | 15.5ns | 0.247 | 0 | 0 | 1.6 KB |
| #7919 | EnrichedLog |
net6.0 | 2.68μs | 9.65ns | 37.4ns | 0 | 0 | 0 | 1.69 KB |
| #7919 | EnrichedLog |
netcoreapp3.1 | 3.51μs | 17.3ns | 75.6ns | 0 | 0 | 0 | 1.7 KB |
| #7919 | EnrichedLog |
net472 | 3.8μs | 4.88ns | 18.9ns | 0.245 | 0 | 0 | 1.6 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 | 123μs | 50.1ns | 194ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 129μs | 147ns | 530ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 166μs | 294ns | 1.14μs | 0 | 0 | 0 | 4.51 KB |
| #7919 | EnrichedLog |
net6.0 | 124μs | 150ns | 542ns | 0 | 0 | 0 | 4.31 KB |
| #7919 | EnrichedLog |
netcoreapp3.1 | 130μs | 394ns | 1.53μs | 0 | 0 | 0 | 4.31 KB |
| #7919 | EnrichedLog |
net472 | 168μs | 144ns | 539ns | 0 | 0 | 0 | 4.51 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.14μs | 4.66ns | 18ns | 0 | 0 | 0 | 2.24 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.89μs | 16.9ns | 63.1ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.53μs | 3.71ns | 14.4ns | 0.301 | 0 | 0 | 2.05 KB |
| #7919 | EnrichedLog |
net6.0 | 5.11μs | 9.37ns | 36.3ns | 0 | 0 | 0 | 2.24 KB |
| #7919 | EnrichedLog |
netcoreapp3.1 | 6.76μs | 19.3ns | 74.9ns | 0 | 0 | 0 | 2.26 KB |
| #7919 | EnrichedLog |
net472 | 7.74μs | 10.3ns | 39.9ns | 0.308 | 0 | 0 | 2.05 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.96μs | 7.5ns | 29.1ns | 0 | 0 | 0 | 1.12 KB |
| master | SendReceive |
netcoreapp3.1 | 2.53μs | 12.5ns | 54.5ns | 0 | 0 | 0 | 1.14 KB |
| master | SendReceive |
net472 | 3.05μs | 2.28ns | 8.85ns | 0.169 | 0 | 0 | 1.12 KB |
| #7919 | SendReceive |
net6.0 | 1.94μs | 8.85ns | 34.3ns | 0 | 0 | 0 | 1.12 KB |
| #7919 | SendReceive |
netcoreapp3.1 | 2.57μs | 1.77ns | 6.38ns | 0 | 0 | 0 | 1.14 KB |
| #7919 | SendReceive |
net472 | 2.91μs | 4.08ns | 15.8ns | 0.174 | 0 | 0 | 1.12 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.45μs | 12.2ns | 47.1ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.78μs | 13ns | 50.2ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.7μs | 10.6ns | 41.1ns | 0.302 | 0 | 0 | 2.03 KB |
| #7919 | EnrichedLog |
net6.0 | 4.38μs | 8.51ns | 32.9ns | 0 | 0 | 0 | 1.58 KB |
| #7919 | EnrichedLog |
netcoreapp3.1 | 5.63μs | 17.6ns | 68.1ns | 0 | 0 | 0 | 1.63 KB |
| #7919 | EnrichedLog |
net472 | 6.59μs | 7.84ns | 30.4ns | 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 | 796ns | 0.418ns | 1.62ns | 0 | 0 | 0 | 520 B |
| master | StartFinishSpan |
netcoreapp3.1 | 987ns | 1.49ns | 5.79ns | 0 | 0 | 0 | 520 B |
| master | StartFinishSpan |
net472 | 888ns | 0.24ns | 0.929ns | 0.08 | 0 | 0 | 522 B |
| master | StartFinishScope |
net6.0 | 896ns | 4.35ns | 19.5ns | 0 | 0 | 0 | 640 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.13μs | 5.61ns | 25.1ns | 0 | 0 | 0 | 640 B |
| master | StartFinishScope |
net472 | 1.08μs | 0.254ns | 0.983ns | 0.0919 | 0 | 0 | 602 B |
| master | StartFinishTwoScopes |
net6.0 | 1.78μs | 0.706ns | 2.64ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
netcoreapp3.1 | 2.24μs | 9.69ns | 37.5ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
net472 | 2.1μs | 0.395ns | 1.48ns | 0.168 | 0 | 0 | 1.08 KB |
| #7919 | StartFinishSpan |
net6.0 | 771ns | 0.502ns | 1.88ns | 0 | 0 | 0 | 520 B |
| #7919 | StartFinishSpan |
netcoreapp3.1 | 982ns | 4.66ns | 19.2ns | 0 | 0 | 0 | 520 B |
| #7919 | StartFinishSpan |
net472 | 916ns | 0.251ns | 0.94ns | 0.0826 | 0 | 0 | 522 B |
| #7919 | StartFinishScope |
net6.0 | 904ns | 4.66ns | 23.8ns | 0 | 0 | 0 | 640 B |
| #7919 | StartFinishScope |
netcoreapp3.1 | 1.15μs | 6.33ns | 35.8ns | 0 | 0 | 0 | 640 B |
| #7919 | StartFinishScope |
net472 | 1.1μs | 0.453ns | 1.75ns | 0.0941 | 0 | 0 | 602 B |
| #7919 | StartFinishTwoScopes |
net6.0 | 1.8μs | 8.83ns | 36.4ns | 0 | 0 | 0 | 1.19 KB |
| #7919 | StartFinishTwoScopes |
netcoreapp3.1 | 2.23μs | 11.5ns | 55ns | 0 | 0 | 0 | 1.19 KB |
| #7919 | StartFinishTwoScopes |
net472 | 2.17μs | 0.312ns | 1.13ns | 0.163 | 0 | 0 | 1.08 KB |
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.07μs | 0.5ns | 1.87ns | 0 | 0 | 0 | 640 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.37μs | 6.48ns | 25.1ns | 0 | 0 | 0 | 640 B |
| master | RunOnMethodBegin |
net472 | 1.44μs | 0.909ns | 3.52ns | 0.0943 | 0 | 0 | 602 B |
| #7919 | RunOnMethodBegin |
net6.0 | 1.07μs | 5.61ns | 28.6ns | 0 | 0 | 0 | 640 B |
| #7919 | RunOnMethodBegin |
netcoreapp3.1 | 1.39μs | 4.99ns | 19.3ns | 0 | 0 | 0 | 640 B |
| #7919 | RunOnMethodBegin |
net472 | 1.43μs | 0.154ns | 0.595ns | 0.0929 | 0 | 0 | 602 B |
Summary of changes
When the EventBridge instrumentation is disabled we should not inject headers / context into the object. This was the case initially in #6096, but appears to have been accidentally removed in a refactoring in #6157.
Reason for change
Appears that we do not entirely support certain message types here.
Implementation details
Essentially restored the
if (scope?.Span.Context is { } context)check before injecting.Test coverage
Our test coverage passes with / without this as we correctly don't create a span when the instrumentation is disabled but we don't really have the means to assert that we do not modify the underlying objects in some way. This is potentially something we should look into implementation to catch future issues like this potentially.
Other details