Skip to content
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

[ASM] Fix possible stackoverflow if nested routedictionary #6382

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

anna-git
Copy link
Contributor

@anna-git anna-git commented Dec 2, 2024

Summary of changes

If a route dictionary contained nested same objects, it would stack overflow

Reason for change

Implementation details

Test coverage

Other details

@anna-git anna-git force-pushed the anna/asm/guard-stackoverflow branch from 3fa7ea4 to 32eeb93 Compare December 2, 2024 14:27
@andrewlock
Copy link
Member

andrewlock commented Dec 2, 2024

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.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6382) - mean (69ms)  : 66, 72
     .   : milestone, 69,
    master - mean (69ms)  : 67, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6382) - mean (981ms)  : 950, 1013
     .   : milestone, 981,
    master - mean (983ms)  : 961, 1004
     .   : milestone, 983,

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

    section CallTarget+Inlining+NGEN
    This PR (6382) - mean (680ms)  : 663, 696
     .   : milestone, 680,
    master - mean (685ms)  : 671, 699
     .   : milestone, 685,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6382) - mean (92ms)  : 90, 94
     .   : milestone, 92,
    master - mean (92ms)  : 90, 95
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (6382) - mean (629ms)  : 610, 648
     .   : milestone, 629,
    master - mean (638ms)  : 620, 656
     .   : milestone, 638,

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

    section CallTarget+Inlining+NGEN
    This PR (6382) - mean (1,092ms)  : 1067, 1116
     .   : milestone, 1092,
    master - mean (1,091ms)  : 1066, 1117
     .   : milestone, 1091,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6382) - mean (278ms)  : 273, 283
     .   : milestone, 278,
    master - mean (277ms)  : 272, 282
     .   : milestone, 277,

    section CallTarget+Inlining+NGEN
    This PR (6382) - mean (873ms)  : 846, 901
     .   : milestone, 873,
    master - mean (875ms)  : 848, 902
     .   : milestone, 875,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6382) - mean (266ms)  : 262, 270
     .   : milestone, 266,
    master - mean (266ms)  : 261, 271
     .   : milestone, 266,

    section CallTarget+Inlining+NGEN
    This PR (6382) - mean (848ms)  : 815, 881
     .   : milestone, 848,
    master - mean (857ms)  : 822, 892
     .   : milestone, 857,

Loading

@anna-git anna-git force-pushed the anna/asm/guard-stackoverflow branch from 32eeb93 to 4dd60df Compare December 2, 2024 15:20
@anna-git anna-git marked this pull request as ready for review December 2, 2024 15:22
@anna-git anna-git requested a review from a team as a code owner December 2, 2024 15:22
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Dec 2, 2024

Datadog Report

Branch report: anna/asm/guard-stackoverflow
Commit report: 4dd60df
Test service: dd-trace-dotnet

✅ 0 Failed, 451435 Passed, 2745 Skipped, 19h 50m 11.28s Total Time

Copy link
Member

@e-n-0 e-n-0 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
Copy link
Member

Benchmarks Report for appsec 🐌

Benchmarks for #6382 compared to master:

  • All benchmarks have the same speed
  • 2 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.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 214μs 113ns 425ns 2.47 0.108 0 176.82 KB
