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] Remove the need to pass httpcontext to SecurityCoordinators #5548

Merged
merged 2 commits into from
May 13, 2024

Conversation

anna-git
Copy link
Contributor

@anna-git anna-git commented May 9, 2024

Summary of changes

Small refactoring, no need to pass an httpcontext, we can get it from async local / httpcontext.current (netfx) and if we already have it from the callee pov, we can pass an HttpTransport directly for Core

Reason for change

Simplify

Implementation details

Test coverage

Other details

@anna-git anna-git requested review from a team as code owners May 9, 2024 16:14
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented May 9, 2024

Datadog Report

Branch report: anna/asm/refactor-coordinators
Commit report: 7042e14
Test service: dd-trace-dotnet

✅ 0 Failed, 331668 Passed, 1553 Skipped, 14h 16m 48.36s Total Time

@andrewlock
Copy link
Member

andrewlock commented May 9, 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 (5548) - mean (71ms)  : 68, 74
     .   : milestone, 71,
    master - mean (73ms)  : 66, 80
     .   : milestone, 73,

    section CallTarget+Inlining+NGEN
    This PR (5548) - mean (1,017ms)  : 996, 1038
     .   : milestone, 1017,
    master - mean (1,017ms)  : 996, 1038
     .   : milestone, 1017,

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

    section CallTarget+Inlining+NGEN
    This PR (5548) - mean (741ms)  : 718, 764
     .   : milestone, 741,
    master - mean (731ms)  : 702, 760
     .   : milestone, 731,

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

    section CallTarget+Inlining+NGEN
    This PR (5548) - mean (683ms)  : 660, 707
     .   : milestone, 683,
    master - mean (683ms)  : 658, 708
     .   : milestone, 683,

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

    section CallTarget+Inlining+NGEN
    This PR (5548) - mean (1,111ms)  : 1081, 1141
     .   : milestone, 1111,
    master - mean (1,092ms)  : 1065, 1119
     .   : milestone, 1092,

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

    section CallTarget+Inlining+NGEN
    This PR (5548) - mean (901ms)  : 877, 925
     .   : milestone, 901,
    master - mean (888ms)  : 865, 910
     .   : milestone, 888,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5548) - mean (267ms)  : 263, 271
     .   : milestone, 267,
    master - mean (264ms)  : 260, 268
     .   : milestone, 264,

    section CallTarget+Inlining+NGEN
    This PR (5548) - mean (876ms)  : 855, 897
     .   : milestone, 876,
    master - mean (865ms)  : 839, 892
     .   : milestone, 865,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #5548 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.183
  • 2 benchmarks are slower, with geometric mean 1.172
  • 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 8.86μs 49.5ns 325ns 0.0281 0.014 0 7.55 KB
