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

Fix how security settings are read #5317

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

robertpi
Copy link
Member

@robertpi robertpi commented Mar 18, 2024

Summary of changes

The link function GetValueOrDefault() should not be used, the library core API has functions with defaults built in.

@robertpi robertpi requested a review from a team as a code owner March 18, 2024 09:48
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!

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Mar 18, 2024

Datadog Report

Branch report: robert/asm/fix-setting-default-values
Commit report: 8bf971a
Test service: dd-trace-dotnet

✅ 0 Failed, 331511 Passed, 1619 Skipped, 41m 33.24s Wall Time

@andrewlock
Copy link
Member

andrewlock commented Mar 18, 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 (5317) - mean (74ms)  : 65, 82
     .   : milestone, 74,
    master - mean (73ms)  : 64, 82
     .   : milestone, 73,

    section CallTarget+Inlining+NGEN
    This PR (5317) - mean (1,004ms)  : 984, 1024
     .   : milestone, 1004,
    master - mean (1,002ms)  : 980, 1024
     .   : milestone, 1002,

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

    section CallTarget+Inlining+NGEN
    This PR (5317) - mean (724ms)  : 702, 747
     .   : milestone, 724,
    master - mean (718ms)  : 697, 738
     .   : milestone, 718,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5317) - mean (93ms)  : 91, 96
     .   : milestone, 93,
    master - mean (94ms)  : 90, 97
     .   : milestone, 94,

    section CallTarget+Inlining+NGEN
    This PR (5317) - mean (678ms)  : 652, 704
     .   : milestone, 678,
    master - mean (680ms)  : 661, 699
     .   : milestone, 680,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5317) - mean (188ms)  : 184, 191
     .   : milestone, 188,
    master - mean (188ms)  : 185, 191
     .   : milestone, 188,

    section CallTarget+Inlining+NGEN
    This PR (5317) - mean (1,079ms)  : 1056, 1102
     .   : milestone, 1079,
    master - mean (1,078ms)  : 1060, 1097
     .   : milestone, 1078,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5317) - mean (270ms)  : 266, 275
     .   : milestone, 270,
    master - mean (271ms)  : 267, 275
     .   : milestone, 271,

    section CallTarget+Inlining+NGEN
    This PR (5317) - mean (870ms)  : 846, 893
     .   : milestone, 870,
    master - mean (872ms)  : 849, 894
     .   : milestone, 872,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5317) - mean (261ms)  : 256, 265
     .   : milestone, 261,
    master - mean (261ms)  : 257, 265
     .   : milestone, 261,

    section CallTarget+Inlining+NGEN
    This PR (5317) - mean (852ms)  : 830, 874
     .   : milestone, 852,
    master - mean (856ms)  : 830, 882
     .   : milestone, 856,

Loading

@andrewlock
Copy link
Member

andrewlock commented Mar 18, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5317 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.119
  • 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 9.67μs 59.4ns 591ns 0.0185 0.00461 0 7.51 KB