master AllCycleSimpleBody netcoreapp3.1 311μs 210ns 812ns 2.52 0 0 184.27 KB
master AllCycleSimpleBody net472 278μs 270ns 1.04μs 33.3 2.49 0 210.04 KB
master AllCycleMoreComplexBody net6.0 220μs 174ns 629ns 2.53 0 0 180.33 KB
master AllCycleMoreComplexBody netcoreapp3.1 324μs 172ns 644ns 2.45 0 0 187.68 KB
master AllCycleMoreComplexBody net472 288μs 293ns 1.1μs 33.8 2.59 0 213.56 KB
master ObjectExtractorSimpleBody net6.0 150ns 0.104ns 0.403ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 213ns 0.115ns 0.431ns 0.00375 0 0 272 B
master ObjectExtractorSimpleBody net472 213ns 0.153ns 0.594ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.05μs 1.41ns 5.28ns 0.0531 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.89μs 2.66ns 9.58ns 0.0506 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 4.43μs 3.02ns 11.7ns 0.602 0.00666 0 3.8 KB
#6382 AllCycleSimpleBody net6.0 219μs 132ns 493ns 2.41 0 0 176.82 KB
#6382 AllCycleSimpleBody netcoreapp3.1 320μs 296ns 1.03μs 2.42 0 0 184.27 KB
#6382 AllCycleSimpleBody net472 283μs 373ns 1.45μs 33.3 2.54 0 210.04 KB
#6382 AllCycleMoreComplexBody net6.0 224μs 129ns 501ns 2.46 0 0 180.33 KB
#6382 AllCycleMoreComplexBody netcoreapp3.1 327μs 120ns 449ns 2.45 0 0 187.68 KB
#6382 AllCycleMoreComplexBody net472 284μs 152ns 588ns 33.9 2.57 0 213.56 KB
#6382 ObjectExtractorSimpleBody net6.0 139ns 0.0944ns 0.365ns 0.00394 0 0 280 B
#6382 ObjectExtractorSimpleBody netcoreapp3.1 219ns 1.16ns 5.93ns 0.00372 0 0 272 B
#6382 ObjectExtractorSimpleBody net472 209ns 0.228ns 0.883ns 0.0446 0 0 281 B
#6382 ObjectExtractorMoreComplexBody net6.0 2.97μs 1.99ns 7.18ns 0.0535 0 0 3.78 KB
#6382 ObjectExtractorMoreComplexBody netcoreapp3.1 3.78μs 2.35ns 8.14ns 0.0508 0 0 3.69 KB
#6382 ObjectExtractorMoreComplexBody net472 4.33μs 3.71ns 14.4ns 0.601 0.00649 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 38.1μs 17.9ns 69.3ns 0.457 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 53.9μs 23.6ns 88.3ns 0.427 0 0 32.4 KB
master EncodeArgs net472 67.9μs 54.6ns 204ns 5.13 0.068 0 32.5 KB
master EncodeLegacyArgs net6.0 71.7μs 160ns 622ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 109μs 401ns 1.55μs 0 0 0 2.15 KB
master EncodeLegacyArgs net472 158μs 109ns 394ns 0.314 0 0 2.15 KB
#6382 EncodeArgs net6.0 38μs 25ns 90.1ns 0.457 0 0 32.4 KB
#6382 EncodeArgs netcoreapp3.1 53.6μs 15.9ns 61.4ns 0.427 0 0 32.4 KB
#6382 EncodeArgs net472 66.3μs 34.8ns 125ns 5.16 0.0665 0 32.5 KB
#6382 EncodeLegacyArgs net6.0 70.1μs 64.1ns 248ns 0 0 0 2.14 KB
#6382 EncodeLegacyArgs netcoreapp3.1 103μs 120ns 464ns 0 0 0 2.14 KB
#6382 EncodeLegacyArgs net472 156μs 35.4ns 132ns 0.311 0 0 2.15 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 184μs 273ns 1.06μs 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 194μs 227ns 880ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 210μs 72.5ns 281ns 0.314 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 122μs 40.9ns 147ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 108ns 417ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 141μs 38.2ns 148ns 0.21 0 0 1.48 KB
#6382 RunWafRealisticBenchmark net6.0 182μs 249ns 863ns 0 0 0 2.44 KB
#6382 RunWafRealisticBenchmark netcoreapp3.1 193μs 414ns 1.6μs 0 0 0 2.39 KB
#6382 RunWafRealisticBenchmark net472 209μs 105ns 408ns 0.312 0 0 2.46 KB
#6382 RunWafRealisticBenchmarkWithAttack net6.0 123μs 96.4ns 361ns 0 0 0 1.47 KB
#6382 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 96.4ns 361ns 0 0 0 1.46 KB
#6382 RunWafRealisticBenchmarkWithAttack net472 140μs 44ns 170ns 0.21 0 0 1.49 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6382

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.07 KB 62.14 KB 3.06 KB 5.19%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 253.3 KB 254.86 KB 1.56 KB 0.62%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 61.4μs 854ns 8.54μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 61.2μs 836ns 8.27μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.5μs 75.4ns 282ns 0 0 0 59.07 KB
master StringConcatAspectBenchmark net6.0 306μs 1.64μs 8.54μs 0 0 0 253.67 KB
master StringConcatAspectBenchmark netcoreapp3.1 317μs 5.63μs 55.1μs 0 0 0 253.3 KB
master StringConcatAspectBenchmark net472 293μs 6.71μs 65.1μs 0 0 0 278.53 KB
#6382 StringConcatBenchmark net6.0 61.1μs 713ns 7.13μs 0 0 0 43.44 KB
#6382 StringConcatBenchmark netcoreapp3.1 54.2μs 271ns 1.15μs 0 0 0 42.64 KB
#6382 StringConcatBenchmark net472 37.7μs 106ns 395ns 0 0 0 62.14 KB
#6382 StringConcatAspectBenchmark net6.0 320μs 1.54μs 10.6μs 0 0 0 254.01 KB
#6382 StringConcatAspectBenchmark netcoreapp3.1 335μs 5.28μs 52μs 0 0 0 254.86 KB
#6382 StringConcatAspectBenchmark net472 299μs 6.95μs 67.7μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6382 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.135
  • All benchmarks have the same 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 7.93μs 41.9ns 233ns 0.0132 0.0044 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.1μs 51.5ns 252ns 0.0297 0.0148 0 5.8 KB
master StartStopWithChild net472 16.4μs 50.3ns 195ns 1.03 0.302 0.0924 6.22 KB
#6382 StartStopWithChild net6.0 8.14μs 45.9ns 301ns 0.0159 0.00797 0 5.6 KB
#6382 StartStopWithChild netcoreapp3.1 10.1μs 46.2ns 221ns 0.0154 0.00512 0 5.8 KB
#6382 StartStopWithChild net472 16.4μs 50.2ns 194ns 1.04 0.298 0.0886 6.22 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 497μs 252ns 974ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 644μs 338ns 1.31μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 858μs 809ns 2.92μs 0.419 0 0 3.3 KB
#6382 WriteAndFlushEnrichedTraces net6.0 486μs 221ns 826ns 0 0 0 2.7 KB
#6382 WriteAndFlushEnrichedTraces netcoreapp3.1 668μs 595ns 2.31μs 0 0 0 2.7 KB
#6382 WriteAndFlushEnrichedTraces net472 838μs 455ns 1.76μs 0.417 0 0 3.3 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 152μs 896ns 8.83μs 0.145 0 0 14.47 KB
master SendRequest netcoreapp3.1 172μs 1.01μs 9.33μs 0.172 0 0 17.27 KB
master SendRequest net472 0.0018ns 0.00069ns 0.00258ns 0 0 0 0 b
#6382 SendRequest net6.0 156μs 1.26μs 12.4μs 0.141 0 0 14.47 KB
#6382 SendRequest netcoreapp3.1 176μs 1.25μs 12.4μs 0.161 0 0 17.27 KB
#6382 SendRequest net472 0.00613ns 0.00187ns 0.00726ns 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 586μs 3.26μs 20.4μs 0.543 0 0 41.66 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 680μs 3.63μs 18.5μs 0.345 0 0 41.61 KB
master WriteAndFlushEnrichedTraces net472 852μs 3.01μs 11.3μs 8.39 2.52 0.419 53.36 KB
#6382 WriteAndFlushEnrichedTraces net6.0 580μs 2.56μs 9.6μs 0.584 0 0 41.46 KB
#6382 WriteAndFlushEnrichedTraces netcoreapp3.1 696μs 3.83μs 21.7μs 0.336 0 0 41.8 KB
#6382 WriteAndFlushEnrichedTraces net472 875μs 4.09μs 15.8μs 8.13 2.57 0.428 53.36 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.19μs 0.842ns 3.26ns 0.0143 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.72μs 1.19ns 4.44ns 0.0137 0 0 1.02 KB
master ExecuteNonQuery net472 2.22μs 1.63ns 6.3ns 0.156 0.00111 0 987 B
#6382 ExecuteNonQuery net6.0 1.29μs 1.52ns 5.87ns 0.0142 0 0 1.02 KB
#6382 ExecuteNonQuery netcoreapp3.1 1.77μs 1.27ns 4.73ns 0.0134 0 0 1.02 KB
#6382 ExecuteNonQuery net472 2.06μs 3.12ns 12.1ns 0.156 0.00103 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.31μs 0.437ns 1.64ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.54μs 1.32ns 5.13ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.59μs 3.29ns 12.7ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.27μs 0.538ns 2.01ns 0.0134 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.68μs 1.65ns 6.17ns 0.014 0 0 1.02 KB
master CallElasticsearchAsync net472 2.61μs 2.63ns 10.2ns 0.167 0 0 1.05 KB
#6382 CallElasticsearch net6.0 1.24μs 0.849ns 3.29ns 0.0135 0 0 976 B
#6382 CallElasticsearch netcoreapp3.1 1.49μs 0.822ns 3.18ns 0.0127 0 0 976 B
#6382 CallElasticsearch net472 2.54μs 2.56ns 9.91ns 0.157 0 0 995 B
#6382 CallElasticsearchAsync net6.0 1.27μs 0.962ns 3.47ns 0.0134 0 0 952 B
#6382 CallElasticsearchAsync netcoreapp3.1 1.61μs 0.558ns 2.09ns 0.0137 0 0 1.02 KB
#6382 CallElasticsearchAsync net472 2.66μs 2.32ns 8.99ns 0.166 0 0 1.05 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.4μs 0.962ns 3.73ns 0.0133 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.64μs 0.517ns 1.93ns 0.0123 0 0 952 B
master ExecuteAsync net472 1.82μs 0.698ns 2.61ns 0.144 0 0 915 B
#6382 ExecuteAsync net6.0 1.3μs 0.525ns 1.96ns 0.0136 0 0 952 B
#6382 ExecuteAsync netcoreapp3.1 1.6μs 0.607ns 2.27ns 0.0128 0 0 952 B
#6382 ExecuteAsync net472 1.77μs 0.628ns 2.35ns 0.145 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 4.51μs 1.88ns 7.04ns 0.0314 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.33μs 1.79ns 6.91ns 0.0376 0 0 2.85 KB
master SendAsync net472 7.42μs 2.35ns 9.12ns 0.493 0 0 3.12 KB
#6382 SendAsync net6.0 4.41μs 3.15ns 12.2ns 0.0331 0 0 2.31 KB
#6382 SendAsync netcoreapp3.1 5.29μs 3.36ns 12.1ns 0.0371 0 0 2.85 KB
#6382 SendAsync net472 7.35μs 2.15ns 8.33ns 0.495 0 0 3.12 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 1.45μs 1.2ns 4.49ns 0.0232 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.21μs 0.991ns 3.71ns 0.0223 0 0 1.64 KB
master EnrichedLog net472 2.62μs 3.16ns 12.2ns 0.249 0 0 1.57 KB
#6382 EnrichedLog net6.0 1.5μs 1.66ns 6.41ns 0.0234 0 0 1.64 KB
#6382 EnrichedLog netcoreapp3.1 2.19μs 1.05ns 4.08ns 0.0219 0 0 1.64 KB
#6382 EnrichedLog net472 2.57μs 1.75ns 6.33ns 0.25 0 0 1.57 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 119μs 103ns 398ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 125μs 164ns 613ns 0.0628 0 0 4.28 KB
master EnrichedLog net472 153μs 123ns 478ns 0.687 0.229 0 4.46 KB
#6382 EnrichedLog net6.0 120μs 195ns 757ns 0.0605 0 0 4.28 KB
#6382 EnrichedLog netcoreapp3.1 124μs 155ns 600ns 0 0 0 4.28 KB
#6382 EnrichedLog net472 153μs 101ns 390ns 0.69 0.23 0 4.46 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 3.16μs 0.952ns 3.69ns 0.03 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.25μs 2.29ns 8.88ns 0.0277 0 0 2.2 KB
master EnrichedLog net472 4.95μs 1.54ns 5.77ns 0.319 0 0 2.02 KB
#6382 EnrichedLog net6.0 3.01μs 1.18ns 4.57ns 0.0304 0 0 2.2 KB
#6382 EnrichedLog netcoreapp3.1 4.21μs 1.04ns 4.04ns 0.0296 0 0 2.2 KB
#6382 EnrichedLog net472 4.94μs 1.01ns 3.79ns 0.318 0 0 2.02 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.38μs 0.536ns 1.93ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.7μs 1.41ns 5.46ns 0.0154 0 0 1.14 KB
master SendReceive net472 2.11μs 1.67ns 6.45ns 0.183 0 0 1.16 KB
#6382 SendReceive net6.0 1.39μs 0.502ns 1.94ns 0.0158 0 0 1.14 KB
#6382 SendReceive netcoreapp3.1 1.75μs 0.586ns 2.27ns 0.0157 0 0 1.14 KB
#6382 SendReceive net472 2.01μs 1.42ns 5.31ns 0.183 0 0 1.16 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 2.73μs 0.824ns 3.19ns 0.0219 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.99μs 20.5ns 96ns 0.0211 0 0 1.65 KB
master EnrichedLog net472 4.43μs 3.58ns 13.9ns 0.322 0 0 2.04 KB
#6382 EnrichedLog net6.0 2.85μs 1.02ns 3.94ns 0.0228 0 0 1.6 KB
#6382 EnrichedLog netcoreapp3.1 3.99μs 2.88ns 10.4ns 0.0218 0 0 1.65 KB
#6382 EnrichedLog net472 4.43μs 2.24ns 8.39ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6382

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.139 561.94 640.11
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.131 635.91 719.33

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 409ns 0.186ns 0.722ns 0.00806 0 0 576 B
master StartFinishSpan netcoreapp3.1 562ns 0.24ns 0.897ns 0.0076 0 0 576 B
master StartFinishSpan net472 636ns 0.28ns 1.08ns 0.0916 0 0 578 B
master StartFinishScope net6.0 485ns 0.16ns 0.599ns 0.00978 0 0 696 B
master StartFinishScope netcoreapp3.1 744ns 0.379ns 1.37ns 0.00929 0 0 696 B
master StartFinishScope net472 908ns 0.397ns 1.54ns 0.104 0 0 658 B
#6382 StartFinishSpan net6.0 394ns 0.18ns 0.696ns 0.00812 0 0 576 B
#6382 StartFinishSpan netcoreapp3.1 641ns 0.432ns 1.56ns 0.00785 0 0 576 B
#6382 StartFinishSpan net472 719ns 0.434ns 1.68ns 0.0916 0 0 578 B
#6382 StartFinishScope net6.0 483ns 0.148ns 0.553ns 0.00969 0 0 696 B
#6382 StartFinishScope netcoreapp3.1 681ns 0.364ns 1.36ns 0.00956 0 0 696 B
#6382 StartFinishScope net472 861ns 0.523ns 2.03ns 0.104 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 680ns 0.321ns 1.24ns 0.0099 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.01μs 0.532ns 2.06ns 0.0091 0 0 696 B
master RunOnMethodBegin net472 1.17μs 0.396ns 1.53ns 0.104 0 0 658 B
#6382 RunOnMethodBegin net6.0 751ns 0.384ns 1.49ns 0.00976 0 0 696 B
#6382 RunOnMethodBegin netcoreapp3.1 976ns 0.347ns 1.34ns 0.00929 0 0 696 B
#6382 RunOnMethodBegin net472 1.16μs 0.225ns 0.872ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

Throughput/Crank Report ⚡

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6382) (11.220M)   : 0, 11220204
    master (11.038M)   : 0, 11037856
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6382) (7.154M)   : 0, 7154102
    master (7.290M)   : 0, 7290054
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.562M)   : 0, 7561734

    section Manual
    master (11.036M)   : 0, 11035836

    section Manual + Automatic
    This PR (6382) (6.641M)   : 0, 6641283
    master (6.689M)   : 0, 6689266

    section DD_TRACE_ENABLED=0
    master (10.220M)   : 0, 10219721

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6382) (9.493M)   : 0, 9492701
    master (9.546M)   : 0, 9546165
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6382) (6.412M)   : 0, 6412383
    master (6.394M)   : 0, 6393817

    section Trace stats
    master (6.660M)   : 0, 6660181

    section Manual
    master (9.408M)   : 0, 9407542

    section Manual + Automatic
    This PR (6382) (5.823M)   : 0, 5822680
    master (5.960M)   : 0, 5959995

    section DD_TRACE_ENABLED=0
    master (8.863M)   : 0, 8862796

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6382) (10.067M)   : 0, 10067272
    master (9.789M)   : 0, 9789389
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6382) (6.432M)   : 0, 6431601
    master (6.248M)   : 0, 6248234
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (6.983M)   : 0, 6982636

    section Manual
    master (9.781M)   : 0, 9781004

    section Manual + Automatic
    This PR (6382) (5.809M)   : 0, 5809298
    master (5.788M)   : 0, 5787625

    section DD_TRACE_ENABLED=0
    master (9.053M)   : 0, 9053347

Loading

@anna-git anna-git merged commit 169c31a into master Dec 3, 2024
79 checks passed
@anna-git anna-git deleted the anna/asm/guard-stackoverflow branch December 3, 2024 10:57
@github-actions github-actions bot added this to the vNext-v3 milestone Dec 3, 2024
veerbia pushed a commit that referenced this pull request Dec 16, 2024
## Summary of changes

If a route dictionary contained nested same objects, it would stack
overflow

## Reason for change

## Implementation details

## Test coverage

## Other details
<!-- Fixes #{issue} -->

<!-- ⚠️ Note: where possible, please obtain 2 approvals prior to
merging. Unless CODEOWNERS specifies otherwise, for external teams it is
typically best to have one review from a team member, and one review
from apm-dotnet. Trivial changes do not require 2 reviews. -->
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