master StartStopWithChild netcoreapp3.1 10.9μs 53.3ns 232ns 0.0327 0.0164 0 7.65 KB
master StartStopWithChild net472 17.2μs 66.5ns 258ns 1.35 0.343 0.103 8.09 KB
#5548 StartStopWithChild net6.0 8.78μs 47.7ns 265ns 0.0317 0.0136 0 7.55 KB
#5548 StartStopWithChild netcoreapp3.1 10.6μs 56.4ns 304ns 0.0261 0.0104 0 7.65 KB
#5548 StartStopWithChild net472 17μs 49.4ns 191ns 1.38 0.386 0.101 8.1 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 466μs 334ns 1.29μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 629μs 186ns 695ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 832μs 473ns 1.83μs 0.414 0 0 3.3 KB
#5548 WriteAndFlushEnrichedTraces net6.0 479μs 396ns 1.48μs 0 0 0 2.7 KB
#5548 WriteAndFlushEnrichedTraces netcoreapp3.1 633μs 231ns 896ns 0 0 0 2.7 KB
#5548 WriteAndFlushEnrichedTraces net472 825μs 399ns 1.49μs 0.411 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 168μs 177ns 684ns 0.248 0 0 18.49 KB
master SendRequest netcoreapp3.1 191μs 245ns 916ns 0.189 0 0 20.65 KB
master SendRequest net472 0.000892ns 0.00036ns 0.00135ns 0 0 0 0 b
#5548 SendRequest net6.0 168μs 215ns 833ns 0.17 0 0 18.49 KB
#5548 SendRequest netcoreapp3.1 192μs 345ns 1.34μs 0.192 0 0 20.65 KB
#5548 SendRequest net472 0.000972ns 0.000375ns 0.00145ns 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 547μs 828ns 3.21μs 0.548 0 0 41.52 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 1.7μs 6.57μs 0.322 0 0 41.78 KB
master WriteAndFlushEnrichedTraces net472 854μs 2.61μs 10.1μs 8.36 2.64 0.44 53.25 KB
#5548 WriteAndFlushEnrichedTraces net6.0 562μs 402ns 1.56μs 0.556 0 0 41.66 KB
#5548 WriteAndFlushEnrichedTraces netcoreapp3.1 645μs 1.18μs 4.57μs 0.322 0 0 41.76 KB
#5548 WriteAndFlushEnrichedTraces net472 848μs 4.01μs 15.5μs 8.08 2.55 0.425 53.22 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.14μs 0.85ns 3.29ns 0.0115 0 0 808 B
master ExecuteNonQuery netcoreapp3.1 1.6μs 0.934ns 3.62ns 0.0113 0 0 808 B
master ExecuteNonQuery net472 1.86μs 0.627ns 2.43ns 0.122 0 0 770 B
#5548 ExecuteNonQuery net6.0 1.15μs 0.541ns 2.02ns 0.0114 0 0 808 B
#5548 ExecuteNonQuery netcoreapp3.1 1.57μs 0.919ns 3.56ns 0.0108 0 0 808 B
#5548 ExecuteNonQuery net472 1.84μs 0.598ns 2.24ns 0.122 0 0 770 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 1.04ns 3.87ns 0.0145 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 1.62μs 2.83ns 10.6ns 0.0138 0 0 1.03 KB
master CallElasticsearch net472 2.56μs 1.19ns 4.44ns 0.166 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.31μs 0.535ns 2ns 0.0144 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 1.67μs 1.37ns 5.32ns 0.0143 0 0 1.08 KB
master CallElasticsearchAsync net472 2.58μs 0.989ns 3.83ns 0.175 0 0 1.1 KB
#5548 CallElasticsearch net6.0 1.29μs 0.513ns 1.92ns 0.0142 0 0 1.03 KB
#5548 CallElasticsearch netcoreapp3.1 1.59μs 0.681ns 2.46ns 0.0144 0 0 1.03 KB
#5548 CallElasticsearch net472 2.6μs 0.955ns 3.57ns 0.166 0 0 1.04 KB
#5548 CallElasticsearchAsync net6.0 1.42μs 0.363ns 1.31ns 0.0141 0 0 1.01 KB
#5548 CallElasticsearchAsync netcoreapp3.1 1.75μs 6.01ns 23.3ns 0.0144 0 0 1.08 KB
#5548 CallElasticsearchAsync net472 2.59μs 1.49ns 5.77ns 0.174 0.00129 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5548

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.154 1,438.76 1,246.70

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.44μs 0.433ns 1.62ns 0.0136 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.73μs 1.16ns 4.17ns 0.013 0 0 952 B
master ExecuteAsync net472 1.8μs 1.53ns 5.93ns 0.145 0 0 915 B
#5548 ExecuteAsync net6.0 1.25μs 0.8ns 2.99ns 0.0132 0 0 952 B
#5548 ExecuteAsync netcoreapp3.1 1.7μs 1.62ns 6.04ns 0.0128 0 0 952 B
#5548 ExecuteAsync net472 1.78μs 0.799ns 3.09ns 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.29μs 1.92ns 6.94ns 0.0321 0 0 2.27 KB
master SendAsync netcoreapp3.1 5.15μs 1.97ns 7.36ns 0.0387 0 0 2.81 KB
master SendAsync net472 7.87μs 2.46ns 9.21ns 0.504 0 0 3.18 KB
#5548 SendAsync net6.0 4.18μs 2.31ns 8.62ns 0.0315 0 0 2.27 KB
#5548 SendAsync netcoreapp3.1 5.18μs 4.13ns 15.5ns 0.0391 0 0 2.81 KB
#5548 SendAsync net472 7.86μs 1.81ns 6.77ns 0.502 0 0 3.18 KB
Benchmarks.Trace.ILoggerBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5548

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.135 1,471.60 1,670.78

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.47μs 0.604ns 2.34ns 0.0236 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 2.25μs 0.849ns 3.29ns 0.0224 0 0 1.7 KB
master EnrichedLog net472 2.5μs 0.947ns 3.67ns 0.257 0 0 1.62 KB
#5548 EnrichedLog net6.0 1.67μs 0.674ns 2.52ns 0.0237 0 0 1.7 KB
#5548 EnrichedLog netcoreapp3.1 2.18μs 1.75ns 6.56ns 0.0227 0 0 1.7 KB
#5548 EnrichedLog net472 2.77μs 1.26ns 4.7ns 0.257 0 0 1.62 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 113μs 172ns 666ns 0.0563 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 120μs 128ns 494ns 0 0 0 4.28 KB
master EnrichedLog net472 149μs 151ns 586ns 0.669 0.223 0 4.46 KB
#5548 EnrichedLog net6.0 112μs 132ns 512ns 0.0555 0 0 4.28 KB
#5548 EnrichedLog netcoreapp3.1 120μs 220ns 851ns 0 0 0 4.28 KB
#5548 EnrichedLog net472 151μs 324ns 1.26μs 0.683 0.228 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 1.23ns 4.75ns 0.0318 0 0 2.25 KB
master EnrichedLog netcoreapp3.1 4.17μs 3.57ns 13.4ns 0.0291 0 0 2.25 KB
master EnrichedLog net472 4.8μs 1.13ns 4.39ns 0.327 0 0 2.07 KB
#5548 EnrichedLog net6.0 3.01μs 1.28ns 4.94ns 0.0316 0 0 2.25 KB
#5548 EnrichedLog netcoreapp3.1 4.39μs 1.72ns 6.66ns 0.0307 0 0 2.25 KB
#5548 EnrichedLog net472 4.83μs 1.6ns 6.2ns 0.327 0 0 2.07 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.47μs 0.966ns 3.74ns 0.0169 0 0 1.2 KB
master SendReceive netcoreapp3.1 1.87μs 1ns 3.75ns 0.0158 0 0 1.2 KB
master SendReceive net472 2.24μs 0.879ns 3.41ns 0.191 0 0 1.2 KB
#5548 SendReceive net6.0 1.44μs 0.569ns 2.13ns 0.0171 0 0 1.2 KB
#5548 SendReceive netcoreapp3.1 1.93μs 1.15ns 4.13ns 0.0154 0 0 1.2 KB
#5548 SendReceive net472 2.28μs 1.12ns 4.35ns 0.19 0 0 1.2 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.65μs 10.2ns 39.4ns 0.0222 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.97μs 2.41ns 9.35ns 0.0219 0 0 1.65 KB
master EnrichedLog net472 4.34μs 1.78ns 6.65ns 0.323 0 0 2.04 KB
#5548 EnrichedLog net6.0 2.72μs 0.825ns 3.19ns 0.0218 0 0 1.6 KB
#5548 EnrichedLog netcoreapp3.1 3.87μs 0.829ns 2.87ns 0.0213 0 0 1.65 KB
#5548 EnrichedLog net472 4.58μs 2.85ns 11ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5548

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.209 479.37 579.75

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 479ns 0.18ns 0.696ns 0.00791 0 0 576 B
master StartFinishSpan netcoreapp3.1 763ns 0.763ns 2.75ns 0.00765 0 0 576 B
master StartFinishSpan net472 784ns 0.858ns 3.32ns 0.0918 0 0 578 B
master StartFinishScope net6.0 623ns 0.149ns 0.575ns 0.00971 0 0 696 B
master StartFinishScope netcoreapp3.1 827ns 0.801ns 3.1ns 0.00943 0 0 696 B
master StartFinishScope net472 1.04μs 1.12ns 4.34ns 0.104 0 0 658 B
#5548 StartFinishSpan net6.0 580ns 0.26ns 0.972ns 0.0081 0 0 576 B
#5548 StartFinishSpan netcoreapp3.1 712ns 0.681ns 2.64ns 0.00776 0 0 576 B
#5548 StartFinishSpan net472 799ns 0.701ns 2.72ns 0.0916 0 0 578 B
#5548 StartFinishScope net6.0 597ns 0.178ns 0.689ns 0.0097 0 0 696 B
#5548 StartFinishScope netcoreapp3.1 855ns 0.35ns 1.26ns 0.00942 0 0 696 B
#5548 StartFinishScope net472 999ns 0.717ns 2.78ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5548

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.212 747.91 617.22

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 748ns 0.246ns 0.952ns 0.00972 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 939ns 0.294ns 1.14ns 0.00944 0 0 696 B
master RunOnMethodBegin net472 1.07μs 0.507ns 1.97ns 0.104 0 0 658 B
#5548 RunOnMethodBegin net6.0 618ns 0.43ns 1.66ns 0.00972 0 0 696 B
#5548 RunOnMethodBegin netcoreapp3.1 959ns 0.61ns 2.36ns 0.00928 0 0 696 B
#5548 RunOnMethodBegin net472 1.15μs 0.873ns 3.38ns 0.104 0 0 658 B

