-
Notifications
You must be signed in to change notification settings - Fork 145
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
Conversation
3fa7ea4
to
32eeb93
Compare
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:
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,
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,
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,
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,
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,
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,
|
32eeb93
to
4dd60df
Compare
Datadog ReportBranch report: ✅ 0 Failed, 451435 Passed, 2745 Skipped, 19h 50m 11.28s Total Time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm thanks 😄
Benchmarks Report for appsec 🐌Benchmarks for #6382 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations
|
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 |
Benchmarks Report for tracer 🐌Benchmarks for #6382 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 ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Slower
|
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 |
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
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
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
|
## 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. -->
Summary of changes
If a route dictionary contained nested same objects, it would stack overflow
Reason for change
Implementation details
Test coverage
Other details