master StartStopWithChild netcoreapp3.1 11μs 57.8ns 289ns 0.022 0.011 0 7.61 KB
master StartStopWithChild net472 18.7μs 128ns 1.27μs 1.33 0.333 0.0965 8.05 KB
#5317 StartStopWithChild net6.0 8.53μs 42.1ns 188ns 0.0217 0.00867 0 7.51 KB
#5317 StartStopWithChild netcoreapp3.1 10.7μs 56.3ns 293ns 0.0356 0.0152 0 7.61 KB
#5317 StartStopWithChild net472 17.1μs 46.1ns 173ns 1.35 0.338 0.11 8.06 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 471μs 162ns 626ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 622μs 300ns 1.16μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 825μs 328ns 1.23μs 0.408 0 0 3.3 KB
#5317 WriteAndFlushEnrichedTraces net6.0 457μs 113ns 390ns 0 0 0 2.7 KB
#5317 WriteAndFlushEnrichedTraces netcoreapp3.1 621μs 135ns 468ns 0 0 0 2.7 KB
#5317 WriteAndFlushEnrichedTraces net472 818μs 247ns 925ns 0.408 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 171μs 226ns 844ns 0.17 0 0 18.33 KB
master SendRequest netcoreapp3.1 196μs 237ns 918ns 0.195 0 0 20.49 KB
master SendRequest net472 0.000187ns 0.00014ns 0.000522ns 0 0 0 0 b
#5317 SendRequest net6.0 171μs 255ns 988ns 0.171 0 0 18.33 KB
#5317 SendRequest netcoreapp3.1 193μs 319ns 1.24μs 0.191 0 0 20.49 KB
#5317 SendRequest net472 0.000567ns 0.000226ns 0.000845ns 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 553μs 259ns 967ns 0.546 0 0 41.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 1.2μs 4.66μs 0.324 0 0 41.81 KB
master WriteAndFlushEnrichedTraces net472 858μs 2.83μs 10.6μs 8.19 2.59 0.431 53.24 KB
#5317 WriteAndFlushEnrichedTraces net6.0 547μs 998ns 3.87μs 0.548 0 0 41.66 KB
#5317 WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 1.36μs 5.07μs 0.332 0 0 41.64 KB
#5317 WriteAndFlushEnrichedTraces net472 858μs 4.21μs 17.3μs 8.33 2.5 0.417 53.23 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.18μs 1.03ns 4.01ns 0.0112 0 0 784 B
master ExecuteNonQuery netcoreapp3.1 1.64μs 0.402ns 1.45ns 0.0107 0 0 784 B
master ExecuteNonQuery net472 1.78μs 0.905ns 3.5ns 0.119 0 0 746 B
#5317 ExecuteNonQuery net6.0 1.23μs 0.502ns 1.94ns 0.0111 0 0 784 B
#5317 ExecuteNonQuery netcoreapp3.1 1.57μs 1.2ns 4.65ns 0.0102 0 0 784 B
#5317 ExecuteNonQuery net472 1.86μs 0.765ns 2.86ns 0.118 0 0 746 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.3μs 1.95ns 7.54ns 0.014 0 0 1.01 KB
master CallElasticsearch netcoreapp3.1 1.66μs 1.13ns 4.39ns 0.0136 0 0 1.01 KB
master CallElasticsearch net472 2.57μs 0.802ns 3ns 0.161 0.00129 0 1.02 KB
master CallElasticsearchAsync net6.0 1.42μs 1.11ns 4.3ns 0.0142 0 0 984 B
master CallElasticsearchAsync netcoreapp3.1 1.66μs 2.61ns 9.78ns 0.0141 0 0 1.06 KB
master CallElasticsearchAsync net472 2.68μs 1.54ns 5.55ns 0.171 0.00134 0 1.08 KB
#5317 CallElasticsearch net6.0 1.31μs 0.5ns 1.87ns 0.0138 0 0 1.01 KB
#5317 CallElasticsearch netcoreapp3.1 1.59μs 0.586ns 2.19ns 0.0136 0 0 1.01 KB
#5317 CallElasticsearch net472 2.67μs 1.21ns 4.54ns 0.161 0 0 1.02 KB
#5317 CallElasticsearchAsync net6.0 1.4μs 1.69ns 5.86ns 0.0139 0 0 984 B
#5317 CallElasticsearchAsync netcoreapp3.1 1.7μs 1.07ns 3.87ns 0.0145 0 0 1.06 KB
#5317 CallElasticsearchAsync net472 2.82μs 1.44ns 5.39ns 0.171 0 0 1.08 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.28μs 0.967ns 3.74ns 0.0128 0 0 928 B
master ExecuteAsync netcoreapp3.1 1.67μs 1.58ns 5.9ns 0.0124 0 0 928 B
master ExecuteAsync net472 1.9μs 0.762ns 2.95ns 0.141 0 0 891 B
#5317 ExecuteAsync net6.0 1.37μs 0.591ns 2.21ns 0.013 0 0 928 B
#5317 ExecuteAsync netcoreapp3.1 1.67μs 0.62ns 2.32ns 0.0119 0 0 928 B
#5317 ExecuteAsync net472 1.87μs 0.922ns 3.57ns 0.141 0 0 891 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.2μs 2.79ns 10.8ns 0.0294 0 0 2.16 KB
master SendAsync netcoreapp3.1 5.18μs 2.42ns 9.39ns 0.0361 0 0 2.7 KB
master SendAsync net472 7.73μs 4.03ns 15.1ns 0.484 0 0 3.05 KB
#5317 SendAsync net6.0 4.06μs 3.07ns 11.9ns 0.0302 0 0 2.16 KB
#5317 SendAsync netcoreapp3.1 4.98μs 3.39ns 13.1ns 0.035 0 0 2.7 KB
#5317 SendAsync net472 7.74μs 10ns 37.5ns 0.481 0 0 3.05 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.52μs 0.695ns 2.6ns 0.0229 0 0 1.65 KB
master EnrichedLog netcoreapp3.1 2.3μs 8.34ns 32.3ns 0.0227 0 0 1.65 KB
master EnrichedLog net472 2.83μs 3.61ns 14ns 0.249 0 0 1.57 KB
#5317 EnrichedLog net6.0 1.61μs 0.9ns 3.48ns 0.0234 0 0 1.65 KB
#5317 EnrichedLog netcoreapp3.1 2.23μs 0.94ns 3.52ns 0.0222 0 0 1.65 KB
#5317 EnrichedLog net472 2.86μs 1.62ns 6.05ns 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 112μs 64.4ns 241ns 0.0562 0 0 4.23 KB
master EnrichedLog netcoreapp3.1 118μs 155ns 599ns 0 0 0 4.23 KB
master EnrichedLog net472 147μs 127ns 494ns 0.657 0.219 0 4.41 KB
#5317 EnrichedLog net6.0 113μs 112ns 436ns 0.0566 0 0 4.23 KB
#5317 EnrichedLog netcoreapp3.1 118μs 157ns 606ns 0 0 0 4.23 KB
#5317 EnrichedLog net472 146μs 75.9ns 294ns 0.657 0.219 0 4.41 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.07μs 1.03ns 3.85ns 0.0307 0 0 2.21 KB
master EnrichedLog netcoreapp3.1 4.29μs 4.46ns 17.3ns 0.0299 0 0 2.21 KB
master EnrichedLog net472 5.09μs 1.85ns 7.18ns 0.32 0 0 2.02 KB
#5317 EnrichedLog net6.0 2.95μs 1.08ns 3.89ns 0.031 0 0 2.21 KB
#5317 EnrichedLog netcoreapp3.1 4.29μs 1.46ns 5.28ns 0.03 0 0 2.21 KB
#5317 EnrichedLog net472 4.91μs 1.37ns 5.14ns 0.32 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.37μs 0.867ns 3.36ns 0.0164 0 0 1.18 KB
master SendReceive netcoreapp3.1 1.89μs 0.891ns 3.34ns 0.016 0 0 1.18 KB
master SendReceive net472 2.36μs 1.76ns 6.81ns 0.187 0 0 1.18 KB
#5317 SendReceive net6.0 1.46μs 0.947ns 3.54ns 0.0166 0 0 1.18 KB
#5317 SendReceive netcoreapp3.1 1.8μs 0.719ns 2.69ns 0.0162 0 0 1.18 KB
#5317 SendReceive net472 2.3μs 2.06ns 7.98ns 0.187 0.00114 0 1.18 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.64μs 0.717ns 2.68ns 0.0211 0 0 1.55 KB
master EnrichedLog netcoreapp3.1 4.06μs 1.01ns 3.66ns 0.0205 0 0 1.6 KB
master EnrichedLog net472 4.51μs 1.97ns 7.37ns 0.316 0 0 1.99 KB
#5317 EnrichedLog net6.0 2.75μs 1.72ns 6.43ns 0.0221 0 0 1.55 KB
#5317 EnrichedLog netcoreapp3.1 3.88μs 1.49ns 5.58ns 0.0214 0 0 1.6 KB
#5317 EnrichedLog net472 4.47μs 3.97ns 15.4ns 0.314 0 0 1.99 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5317

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472 1.119 1,053.19 941.16

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 483ns 0.807ns 3.02ns 0.00761 0 0 552 B
master StartFinishSpan netcoreapp3.1 710ns 0.615ns 2.38ns 0.00752 0 0 552 B
master StartFinishSpan net472 782ns 0.396ns 1.53ns 0.0878 0 0 554 B
master StartFinishScope net6.0 620ns 0.915ns 3.55ns 0.00928 0 0 672 B
master StartFinishScope netcoreapp3.1 840ns 0.78ns 3.02ns 0.00918 0 0 672 B
master StartFinishScope net472 1.05μs 1.14ns 4.28ns 0.101 0 0 634 B
#5317 StartFinishSpan net6.0 514ns 0.415ns 1.61ns 0.00773 0 0 552 B
#5317 StartFinishSpan netcoreapp3.1 727ns 0.756ns 2.93ns 0.00736 0 0 552 B
#5317 StartFinishSpan net472 806ns 0.609ns 2.36ns 0.0877 0 0 554 B
#5317 StartFinishScope net6.0 607ns 0.223ns 0.836ns 0.00941 0 0 672 B
#5317 StartFinishScope netcoreapp3.1 916ns 0.641ns 2.4ns 0.00896 0 0 672 B
#5317 StartFinishScope net472 940ns 2.3ns 8.92ns 0.1 0 0 634 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 683ns 0.781ns 3.03ns 0.00958 0 0 672 B
master RunOnMethodBegin netcoreapp3.1 955ns 0.782ns 3.03ns 0.00911 0 0 672 B
master RunOnMethodBegin net472 1.17μs 1.6ns 5.76ns 0.1 0 0 634 B
#5317 RunOnMethodBegin net6.0 693ns 0.566ns 2.19ns 0.00946 0 0 672 B
#5317 RunOnMethodBegin netcoreapp3.1 1μs 0.713ns 2.76ns 0.00902 0 0 672 B
#5317 RunOnMethodBegin net472 1.06μs 1.65ns 6.38ns 0.101 0 0 634 B