@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 (5548) (11.969M)   : 0, 11968788
    master (11.827M)   : 0, 11827295
    benchmarks/2.9.0 (11.966M)   : 0, 11965561

    section Automatic
    This PR (5548) (7.965M)   : 0, 7965384
    master (8.143M)   : 0, 8142788
    benchmarks/2.9.0 (8.468M)   : 0, 8467626

    section Trace stats
    master (8.466M)   : 0, 8465727

    section Manual
    This PR (5548) (10.341M)   : 0, 10340977
    master (10.531M)   : 0, 10531228

    section Manual + Automatic
    This PR (5548) (7.586M)   : 0, 7585985
    master (7.696M)   : 0, 7696118

    section Version Conflict
    master (7.003M)   : 0, 7003018

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5548) (9.533M)   : 0, 9533048
    master (9.609M)   : 0, 9609223
    benchmarks/2.9.0 (9.409M)   : 0, 9409220

    section Automatic
    This PR (5548) (6.337M)   : 0, 6336590
    master (6.614M)   : 0, 6613864

    section Trace stats
    master (6.767M)   : 0, 6766934

    section Manual
    This PR (5548) (8.072M)   : 0, 8071594
    master (8.227M)   : 0, 8227219

    section Manual + Automatic
    This PR (5548) (6.227M)   : 0, 6226646
    master (6.225M)   : 0, 6224632

    section Version Conflict
    master (5.608M)   : 0, 5607616

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5548) (9.944M)   : 0, 9944329
    master (9.705M)   : 0, 9704542
    benchmarks/2.9.0 (9.932M)   : 0, 9931696

    section Automatic
    This PR (5548) (7.089M)   : 0, 7089385
    master (6.963M)   : 0, 6962582
    benchmarks/2.9.0 (7.234M)   : 0, 7234153

    section Trace stats
    master (7.249M)   : 0, 7249157

    section Manual
    This PR (5548) (8.937M)   : 0, 8937143
    master (8.547M)   : 0, 8547130

    section Manual + Automatic
    This PR (5548) (6.870M)   : 0, 6870384
    master (6.668M)   : 0, 6667709

    section Version Conflict
    master (5.985M)   : 0, 5984650

Loading

@andrewlock
Copy link
Member

Benchmarks Report for appsec 🐌

Benchmarks for #5548 compared to master:

  • All benchmarks have the same speed
  • 2 benchmarks have fewer 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 71μs 92.7ns 359ns 0.0706 0 0 6 KB
master AllCycleSimpleBody netcoreapp3.1 62.3μs 109ns 421ns 0.093 0 0 6.94 KB
master AllCycleSimpleBody net472 47.6μs 28.5ns 103ns 1.3 0 0 8.33 KB
master AllCycleMoreComplexBody net6.0 78.1μs 98.7ns 382ns 0.118 0 0 9.5 KB
master AllCycleMoreComplexBody netcoreapp3.1 68.8μs 96.6ns 374ns 0.137 0 0 10.36 KB
master AllCycleMoreComplexBody net472 55μs 60.7ns 235ns 1.86 0.0274 0 11.84 KB
master ObjectExtractorSimpleBody net6.0 136ns 0.0841ns 0.326ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 207ns 0.437ns 1.69ns 0.00366 0 0 272 B
master ObjectExtractorSimpleBody net472 168ns 0.123ns 0.461ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.95μs 1.35ns 4.85ns 0.0533 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.97μs 5.03ns 19.5ns 0.0513 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.81μs 4.96ns 19.2ns 0.602 0.00573 0 3.8 KB
#5548 AllCycleSimpleBody net6.0 71.1μs 76.8ns 287ns 0.0716 0 0 6 KB
#5548 AllCycleSimpleBody netcoreapp3.1 62.2μs 90.1ns 349ns 0.0932 0 0 6.94 KB
#5548 AllCycleSimpleBody net472 47.4μs 49.5ns 185ns 1.32 0 0 8.33 KB
#5548 AllCycleMoreComplexBody net6.0 78.2μs 90.6ns 351ns 0.117 0 0 9.5 KB
#5548 AllCycleMoreComplexBody netcoreapp3.1 69.5μs 125ns 483ns 0.137 0 0 10.36 KB
#5548 AllCycleMoreComplexBody net472 55.4μs 75.3ns 292ns 1.86 0.0277 0 11.84 KB
#5548 ObjectExtractorSimpleBody net6.0 146ns 0.122ns 0.457ns 0.00397 0 0 280 B
#5548 ObjectExtractorSimpleBody netcoreapp3.1 205ns 0.21ns 0.814ns 0.0037 0 0 272 B
#5548 ObjectExtractorSimpleBody net472 169ns 0.159ns 0.617ns 0.0446 0 0 281 B
#5548 ObjectExtractorMoreComplexBody net6.0 3.05μs 1.72ns 6.43ns 0.0531 0 0 3.78 KB
#5548 ObjectExtractorMoreComplexBody netcoreapp3.1 4.02μs 0.874ns 3.15ns 0.0504 0 0 3.69 KB
#5548 ObjectExtractorMoreComplexBody net472 3.71μs 3.01ns 11.3ns 0.602 0.00556 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 40.3μs 19.3ns 72.2ns 0.442 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 55.4μs 39.9ns 155ns 0.414 0 0 32.4 KB
master EncodeArgs net472 68.3μs 41.1ns 159ns 5.13 0.068 0 32.5 KB
master EncodeLegacyArgs net6.0 72.1μs 27.9ns 104ns 0.0355 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 104μs 110ns 425ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 151μs 110ns 428ns 0.303 0 0 2.15 KB
#5548 EncodeArgs net6.0 39.1μs 17ns 65.7ns 0.447 0 0 32.4 KB
#5548 EncodeArgs netcoreapp3.1 55.4μs 55ns 213ns 0.44 0 0 32.4 KB
#5548 EncodeArgs net472 68.1μs 35.1ns 136ns 5.14 0.0681 0 32.5 KB
#5548 EncodeLegacyArgs net6.0 76.4μs 40.2ns 156ns 0 0 0 2.14 KB
#5548 EncodeLegacyArgs netcoreapp3.1 106μs 136ns 526ns 0 0 0 2.14 KB
#5548 EncodeLegacyArgs net472 150μs 125ns 482ns 0.3 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 185μs 85.7ns 321ns 0 0 0 2.34 KB
master RunWafRealisticBenchmark netcoreapp3.1 202μs 139ns 537ns 0 0 0 2.3 KB
master RunWafRealisticBenchmark net472 217μs 66.6ns 249ns 0.325 0 0 2.36 KB
master RunWafRealisticBenchmarkWithAttack net6.0 124μs 51.6ns 200ns 0 0 0 1.44 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 132μs 79ns 306ns 0 0 0 1.43 KB
master RunWafRealisticBenchmarkWithAttack net472 143μs 50.9ns 190ns 0.214 0 0 1.45 KB
#5548 RunWafRealisticBenchmark net6.0 185μs 47.6ns 184ns 0 0 0 2.34 KB
#5548 RunWafRealisticBenchmark netcoreapp3.1 201μs 126ns 489ns 0 0 0 2.3 KB
#5548 RunWafRealisticBenchmark net472 218μs 72.4ns 281ns 0.325 0 0 2.36 KB
#5548 RunWafRealisticBenchmarkWithAttack net6.0 124μs 81.3ns 304ns 0 0 0 1.44 KB
#5548 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 131μs 81.9ns 317ns 0 0 0 1.43 KB
#5548 RunWafRealisticBenchmarkWithAttack net472 142μs 77.9ns 302ns 0.212 0 0 1.45 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #5548

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 212.9 KB 203.63 KB -9.27 KB -4.36%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.04 KB 55.75 KB -3.29 KB -5.57%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 60μs 717ns 7.1μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 61.7μs 834ns 8.3μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 38.3μs 112ns 418ns 0 0 0 59.04 KB
master StringConcatAspectBenchmark net6.0 291μs 1.2μs 4.94μs 0 0 0 212.9 KB
master StringConcatAspectBenchmark netcoreapp3.1 304μs 1.59μs 8.56μs 0 0 0 202.11 KB
master StringConcatAspectBenchmark net472 261μs 4.64μs 44.8μs 0 0 0 221.18 KB
#5548 StringConcatBenchmark net6.0 60.3μs 716ns 7.12μs 0 0 0 43.44 KB
#5548 StringConcatBenchmark netcoreapp3.1 52.8μs 246ns 952ns 0 0 0 42.64 KB
#5548 StringConcatBenchmark net472 38.2μs 101ns 379ns 0 0 0 55.75 KB
#5548 StringConcatAspectBenchmark net6.0 286μs 1.35μs 5.4μs 0 0 0 203.63 KB
#5548 StringConcatAspectBenchmark netcoreapp3.1 301μs 1.58μs 8.06μs 0 0 0 201.53 KB
#5548 StringConcatAspectBenchmark net472 261μs 4.19μs 39.9μs 0 0 0 221.18 KB

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.

LGTM!

@anna-git anna-git merged commit 695dd74 into master May 13, 2024
60 checks passed
@anna-git anna-git deleted the anna/asm/refactor-coordinators branch May 13, 2024 13:39
@github-actions github-actions bot added this to the vNext-v2 milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants