Skip to content

Fix null reference exception #7077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

NachoEchevarria
Copy link
Contributor

@NachoEchevarria NachoEchevarria commented Jun 6, 2025

Summary of changes

There is this null reference exception under netcore in the method Datadog.Trace.AppSec.Coordinator.SecurityCoordinator.GetBasicRequestArgsForWaf()

While there is not enoguh information to know exactly what cused the issue, it might be produced by a null Query within the hhtpRequest. Technically, DefaultHttpRequest allows to set it to null.

A unit test has been added that reproduces the issue.

Reason for change

Implementation details

Test coverage

Other details

@NachoEchevarria NachoEchevarria changed the title Request query can be null Fix null reference exception Jun 6, 2025
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jun 6, 2025

Datadog Report

Branch report: nacho/FixNullReferenceException
Commit report: 736f757
Test service: dd-trace-dotnet

✅ 0 Failed, 232944 Passed, 1485 Skipped, 11h 16m 4.85s Total Time

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks!

@pr-commenter
Copy link

pr-commenter bot commented Jun 6, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7077 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.141
  • 2 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 ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 11.2μs 59.7ns 322ns 0 0 0 5.58 KB
master StartStopWithChild netcoreapp3.1 14.1μs 67.5ns 286ns 0 0 0 5.75 KB
master StartStopWithChild net472 22.1μs 119ns 651ns 1.03 0.411 0.103 6.09 KB
#7077 StartStopWithChild net6.0 10.3μs 58.2ns 377ns 0 0 0 5.57 KB
#7077 StartStopWithChild netcoreapp3.1 13.4μs 62.8ns 251ns 0 0 0 5.77 KB
#7077 StartStopWithChild net472 21.9μs 116ns 591ns 1.03 0.411 0.103 6.08 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7077

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.33 KB 3.35 KB 23 B 0.69%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 927μs 26.6ns 103ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 404ns 1.56μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.25ms 357ns 1.38μs 0 0 0 3.33 KB
#7077 WriteAndFlushEnrichedTraces net6.0 929μs 227ns 850ns 0 0 0 2.7 KB
#7077 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 197ns 765ns 0 0 0 2.7 KB
#7077 WriteAndFlushEnrichedTraces net472 1.24ms 144ns 540ns 0 0 0 3.35 KB
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 331μs 1.76μs 8.42μs 0 0 0 197.06 KB
master AllCycleSimpleBody netcoreapp3.1 510μs 1.45μs 5.61μs 0 0 0 204.77 KB
master AllCycleSimpleBody net472 436μs 119ns 460ns 36.6 2.16 0 236.35 KB
master AllCycleMoreComplexBody net6.0 338μs 1.76μs 8.8μs 0 0 0 200.56 KB
master AllCycleMoreComplexBody netcoreapp3.1 495μs 987ns 3.56μs 0 0 0 208.18 KB
master AllCycleMoreComplexBody net472 446μs 106ns 412ns 36.6 2.16 0 239.87 KB
master ObjectExtractorSimpleBody net6.0 311ns 1.77ns 12.3ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 409ns 1.93ns 8.2ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 303ns 0.175ns 0.676ns 0.0442 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.52μs 29.5ns 110ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.76μs 36.2ns 140ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.66μs 0.89ns 3.33ns 0.599 0 0 3.8 KB
#7077 AllCycleSimpleBody net6.0 329μs 1.42μs 5.5μs 0 0 0 197.41 KB
#7077 AllCycleSimpleBody netcoreapp3.1 504μs 492ns 1.91μs 0 0 0 205.17 KB
#7077 AllCycleSimpleBody net472 438μs 133ns 515ns 36.6 2.16 0 236.95 KB
#7077 AllCycleMoreComplexBody net6.0 337μs 1.71μs 8.04μs 0 0 0 200.92 KB
#7077 AllCycleMoreComplexBody netcoreapp3.1 528μs 2.59μs 11μs 0 0 0 208.58 KB
#7077 AllCycleMoreComplexBody net472 449μs 190ns 735ns 37.9 2.23 0 240.46 KB
#7077 ObjectExtractorSimpleBody net6.0 313ns 0.115ns 0.429ns 0 0 0 280 B
#7077 ObjectExtractorSimpleBody netcoreapp3.1 400ns 1.95ns 8.49ns 0 0 0 272 B
#7077 ObjectExtractorSimpleBody net472 304ns 0.0407ns 0.147ns 0.0443 0 0 281 B
#7077 ObjectExtractorMoreComplexBody net6.0 6.37μs 22.8ns 88.4ns 0 0 0 3.78 KB
#7077 ObjectExtractorMoreComplexBody netcoreapp3.1 7.66μs 34.1ns 128ns 0 0 0 3.69 KB
#7077 ObjectExtractorMoreComplexBody net472 6.81μs 2.42ns 9.38ns 0.577 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7077

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs‑net6.0 2.16 KB 2.14 KB -12 B -0.56%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 73.3μs 263ns 984ns 0 0 0 32.41 KB
master EncodeArgs netcoreapp3.1 95.7μs 36.2ns 130ns 0 0 0 32.4 KB
master EncodeArgs net472 107μs 17.6ns 65.8ns 4.82 0 0 32.51 KB
master EncodeLegacyArgs net6.0 143μs 122ns 472ns 0 0 0 2.16 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 42.5ns 147ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 261μs 66.8ns 250ns 0 0 0 2.16 KB
#7077 EncodeArgs net6.0 73.7μs 75.6ns 283ns 0 0 0 32.4 KB
#7077 EncodeArgs netcoreapp3.1 94.5μs 341ns 1.32μs 0 0 0 32.4 KB
#7077 EncodeArgs net472 105μs 35.5ns 138ns 4.73 0 0 32.51 KB
#7077 EncodeLegacyArgs net6.0 149μs 29.8ns 108ns 0 0 0 2.14 KB
#7077 EncodeLegacyArgs netcoreapp3.1 198μs 237ns 917ns 0 0 0 2.14 KB
#7077 EncodeLegacyArgs net472 262μs 180ns 697ns 0 0 0 2.16 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 271μs 133ns 499ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 294μs 264ns 989ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 307μs 38.1ns 147ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 181μs 80.1ns 300ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 198μs 104ns 404ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 207μs 45.3ns 169ns 0 0 0 2.28 KB
#7077 RunWafRealisticBenchmark net6.0 270μs 86.8ns 336ns 0 0 0 4.55 KB
#7077 RunWafRealisticBenchmark netcoreapp3.1 290μs 428ns 1.71μs 0 0 0 4.48 KB
#7077 RunWafRealisticBenchmark net472 307μs 55.4ns 214ns 0 0 0 4.66 KB
#7077 RunWafRealisticBenchmarkWithAttack net6.0 181μs 44.3ns 172ns 0 0 0 2.24 KB
#7077 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 200μs 130ns 449ns 0 0 0 2.22 KB
#7077 RunWafRealisticBenchmarkWithAttack net472 208μs 79.5ns 308ns 0 0 0 2.28 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 61.1μs 29ns 104ns 0 0 0 14.53 KB
master SendRequest netcoreapp3.1 69.9μs 118ns 440ns 0 0 0 17.42 KB
master SendRequest net472 0.0171ns 0.00147ns 0.00551ns 0 0 0 0 b
#7077 SendRequest net6.0 61.9μs 99.5ns 372ns 0 0 0 14.53 KB
#7077 SendRequest netcoreapp3.1 71.2μs 102ns 394ns 0 0 0 17.42 KB
#7077 SendRequest net472 0.0148ns 0.00178ns 0.00689ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 645μs 512ns 1.98μs 0 0 0 41.73 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 631μs 1.67μs 6.67μs 0 0 0 41.89 KB
master WriteAndFlushEnrichedTraces net472 923μs 1.93μs 7.2μs 4.46 0 0 55.75 KB
#7077 WriteAndFlushEnrichedTraces net6.0 691μs 1.34μs 5.2μs 0 0 0 41.68 KB
#7077 WriteAndFlushEnrichedTraces netcoreapp3.1 644μs 1.12μs 4.33μs 0 0 0 41.88 KB
#7077 WriteAndFlushEnrichedTraces net472 944μs 3.32μs 12.9μs 4.46 0 0 55.87 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.99μs 10.2ns 46.8ns 0 0 0 1.03 KB
master ExecuteNonQuery netcoreapp3.1 2.53μs 3.43ns 13.3ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.7μs 2.41ns 9.34ns 0.147 0.0134 0 995 B
#7077 ExecuteNonQuery net6.0 2.01μs 6.73ns 26.1ns 0 0 0 1.03 KB
#7077 ExecuteNonQuery netcoreapp3.1 2.48μs 11.9ns 46ns 0 0 0 1.02 KB
#7077 ExecuteNonQuery net472 2.82μs 4.21ns 16.3ns 0.153 0.0139 0 995 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.83μs 5.85ns 22.7ns 0 0 0 1.04 KB
master CallElasticsearch netcoreapp3.1 2.3μs 11.8ns 56.6ns 0 0 0 1.04 KB
master CallElasticsearch net472 3.55μs 3.05ns 11.8ns 0.159 0 0 1.05 KB
master CallElasticsearchAsync net6.0 1.81μs 3.89ns 14.5ns 0 0 0 1.02 KB
master CallElasticsearchAsync netcoreapp3.1 2.35μs 7.26ns 28.1ns 0 0 0 1.09 KB
master CallElasticsearchAsync net472 3.84μs 3.19ns 12.4ns 0.169 0 0 1.11 KB
#7077 CallElasticsearch net6.0 1.78μs 8.06ns 30.2ns 0 0 0 1.04 KB
#7077 CallElasticsearch netcoreapp3.1 2.31μs 10.5ns 39.2ns 0 0 0 1.04 KB
#7077 CallElasticsearch net472 3.71μs 5.37ns 20.8ns 0.167 0 0 1.05 KB
#7077 CallElasticsearchAsync net6.0 1.84μs 6.11ns 23.6ns 0 0 0 1.02 KB
#7077 CallElasticsearchAsync netcoreapp3.1 2.44μs 6.06ns 23.5ns 0 0 0 1.09 KB
#7077 CallElasticsearchAsync net472 3.82μs 4.24ns 16.4ns 0.171 0 0 1.11 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.78μs 9.27ns 43.5ns 0 0 0 960 B
master ExecuteAsync netcoreapp3.1 2.29μs 7.45ns 25.8ns 0 0 0 960 B
master ExecuteAsync net472 2.58μs 1.78ns 6.88ns 0.143 0 0 923 B
#7077 ExecuteAsync net6.0 1.83μs 0.694ns 2.69ns 0 0 0 960 B
#7077 ExecuteAsync netcoreapp3.1 2.32μs 5.31ns 19.9ns 0 0 0 960 B
#7077 ExecuteAsync net472 2.5μs 3.42ns 13.2ns 0.136 0 0 923 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 7.1μs 10.4ns 39ns 0 0 0 2.37 KB
master SendAsync netcoreapp3.1 8.69μs 14.1ns 54.6ns 0 0 0 2.9 KB
master SendAsync net472 12.5μs 10.3ns 38.5ns 0.498 0 0 3.19 KB
#7077 SendAsync net6.0 7.05μs 12.8ns 47.7ns 0 0 0 2.37 KB
#7077 SendAsync netcoreapp3.1 8.48μs 21.1ns 81.9ns 0 0 0 2.9 KB
#7077 SendAsync net472 12.4μs 9.98ns 37.4ns 0.498 0 0 3.19 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7077

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 1.141 458,300.00 522,950.00

More allocations ⚠️ in #7077

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.34 KB 73.73 KB 16.38 KB 28.57%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 259.96 KB 277.01 KB 17.05 KB 6.56%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 274.93 KB 289.72 KB 14.79 KB 5.38%

Fewer allocations 🎉 in #7077

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 286.72 KB 278.53 KB -8.19 KB -2.86%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 44.6μs 212ns 1.6μs 0 0 0 43.83 KB
master StringConcatBenchmark netcoreapp3.1 47.2μs 224ns 838ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 56.8μs 259ns 968ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 458μs 1.08μs 3.89μs 0 0 0 259.96 KB
master StringConcatAspectBenchmark netcoreapp3.1 447μs 6.44μs 63.7μs 0 0 0 274.93 KB
master StringConcatAspectBenchmark net472 410μs 2.07μs 9.27μs 0 0 0 286.72 KB
#7077 StringConcatBenchmark net6.0 50.1μs 291ns 2.27μs 0 0 0 43.74 KB
#7077 StringConcatBenchmark netcoreapp3.1 48.6μs 274ns 1.75μs 0 0 0 42.73 KB
#7077 StringConcatBenchmark net472 57.5μs 198ns 741ns 0 0 0 73.73 KB
#7077 StringConcatAspectBenchmark net6.0 524μs 2.44μs 9.13μs 0 0 0 277.01 KB
#7077 StringConcatAspectBenchmark netcoreapp3.1 435μs 5.61μs 55μs 0 0 0 289.72 KB
#7077 StringConcatAspectBenchmark net472 421μs 1.83μs 7.1μs 0 0 0 278.53 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.63μs 2.6ns 10.1ns 0 0 0 1.76 KB
master EnrichedLog netcoreapp3.1 3.44μs 4.38ns 17ns 0 0 0 1.76 KB
master EnrichedLog net472 4.05μs 4.83ns 18.7ns 0.265 0 0 1.69 KB
#7077 EnrichedLog net6.0 2.85μs 13.7ns 59.9ns 0 0 0 1.76 KB
#7077 EnrichedLog netcoreapp3.1 3.41μs 16.7ns 66.7ns 0 0 0 1.76 KB
#7077 EnrichedLog net472 3.82μs 2.95ns 11.4ns 0.268 0 0 1.69 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 145ns 563ns 0 0 0 4.37 KB
master EnrichedLog netcoreapp3.1 126μs 330ns 1.24μs 0 0 0 4.37 KB
master EnrichedLog net472 167μs 161ns 603ns 0 0 0 4.57 KB
#7077 EnrichedLog net6.0 123μs 81.1ns 292ns 0 0 0 4.37 KB
#7077 EnrichedLog netcoreapp3.1 128μs 274ns 1.06μs 0 0 0 4.37 KB
#7077 EnrichedLog net472 166μs 46.5ns 168ns 0 0 0 4.57 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 4.94μs 19.3ns 74.6ns 0 0 0 2.32 KB
master EnrichedLog netcoreapp3.1 6.77μs 22.2ns 79.9ns 0 0 0 2.32 KB
master EnrichedLog net472 7.45μs 8.04ns 31.1ns 0.335 0 0 2.14 KB
#7077 EnrichedLog net6.0 4.83μs 24.3ns 114ns 0 0 0 2.32 KB
#7077 EnrichedLog netcoreapp3.1 6.64μs 17.3ns 67.1ns 0 0 0 2.32 KB
#7077 EnrichedLog net472 7.37μs 4.43ns 17.2ns 0.33 0 0 2.14 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 2.04μs 10.5ns 49.4ns 0 0 0 1.21 KB
master SendReceive netcoreapp3.1 2.53μs 11.8ns 47.4ns 0 0 0 1.21 KB
master SendReceive net472 3.28μs 2.71ns 10.5ns 0.178 0 0 1.21 KB
#7077 SendReceive net6.0 1.9μs 9.02ns 36.1ns 0 0 0 1.21 KB
#7077 SendReceive netcoreapp3.1 2.63μs 10.7ns 41.4ns 0 0 0 1.21 KB
#7077 SendReceive net472 3.05μs 2.07ns 7.73ns 0.183 0 0 1.21 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.18μs 0.92ns 3.44ns 0 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 5.64μs 23ns 89.3ns 0 0 0 1.69 KB
master EnrichedLog net472 6.67μs 7.28ns 27.3ns 0.298 0 0 2.08 KB
#7077 EnrichedLog net6.0 4.24μs 20.5ns 82.2ns 0 0 0 1.64 KB
#7077 EnrichedLog netcoreapp3.1 5.5μs 6.78ns 26.3ns 0 0 0 1.69 KB
#7077 EnrichedLog net472 6.61μs 10.5ns 40.6ns 0.328 0 0 2.08 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 751ns 3.97ns 22.4ns 0 0 0 584 B
master StartFinishSpan netcoreapp3.1 953ns 4.42ns 17.7ns 0 0 0 584 B
master StartFinishSpan net472 914ns 0.809ns 3.13ns 0.0912 0 0 586 B
master StartFinishScope net6.0 918ns 0.479ns 1.73ns 0 0 0 704 B
master StartFinishScope netcoreapp3.1 1.15μs 6.24ns 34.2ns 0 0 0 704 B
master StartFinishScope net472 1.09μs 0.174ns 0.652ns 0.104 0 0 666 B
#7077 StartFinishSpan net6.0 728ns 3.83ns 19.1ns 0 0 0 584 B
#7077 StartFinishSpan netcoreapp3.1 930ns 5.17ns 30.6ns 0 0 0 584 B
#7077 StartFinishSpan net472 923ns 0.198ns 0.712ns 0.0926 0 0 586 B
#7077 StartFinishScope net6.0 893ns 4.32ns 17.3ns 0 0 0 704 B
#7077 StartFinishScope netcoreapp3.1 1.17μs 5.71ns 25.5ns 0 0 0 704 B
#7077 StartFinishScope net472 1.11μs 0.247ns 0.957ns 0.105 0 0 666 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.02μs 5.36ns 26.8ns 0 0 0 704 B
master RunOnMethodBegin netcoreapp3.1 1.38μs 2.28ns 8.82ns 0 0 0 704 B
master RunOnMethodBegin net472 1.36μs 0.141ns 0.544ns 0.102 0 0 666 B
#7077 RunOnMethodBegin net6.0 1.02μs 4.83ns 18.1ns 0 0 0 704 B
#7077 RunOnMethodBegin netcoreapp3.1 1.37μs 1.24ns 4.63ns 0 0 0 704 B
#7077 RunOnMethodBegin net472 1.43μs 1.97ns 7.61ns 0.0993 0 0 666 B

