-
Notifications
You must be signed in to change notification settings - Fork 140
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
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 331668 Passed, 1553 Skipped, 14h 16m 48.36s Total Time |
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 (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,
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,
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,
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,
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,
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,
|
Benchmarks Report for tracer 🐌Benchmarks for #5548 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 - Faster 🎉 Same allocations ✔️
|
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
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
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
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 |
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
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
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
|
Benchmarks Report for appsec 🐌Benchmarks for #5548 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 ✔️ Fewer allocations 🎉
|
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 |
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!
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