-
Notifications
You must be signed in to change notification settings - Fork 147
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] Add a lock to handle WAF active addresses #6566
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 245671 Passed, 1969 Skipped, 19h 30m 39.06s Total Time ⌛ Performance Regressions vs Default Branch (1)
|
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 (6566) - mean (69ms) : 65, 74
. : milestone, 69,
master - mean (69ms) : 64, 75
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6566) - mean (983ms) : 963, 1003
. : milestone, 983,
master - mean (978ms) : 954, 1001
. : milestone, 978,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6566) - mean (108ms) : 104, 111
. : milestone, 108,
master - mean (107ms) : 105, 110
. : milestone, 107,
section CallTarget+Inlining+NGEN
This PR (6566) - mean (684ms) : 662, 705
. : milestone, 684,
master - mean (681ms) : 667, 695
. : milestone, 681,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6566) - mean (91ms) : 89, 93
. : milestone, 91,
master - mean (91ms) : 87, 95
. : milestone, 91,
section CallTarget+Inlining+NGEN
This PR (6566) - mean (636ms) : 622, 651
. : milestone, 636,
master - mean (632ms) : 615, 650
. : milestone, 632,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6566) - mean (190ms) : 186, 195
. : milestone, 190,
master - mean (192ms) : 184, 200
. : milestone, 192,
section CallTarget+Inlining+NGEN
This PR (6566) - mean (1,095ms) : 1065, 1124
. : milestone, 1095,
master - mean (1,094ms) : 1058, 1130
. : milestone, 1094,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6566) - mean (275ms) : 271, 279
. : milestone, 275,
master - mean (276ms) : 272, 280
. : milestone, 276,
section CallTarget+Inlining+NGEN
This PR (6566) - mean (870ms) : 842, 898
. : milestone, 870,
master - mean (872ms) : 844, 900
. : milestone, 872,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6566) - mean (264ms) : 261, 268
. : milestone, 264,
master - mean (264ms) : 260, 268
. : milestone, 264,
section CallTarget+Inlining+NGEN
This PR (6566) - mean (850ms) : 815, 885
. : milestone, 850,
master - mean (849ms) : 811, 886
. : milestone, 849,
|
Benchmarks Report for appsec 🐌Benchmarks for #6566 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 - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 | 1.168 | 164.01 | 191.55 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | AllCycleSimpleBody |
net6.0 | 203μs | 88.6ns | 332ns | 2.62 | 0 | 0 | 188.76 KB |
master | AllCycleSimpleBody |
netcoreapp3.1 | 300μs | 97.6ns | 378ns | 2.69 | 0 | 0 | 196.09 KB |
master | AllCycleSimpleBody |
net472 | 270μs | 239ns | 893ns | 35.8 | 2.02 | 0 | 225.78 KB |
master | AllCycleMoreComplexBody |
net6.0 | 211μs | 108ns | 418ns | 2.73 | 0 | 0 | 192.26 KB |
master | AllCycleMoreComplexBody |
netcoreapp3.1 | 327μs | 179ns | 669ns | 2.61 | 0 | 0 | 199.5 KB |
master | AllCycleMoreComplexBody |
net472 | 277μs | 155ns | 558ns | 36.4 | 2.07 | 0 | 229.3 KB |
master | ObjectExtractorSimpleBody |
net6.0 | 139ns | 0.0962ns | 0.36ns | 0.00394 | 0 | 0 | 280 B |
master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 202ns | 1.01ns | 4.4ns | 0.00366 | 0 | 0 | 272 B |
master | ObjectExtractorSimpleBody |
net472 | 164ns | 0.14ns | 0.541ns | 0.0446 | 0 | 0 | 281 B |
master | ObjectExtractorMoreComplexBody |
net6.0 | 2.96μs | 2.48ns | 8.95ns | 0.0533 | 0 | 0 | 3.78 KB |
master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.82μs | 2.41ns | 9.35ns | 0.0496 | 0 | 0 | 3.69 KB |
master | ObjectExtractorMoreComplexBody |
net472 | 3.69μs | 5.19ns | 19.4ns | 0.603 | 0.00551 | 0 | 3.8 KB |
#6566 | AllCycleSimpleBody |
net6.0 | 207μs | 121ns | 454ns | 2.68 | 0 | 0 | 188.69 KB |
#6566 | AllCycleSimpleBody |
netcoreapp3.1 | 293μs | 128ns | 479ns | 2.63 | 0 | 0 | 196.02 KB |
#6566 | AllCycleSimpleBody |
net472 | 274μs | 383ns | 1.43μs | 35.9 | 2.04 | 0 | 225.75 KB |
#6566 | AllCycleMoreComplexBody |
net6.0 | 212μs | 193ns | 749ns | 2.65 | 0 | 0 | 192.19 KB |
#6566 | AllCycleMoreComplexBody |
netcoreapp3.1 | 317μs | 181ns | 677ns | 2.7 | 0 | 0 | 199.43 KB |
#6566 | AllCycleMoreComplexBody |
net472 | 278μs | 297ns | 1.11μs | 36.4 | 2.11 | 0 | 229.27 KB |
#6566 | ObjectExtractorSimpleBody |
net6.0 | 140ns | 0.0875ns | 0.327ns | 0.00395 | 0 | 0 | 280 B |
#6566 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 195ns | 0.142ns | 0.531ns | 0.00374 | 0 | 0 | 272 B |
#6566 | ObjectExtractorSimpleBody |
net472 | 191ns | 0.232ns | 0.897ns | 0.0446 | 0 | 0 | 281 B |
#6566 | ObjectExtractorMoreComplexBody |
net6.0 | 2.97μs | 1.29ns | 4.84ns | 0.0535 | 0 | 0 | 3.78 KB |
#6566 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.87μs | 3.51ns | 12.6ns | 0.0504 | 0 | 0 | 3.69 KB |
#6566 | ObjectExtractorMoreComplexBody |
net472 | 3.7μs | 4.59ns | 17.8ns | 0.602 | 0.00557 | 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.6μs | 14.8ns | 57.3ns | 0.444 | 0 | 0 | 32.4 KB |
master | EncodeArgs |
netcoreapp3.1 | 54.1μs | 28.5ns | 110ns | 0.431 | 0 | 0 | 32.4 KB |
master | EncodeArgs |
net472 | 67.2μs | 208ns | 807ns | 5.16 | 0.0661 | 0 | 32.5 KB |
master | EncodeLegacyArgs |
net6.0 | 80.2μs | 167ns | 645ns | 0 | 0 | 0 | 2.14 KB |
master | EncodeLegacyArgs |
netcoreapp3.1 | 108μs | 147ns | 552ns | 0 | 0 | 0 | 2.14 KB |
master | EncodeLegacyArgs |
net472 | 154μs | 106ns | 409ns | 0.308 | 0 | 0 | 2.15 KB |
#6566 | EncodeArgs |
net6.0 | 38.1μs | 28.4ns | 106ns | 0.455 | 0 | 0 | 32.4 KB |
#6566 | EncodeArgs |
netcoreapp3.1 | 54.6μs | 31.9ns | 123ns | 0.436 | 0 | 0 | 32.4 KB |
#6566 | EncodeArgs |
net472 | 66.4μs | 75.3ns | 282ns | 5.16 | 0.0666 | 0 | 32.5 KB |
#6566 | EncodeLegacyArgs |
net6.0 | 77.3μs | 403ns | 2.02μs | 0 | 0 | 0 | 2.14 KB |
#6566 | EncodeLegacyArgs |
netcoreapp3.1 | 107μs | 511ns | 1.98μs | 0 | 0 | 0 | 2.14 KB |
#6566 | EncodeLegacyArgs |
net472 | 154μs | 94.5ns | 366ns | 0.307 | 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 | 175μs | 67.6ns | 253ns | 0 | 0 | 0 | 2.44 KB |
master | RunWafRealisticBenchmark |
netcoreapp3.1 | 186μs | 241ns | 935ns | 0 | 0 | 0 | 2.39 KB |
master | RunWafRealisticBenchmark |
net472 | 201μs | 157ns | 609ns | 0.302 | 0 | 0 | 2.46 KB |
master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 116μs | 82.5ns | 320ns | 0 | 0 | 0 | 1.47 KB |
master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 123μs | 101ns | 349ns | 0 | 0 | 0 | 1.46 KB |
master | RunWafRealisticBenchmarkWithAttack |
net472 | 133μs | 83.6ns | 324ns | 0.199 | 0 | 0 | 1.48 KB |
#6566 | RunWafRealisticBenchmark |
net6.0 | 174μs | 243ns | 942ns | 0 | 0 | 0 | 2.44 KB |
#6566 | RunWafRealisticBenchmark |
netcoreapp3.1 | 187μs | 250ns | 967ns | 0 | 0 | 0 | 2.39 KB |
#6566 | RunWafRealisticBenchmark |
net472 | 203μs | 157ns | 607ns | 0.301 | 0 | 0 | 2.46 KB |
#6566 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 116μs | 54.5ns | 211ns | 0 | 0 | 0 | 1.47 KB |
#6566 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 123μs | 97.8ns | 379ns | 0 | 0 | 0 | 1.46 KB |
#6566 | RunWafRealisticBenchmarkWithAttack |
net472 | 132μs | 66.3ns | 248ns | 0.199 | 0 | 0 | 1.48 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #6566
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
264.31 KB
256.54 KB
-7.77 KB
-2.94%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472
61.98 KB
59.04 KB
-2.94 KB
-4.75%
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 264.31 KB | 256.54 KB | -7.77 KB | -2.94% |
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 61.98 KB | 59.04 KB | -2.94 KB | -4.75% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StringConcatBenchmark |
net6.0 | 54.2μs | 498ns | 4.88μs | 0 | 0 | 0 | 43.44 KB |
master | StringConcatBenchmark |
netcoreapp3.1 | 53.9μs | 280ns | 1.37μs | 0 | 0 | 0 | 42.64 KB |
master | StringConcatBenchmark |
net472 | 36.9μs | 93.2ns | 323ns | 0 | 0 | 0 | 61.98 KB |
master | StringConcatAspectBenchmark |
net6.0 | 319μs | 1.58μs | 10.1μs | 0 | 0 | 0 | 264.31 KB |
master | StringConcatAspectBenchmark |
netcoreapp3.1 | 336μs | 1.85μs | 10.7μs | 0 | 0 | 0 | 252.53 KB |
master | StringConcatAspectBenchmark |
net472 | 269μs | 4.94μs | 47.7μs | 0 | 0 | 0 | 278.53 KB |
#6566 | StringConcatBenchmark |
net6.0 | 58.4μs | 635ns | 6.09μs | 0 | 0 | 0 | 43.44 KB |
#6566 | StringConcatBenchmark |
netcoreapp3.1 | 54.1μs | 177ns | 661ns | 0 | 0 | 0 | 42.64 KB |
#6566 | StringConcatBenchmark |
net472 | 37.8μs | 101ns | 379ns | 0 | 0 | 0 | 59.04 KB |
#6566 | StringConcatAspectBenchmark |
net6.0 | 321μs | 1.54μs | 10.7μs | 0 | 0 | 0 | 256.54 KB |
#6566 | StringConcatAspectBenchmark |
netcoreapp3.1 | 312μs | 4.88μs | 48.6μs | 0 | 0 | 0 | 253.63 KB |
#6566 | StringConcatAspectBenchmark |
net472 | 287μs | 6.38μs | 62.2μs | 0 | 0 | 0 | 278.53 KB |
Benchmarks Report for tracer 🐌Benchmarks for #6566 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 - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 | 1.136 | 733.50 | 645.87 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 410ns | 0.344ns | 1.33ns | 0.00805 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 553ns | 0.481ns | 1.86ns | 0.00772 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 733ns | 0.207ns | 0.802ns | 0.0918 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 478ns | 0.228ns | 0.885ns | 0.00985 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 729ns | 0.517ns | 2ns | 0.00945 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 896ns | 0.369ns | 1.38ns | 0.104 | 0 | 0 | 658 B |
#6566 | StartFinishSpan |
net6.0 | 450ns | 0.23ns | 0.889ns | 0.00817 | 0 | 0 | 576 B |
#6566 | StartFinishSpan |
netcoreapp3.1 | 558ns | 0.485ns | 1.81ns | 0.00771 | 0 | 0 | 576 B |
#6566 | StartFinishSpan |
net472 | 646ns | 0.287ns | 1.11ns | 0.0918 | 0 | 0 | 578 B |
#6566 | StartFinishScope |
net6.0 | 531ns | 0.427ns | 1.65ns | 0.00985 | 0 | 0 | 696 B |
#6566 | StartFinishScope |
netcoreapp3.1 | 767ns | 0.461ns | 1.78ns | 0.00926 | 0 | 0 | 696 B |
#6566 | StartFinishScope |
net472 | 891ns | 0.414ns | 1.6ns | 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 | 617ns | 0.573ns | 2.22ns | 0.00965 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 853ns | 0.454ns | 1.76ns | 0.0094 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.11μs | 0.583ns | 2.26ns | 0.105 | 0 | 0 | 658 B |
#6566 | RunOnMethodBegin |
net6.0 | 605ns | 0.298ns | 1.15ns | 0.00969 | 0 | 0 | 696 B |
#6566 | RunOnMethodBegin |
netcoreapp3.1 | 921ns | 0.538ns | 2.01ns | 0.00933 | 0 | 0 | 696 B |
#6566 | RunOnMethodBegin |
net472 | 1.18μs | 0.606ns | 2.35ns | 0.104 | 0 | 0 | 658 B |
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.
Locking looks consistent to me.
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.
Thanks!
Thanks! |
Summary of changes
The field _activeAddresses should be thread safe to avoid concurrency issues.
Reason for change
Implementation details
Test coverage
Other details