@andrewlock
Copy link
Member

andrewlock commented Mar 18, 2024

Benchmarks Report for appsec 🐌

Benchmarks for #5317 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.172
  • 1 benchmarks have fewer allocations
  • 1 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 - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5317

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody‑net472 1.193 4,530.78 3,799.06
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 1.152 5,087.57 4,415.25

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 561ns 0.417ns 1.56ns 0.0153 0 0 1.08 KB
master AllCycleSimpleBody netcoreapp3.1 785ns 0.428ns 1.48ns 0.0145 0 0 1.06 KB
master AllCycleSimpleBody net472 667ns 0.314ns 1.22ns 0.175 0.000331 0 1.1 KB
master AllCycleMoreComplexBody net6.0 3.59μs 2.91ns 10.9ns 0.0647 0 0 4.58 KB
master AllCycleMoreComplexBody netcoreapp3.1 4.58μs 2.66ns 9.96ns 0.0618 0 0 4.48 KB
master AllCycleMoreComplexBody net472 5.09μs 2.55ns 9.86ns 0.731 0.00764 0 4.61 KB
master ObjectExtractorSimpleBody net6.0 147ns 0.134ns 0.518ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 203ns 0.116ns 0.433ns 0.00368 0 0 272 B
master ObjectExtractorSimpleBody net472 171ns 0.311ns 1.21ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.99μs 2.67ns 10.3ns 0.0525 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.09μs 9.52ns 36.9ns 0.0505 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 4.53μs 2.06ns 7.41ns 0.601 0.00452 0 3.8 KB
#5317 AllCycleSimpleBody net6.0 547ns 0.408ns 1.47ns 0.0151 0 0 1.08 KB
#5317 AllCycleSimpleBody netcoreapp3.1 754ns 0.505ns 1.89ns 0.0148 0 0 1.06 KB
#5317 AllCycleSimpleBody net472 669ns 0.256ns 0.993ns 0.174 0.000334 0 1.1 KB
#5317 AllCycleMoreComplexBody net6.0 3.56μs 1.95ns 7.29ns 0.0643 0 0 4.58 KB
#5317 AllCycleMoreComplexBody netcoreapp3.1 4.72μs 2.66ns 10.3ns 0.0615 0 0 4.48 KB
#5317 AllCycleMoreComplexBody net472 4.41μs 6.71ns 26ns 0.732 0.00874 0 4.61 KB
#5317 ObjectExtractorSimpleBody net6.0 140ns 0.0893ns 0.346ns 0.00398 0 0 280 B
#5317 ObjectExtractorSimpleBody netcoreapp3.1 205ns 0.135ns 0.521ns 0.00375 0 0 272 B
#5317 ObjectExtractorSimpleBody net472 167ns 0.141ns 0.547ns 0.0446 0 0 281 B
#5317 ObjectExtractorMoreComplexBody net6.0 2.99μs 1.63ns 6.32ns 0.0525 0 0 3.78 KB
#5317 ObjectExtractorMoreComplexBody netcoreapp3.1 3.9μs 1.44ns 5.19ns 0.0489 0 0 3.69 KB
#5317 ObjectExtractorMoreComplexBody net472 3.8μs 2.78ns 10.8ns 0.602 0.0057 0 3.8 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 191μs 43.7ns 169ns 0.0956 0 0 6.51 KB
master RunWafRealisticBenchmark netcoreapp3.1 201μs 164ns 615ns 0 0 0 6.49 KB
master RunWafRealisticBenchmark net472 225μs 371ns 1.44μs 0.996 0 0 6.59 KB
master RunWafRealisticBenchmarkWithAttack net6.0 124μs 42.5ns 165ns 0 0 0 4.15 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 133μs 279ns 1.08μs 0 0 0 4.15 KB
master RunWafRealisticBenchmarkWithAttack net472 145μs 114ns 413ns 0.661 0 0 4.19 KB
#5317 RunWafRealisticBenchmark net6.0 191μs 374ns 1.45μs 0.0941 0 0 6.51 KB
#5317 RunWafRealisticBenchmark netcoreapp3.1 204μs 525ns 2.03μs 0 0 0 6.49 KB
#5317 RunWafRealisticBenchmark net472 223μs 219ns 790ns 1 0 0 6.59 KB
#5317 RunWafRealisticBenchmarkWithAttack net6.0 124μs 53.1ns 206ns 0 0 0 4.15 KB
#5317 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 135μs 384ns 1.49μs 0 0 0 4.15 KB
#5317 RunWafRealisticBenchmarkWithAttack net472 146μs 149ns 579ns 0.653 0 0 4.19 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #5317

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 204.09 KB 210.27 KB 6.18 KB 3.03%