@andrewlock
Copy link
Member

andrewlock commented Jun 6, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

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 shown 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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7077) - mean (73ms)  : 67, 79
     .   : milestone, 73,
    master - mean (75ms)  : 71, 79
     .   : milestone, 75,

    section CallTarget+Inlining+NGEN
    This PR (7077) - mean (1,056ms)  : 1025, 1088
     .   : milestone, 1056,
    master - mean (1,068ms)  : 1039, 1096
     .   : milestone, 1068,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7077) - mean (110ms)  : 106, 113
     .   : milestone, 110,
    master - mean (111ms)  : 106, 116
     .   : milestone, 111,

    section CallTarget+Inlining+NGEN
    This PR (7077) - mean (736ms)  : 713, 759
     .   : milestone, 736,
    master - mean (743ms)  : 719, 767
     .   : milestone, 743,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7077) - mean (95ms)  : 92, 99
     .   : milestone, 95,
    master - mean (96ms)  : 93, 100
     .   : milestone, 96,

    section CallTarget+Inlining+NGEN
    This PR (7077) - mean (696ms)  : 671, 720
     .   : milestone, 696,
    master - mean (707ms)  : 679, 736
     .   : milestone, 707,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7077) - mean (190ms)  : 186, 194
     .   : milestone, 190,
    master - mean (190ms)  : 186, 194
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (7077) - mean (1,164ms)  : 1147, 1181
     .   : milestone, 1164,
    master - mean (1,167ms)  : 1147, 1187
     .   : milestone, 1167,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7077) - mean (269ms)  : 265, 273
     .   : milestone, 269,
    master - mean (269ms)  : 264, 273
     .   : milestone, 269,

    section CallTarget+Inlining+NGEN
    This PR (7077) - mean (933ms)  : 917, 949
     .   : milestone, 933,
    master - mean (932ms)  : 914, 949
     .   : milestone, 932,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7077) - mean (263ms)  : 257, 270
     .   : milestone, 263,
    master - mean (262ms)  : 258, 265
     .   : milestone, 262,

    section CallTarget+Inlining+NGEN
    This PR (7077) - mean (928ms)  : 910, 945
     .   : milestone, 928,
    master - mean (929ms)  : 913, 946
     .   : milestone, 929,

Loading

@NachoEchevarria NachoEchevarria marked this pull request as ready for review June 6, 2025 15:02
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner June 6, 2025 15:02
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD left a comment

Choose a reason for hiding this comment

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

TY!

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.

4 participants