Fewer allocations 🎉 in #5317

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 204.98 KB 202.59 KB -2.39 KB -1.17%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 60.7μs 625ns 6.13μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 54μs 162ns 582ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 38.2μs 170ns 636ns 0 0 0 59.22 KB
master StringConcatAspectBenchmark net6.0 278μs 4.54μs 43.6μs 0 0 0 204.98 KB
master StringConcatAspectBenchmark netcoreapp3.1 308μs 1.27μs 4.74μs 0 0 0 204.09 KB
master StringConcatAspectBenchmark net472 258μs 3.75μs 35.7μs 0 0 0 221.18 KB
#5317 StringConcatBenchmark net6.0 63.2μs 770ns 7.5μs 0 0 0 43.44 KB
#5317 StringConcatBenchmark netcoreapp3.1 53.6μs 268ns 1.11μs 0 0 0 42.64 KB
#5317 StringConcatBenchmark net472 38.6μs 85.8ns 309ns 0 0 0 59.07 KB
#5317 StringConcatAspectBenchmark net6.0 283μs 1.34μs 6.3μs 0 0 0 202.59 KB
#5317 StringConcatAspectBenchmark netcoreapp3.1 308μs 1.53μs 6.86μs 0 0 0 210.27 KB
#5317 StringConcatAspectBenchmark net472 275μs 5.86μs 56.8μs 0 0 0 221.18 KB

@lucaspimentel lucaspimentel changed the title Fix how security settings are read settings Fix how security settings are read Mar 20, 2024
@andrewlock
Copy link
Member

Throughput/Crank Report:zap:

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 (5317) (11.146M)   : 0, 11145816
    master (11.096M)   : 0, 11096138
    benchmarks/2.9.0 (10.743M)   : 0, 10743092

    section Automatic
    This PR (5317) (7.600M)   : 0, 7600208
    master (7.482M)   : 0, 7481686
    benchmarks/2.9.0 (7.823M)   : 0, 7823252

    section Trace stats
    This PR (5317) (8.021M)   : 0, 8020895
    master (7.944M)   : 0, 7944133

    section Manual
    This PR (5317) (9.768M)   : 0, 9767525
    master (9.429M)   : 0, 9429044

    section Manual + Automatic
    This PR (5317) (7.216M)   : 0, 7215831
    master (6.975M)   : 0, 6975116

    section Version Conflict
    This PR (5317) (6.576M)   : 0, 6576162
    master (6.384M)   : 0, 6383585

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5317) (9.752M)   : 0, 9751942
    master (9.571M)   : 0, 9570993
    benchmarks/2.9.0 (9.656M)   : 0, 9656465

    section Automatic
    This PR (5317) (6.589M)   : 0, 6589083
    master (6.470M)   : 0, 6469945

    section Trace stats
    This PR (5317) (6.888M)   : 0, 6887802
    master (7.095M)   : 0, 7095354

    section Manual
    This PR (5317) (8.182M)   : 0, 8182086
    master (8.040M)   : 0, 8039576

    section Manual + Automatic
    This PR (5317) (6.141M)   : 0, 6141051
    master (6.260M)   : 0, 6259761

    section Version Conflict
    This PR (5317) (5.746M)   : 0, 5746125
    master (5.905M)   : 0, 5905251

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5317) (9.839M)   : 0, 9839405
    master (10.013M)   : 0, 10013130
    benchmarks/2.9.0 (9.967M)   : 0, 9967407

    section Automatic
    This PR (5317) (6.962M)   : 0, 6962237
    master (7.046M)   : 0, 7046320
    benchmarks/2.9.0 (7.375M)   : 0, 7374511

    section Trace stats
    This PR (5317) (7.336M)   : 0, 7336450
    master (7.437M)   : 0, 7437175

    section Manual
    This PR (5317) (8.653M)   : 0, 8652791
    master (8.864M)   : 0, 8864242

    section Manual + Automatic
    This PR (5317) (6.644M)   : 0, 6644271
    master (6.834M)   : 0, 6834408

    section Version Conflict
    This PR (5317) (6.174M)   : 0, 6174424
    master (6.123M)   : 0, 6122721

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5317) (21.553M)   : 0, 21552930

    section No attack
    This PR (5317) (21.544M)   : 0, 21544011

    section Attack
    This PR (5317) (21.544M)   : 0, 21544139

    section Blocking
    This PR (5317) (21.568M)   : 0, 21568108

    section IAST default
    This PR (5317) (21.549M)   : 0, 21549399

    section IAST full
    This PR (5317) (21.568M)   : 0, 21567637

    section Base vuln
    This PR (5317) (21.472M)   : 0, 21472064

    section IAST vuln
    This PR (5317) (21.413M)   : 0, 21413414

Loading

Copy link
Contributor

@NachoEchevarria NachoEchevarria left a comment

Choose a reason for hiding this comment

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

I was just implementing the config values for the RASP stacktrace reporting. This PR was helpful to avoid adding more GetValueOrDefaults :)

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.

👍

@robertpi robertpi merged commit 654116a into master Mar 21, 2024
55 of 57 checks passed
@robertpi robertpi deleted the robert/asm/fix-setting-default-values branch March 21, 2024 16:06
@github-actions github-actions bot added this to the vNext milestone Mar 21, 2024
@andrewlock andrewlock modified the milestones: vNext, vNext-v2 Apr 17, 2024
@andrewlock andrewlock added type:cleanup Minor code clean up area:asm labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm type:cleanup Minor code clean up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants