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] Avoid null context repetitive log messages #6607

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

NachoEchevarria
Copy link
Contributor

@NachoEchevarria NachoEchevarria commented Jan 30, 2025

Summary of changes

Within a customer, we are displaying a warning message when calling RASP with a null context. The problem is that the message is sent too many times, flooding the log.

In this PR, we have lowered the log level of the warning message after the first call.

Also, we are displaying invalid aspect class in dataflow.cpp. The reason is that RASP is enabled and IAST disabled, so some aspects are not valid within this context. While this is a normal situation, the level of the log message might suggest that there is a anomalous situation.

Reason for change

Implementation details

Test coverage

Other details

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 30, 2025

Datadog Report

Branch report: nacho/NoContextLogs
Commit report: f283afd
Test service: dd-trace-dotnet

❌ 2 Failed (0 Known Flaky), 246160 Passed, 3051 Skipped, 33h 7m 43.82s Total Time
⌛ 1 Performance Regression

❌ Failed Tests (2)

  • Baseline - Samples.HttpMessageHandler.windows.net80.json.scenarios - Details

    Expand for error
     
     <null>rd Output: tnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0&arch=x64&rid=win-x64&os=win10
    
  • CallTarget+Inlining+NGEN - Samples.HttpMessageHandler.windows.net80.json.scenarios - Details

    Expand for error
     
     <null>rd Output: tnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0&arch=x64&rid=win-x64&os=win10
    

⌛ Performance Regressions vs Default Branch (1)

  • StringConcatAspectBenchmark - Benchmarks.Trace.Iast.StringAspectsBenchmark 542.9µs (+233.12µs, +75%) - Details

@andrewlock
Copy link
Member

andrewlock commented Jan 30, 2025

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 (6607) - mean (69ms)  : 66, 71
     .   : milestone, 69,
    master - mean (69ms)  : 65, 74
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6607) - mean (982ms)  : 955, 1010
     .   : milestone, 982,
    master - mean (981ms)  : 959, 1003
     .   : milestone, 981,

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

    section CallTarget+Inlining+NGEN
    This PR (6607) - mean (675ms)  : 661, 688
     .   : milestone, 675,
    master - mean (676ms)  : 660, 691
     .   : milestone, 676,

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

    section CallTarget+Inlining+NGEN
    This PR (6607) - mean (622ms)  : 606, 637
     .   : milestone, 622,
    master - mean (637ms)  : 614, 660
     .   : milestone, 637,

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

    section CallTarget+Inlining+NGEN
    This PR (6607) - mean (1,090ms)  : 1064, 1116
     .   : milestone, 1090,
    master - mean (1,087ms)  : 1064, 1110
     .   : milestone, 1087,

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

    section CallTarget+Inlining+NGEN
    This PR (6607) - mean (864ms)  : 842, 887
     .   : milestone, 864,
    master - mean (865ms)  : 832, 897
     .   : milestone, 865,

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

    section CallTarget+Inlining+NGEN
    This PR (6607) - mean (840ms)  : 812, 869
     .   : milestone, 840,
    master - mean (846ms)  : 807, 885
     .   : milestone, 846,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jan 30, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6607 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.340
  • 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.13μs 46.6ns 352ns 0.0202 0.00808 0 5.61 KB
master StartStopWithChild netcoreapp3.1 9.95μs 51.2ns 245ns 0.0203 0.0102 0 5.8 KB
master StartStopWithChild net472 16.4μs 50.3ns 195ns 1.06 0.326 0.103 6.22 KB
#6607 StartStopWithChild net6.0 7.95μs 45ns 315ns 0.0208 0.00831 0 5.61 KB
#6607 StartStopWithChild netcoreapp3.1 9.92μs 54.5ns 332ns 0.021 0.0105 0 5.8 KB
#6607 StartStopWithChild net472 16μs 54.7ns 212ns 1.05 0.315 0.103 6.22 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 478μs 400ns 1.55μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 635μs 402ns 1.56μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 863μs 701ns 2.71μs 0.428 0 0 3.3 KB
#6607 WriteAndFlushEnrichedTraces net6.0 482μs 137ns 530ns 0 0 0 2.7 KB
#6607 WriteAndFlushEnrichedTraces netcoreapp3.1 654μs 301ns 1.16μs 0 0 0 2.7 KB
#6607 WriteAndFlushEnrichedTraces net472 855μs 809ns 3.13μs 0.428 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 131μs 466ns 1.8μs 0.193 0 0 14.48 KB
master SendRequest netcoreapp3.1 140μs 581ns 2.25μs 0.21 0 0 17.27 KB
master SendRequest net472 0.00569ns 0.00226ns 0.00875ns 0 0 0 0 b
#6607 SendRequest net6.0 129μs 518ns 2μs 0.188 0 0 14.47 KB
#6607 SendRequest netcoreapp3.1 146μs 319ns 1.24μs 0.212 0 0 17.27 KB
#6607 SendRequest net472 0.00349ns 0.00258ns 0.00966ns 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 573μs 2.46μs 9.2μs 0.561 0 0 41.69 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 673μs 2.09μs 7.83μs 0.355 0 0 41.68 KB
master WriteAndFlushEnrichedTraces net472 844μs 4.1μs 17.9μs 8.45 2.53 0.422 53.27 KB
#6607 WriteAndFlushEnrichedTraces net6.0 560μs 2.69μs 15.2μs 0.541 0 0 41.59 KB
#6607 WriteAndFlushEnrichedTraces netcoreapp3.1 701μs 3.89μs 24.3μs 0.347 0 0 41.64 KB
#6607 WriteAndFlushEnrichedTraces net472 862μs 4.35μs 19μs 8.13 2.57 0.428 53.27 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.28μs 0.712ns 2.76ns 0.0141 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.72μs 1.33ns 5.14ns 0.0138 0 0 1.02 KB
master ExecuteNonQuery net472 2.15μs 2.56ns 9.93ns 0.156 0.00107 0 987 B
#6607 ExecuteNonQuery net6.0 1.27μs 0.9ns 3.49ns 0.0144 0 0 1.02 KB
#6607 ExecuteNonQuery netcoreapp3.1 1.84μs 2.33ns 8.73ns 0.0137 0 0 1.02 KB
#6607 ExecuteNonQuery net472 2.09μs 2.17ns 8.4ns 0.157 0.00104 0 987 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.29μs 0.511ns 1.91ns 0.0135 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.58μs 2ns 7.5ns 0.0135 0 0 976 B
master CallElasticsearch net472 2.66μs 2.05ns 7.94ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.39μs 0.555ns 2.15ns 0.0133 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.73μs 3.01ns 11.2ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.6μs 1.49ns 5.78ns 0.167 0 0 1.05 KB
#6607 CallElasticsearch net6.0 1.2μs 0.427ns 1.66ns 0.0139 0 0 976 B
#6607 CallElasticsearch netcoreapp3.1 1.61μs 0.924ns 3.58ns 0.0136 0 0 976 B
#6607 CallElasticsearch net472 2.67μs 1.45ns 5.42ns 0.157 0 0 995 B
#6607 CallElasticsearchAsync net6.0 1.37μs 2.87ns 10.8ns 0.0135 0 0 952 B
#6607 CallElasticsearchAsync netcoreapp3.1 1.74μs 0.892ns 3.45ns 0.0138 0 0 1.02 KB
#6607 CallElasticsearchAsync net472 2.69μs 1.56ns 6.03ns 0.167 0 0 1.05 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.31μs 0.586ns 2.19ns 0.0131 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.68μs 0.624ns 2.42ns 0.0126 0 0 952 B
master ExecuteAsync net472 1.95μs 0.796ns 2.87ns 0.144 0 0 915 B
#6607 ExecuteAsync net6.0 1.3μs 3.33ns 12.5ns 0.0133 0 0 952 B
#6607 ExecuteAsync netcoreapp3.1 1.65μs 0.848ns 3.28ns 0.0124 0 0 952 B
#6607 ExecuteAsync net472 1.86μs 0.409ns 1.58ns 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.34μs 1.11ns 4ns 0.0326 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.43μs 2.36ns 8.83ns 0.038 0 0 2.85 KB
master SendAsync net472 7.27μs 5.9ns 22.8ns 0.494 0 0 3.12 KB
#6607 SendAsync net6.0 4.43μs 1.42ns 5.31ns 0.031 0 0 2.31 KB
#6607 SendAsync netcoreapp3.1 5.27μs 2.1ns 8.14ns 0.0395 0 0 2.85 KB
#6607 SendAsync net472 7.31μs 2.11ns 8.17ns 0.494 0 0 3.12 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.43μs 0.4ns 1.44ns 0.0229 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.25μs 0.592ns 2.13ns 0.0226 0 0 1.64 KB
master EnrichedLog net472 2.45μs 0.695ns 2.69ns 0.249 0 0 1.57 KB
#6607 EnrichedLog net6.0 1.46μs 0.368ns 1.33ns 0.0227 0 0 1.64 KB
#6607 EnrichedLog netcoreapp3.1 2.14μs 1.11ns 4ns 0.0224 0 0 1.64 KB
#6607 EnrichedLog net472 2.52μs 1ns 3.88ns 0.249 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 114μs 97.7ns 366ns 0.0566 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 117μs 163ns 633ns 0 0 0 4.28 KB
master EnrichedLog net472 150μs 84.9ns 329ns 0.671 0.224 0 4.46 KB
#6607 EnrichedLog net6.0 112μs 122ns 474ns 0.0556 0 0 4.28 KB
#6607 EnrichedLog netcoreapp3.1 115μs 150ns 560ns 0 0 0 4.28 KB
#6607 EnrichedLog net472 149μs 118ns 456ns 0.672 0.224 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.08μs 1.07ns 4.16ns 0.0296 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.18μs 1.78ns 6.4ns 0.0293 0 0 2.2 KB
master EnrichedLog net472 4.73μs 1.33ns 5.14ns 0.32 0 0 2.02 KB
#6607 EnrichedLog net6.0 3.1μs 0.793ns 3.07ns 0.0311 0 0 2.2 KB
#6607 EnrichedLog netcoreapp3.1 3.97μs 1.05ns 3.94ns 0.0298 0 0 2.2 KB
#6607 EnrichedLog net472 4.81μs 1.6ns 6.21ns 0.319 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.33μs 0.839ns 3.25ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.86μs 0.843ns 3.26ns 0.0148 0 0 1.14 KB
master SendReceive net472 2.04μs 1.47ns 5.71ns 0.184 0 0 1.16 KB
#6607 SendReceive net6.0 1.48μs 0.972ns 3.77ns 0.0162 0 0 1.14 KB
#6607 SendReceive netcoreapp3.1 1.76μs 0.822ns 3.18ns 0.0149 0 0 1.14 KB
#6607 SendReceive net472 2.04μs 0.414ns 1.6ns 0.183 0 0 1.16 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.81μs 1.22ns 4.73ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.79μs 1.85ns 7.18ns 0.0208 0 0 1.65 KB
master EnrichedLog net472 4.33μs 1.71ns 6.16ns 0.322 0 0 2.04 KB
#6607 EnrichedLog net6.0 2.77μs 2.02ns 7.81ns 0.0222 0 0 1.6 KB
#6607 EnrichedLog netcoreapp3.1 3.84μs 1.4ns 5.23ns 0.021 0 0 1.65 KB
#6607 EnrichedLog net472 4.46μs 2.87ns 11.1ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6607

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.340 400.98 537.35

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 401ns 0.491ns 1.84ns 0.008 0 0 576 B
master StartFinishSpan netcoreapp3.1 607ns 0.872ns 3.26ns 0.00765 0 0 576 B
master StartFinishSpan net472 601ns 1.03ns 4ns 0.0916 0 0 578 B
master StartFinishScope net6.0 520ns 1.08ns 4.18ns 0.00982 0 0 696 B
master StartFinishScope netcoreapp3.1 704ns 1.14ns 4.42ns 0.00955 0 0 696 B
master StartFinishScope net472 802ns 2.6ns 10.1ns 0.104 0 0 658 B
#6607 StartFinishSpan net6.0 537ns 0.939ns 3.64ns 0.00811 0 0 576 B
#6607 StartFinishSpan netcoreapp3.1 547ns 1.23ns 4.76ns 0.00773 0 0 576 B
#6607 StartFinishSpan net472 600ns 0.877ns 3.4ns 0.0916 0 0 578 B
#6607 StartFinishScope net6.0 558ns 0.895ns 3.47ns 0.00987 0 0 696 B
#6607 StartFinishScope netcoreapp3.1 699ns 1.52ns 5.9ns 0.00936 0 0 696 B
#6607 StartFinishScope net472 786ns 1.73ns 6.68ns 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 578ns 0.723ns 2.8ns 0.00991 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 897ns 1.35ns 5.05ns 0.00921 0 0 696 B
master RunOnMethodBegin net472 1.05μs 2.36ns 9.15ns 0.104 0 0 658 B
#6607 RunOnMethodBegin net6.0 618ns 0.689ns 2.67ns 0.00983 0 0 696 B
#6607 RunOnMethodBegin netcoreapp3.1 974ns 1.64ns 6.36ns 0.00925 0 0 696 B
#6607 RunOnMethodBegin net472 1.07μs 1.71ns 6.64ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

andrewlock commented Jan 30, 2025

Benchmarks Report for appsec 🐌

Benchmarks for #6607 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.468
  • 2 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 - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 206μs 90.9ns 328ns 2.58 0 0 188.88 KB
master AllCycleSimpleBody netcoreapp3.1 303μs 142ns 533ns 2.71 0 0 196.21 KB
master AllCycleSimpleBody net472 271μs 109ns 408ns 35.9 2.02 0 226.09 KB
master AllCycleMoreComplexBody net6.0 208μs 137ns 531ns 2.72 0 0 192.38 KB
master AllCycleMoreComplexBody netcoreapp3.1 310μs 60.8ns 211ns 2.79 0 0 199.62 KB
master AllCycleMoreComplexBody net472 277μs 332ns 1.24μs 36.4 2.08 0 229.6 KB
master ObjectExtractorSimpleBody net6.0 151ns 0.101ns 0.391ns 0.00395 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 199ns 0.173ns 0.646ns 0.00372 0 0 272 B
master ObjectExtractorSimpleBody net472 167ns 0.342ns 1.33ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.95μs 1.43ns 5.34ns 0.053 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.02μs 0.973ns 3.64ns 0.0505 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 4.31μs 5.15ns 19.3ns 0.602 0.0065 0 3.8 KB
#6607 AllCycleSimpleBody net6.0 207μs 143ns 536ns 2.68 0 0 188.88 KB
#6607 AllCycleSimpleBody netcoreapp3.1 304μs 177ns 638ns 2.59 0 0 196.21 KB
#6607 AllCycleSimpleBody net472 270μs 69.2ns 268ns 35.8 2.03 0 226.09 KB
#6607 AllCycleMoreComplexBody net6.0 216μs 86.6ns 324ns 2.72 0 0 192.38 KB
#6607 AllCycleMoreComplexBody netcoreapp3.1 318μs 125ns 449ns 2.7 0 0 199.63 KB
#6607 AllCycleMoreComplexBody net472 275μs 225ns 813ns 36.5 2.06 0 229.61 KB
#6607 ObjectExtractorSimpleBody net6.0 142ns 0.0919ns 0.331ns 0.00393 0 0 280 B
#6607 ObjectExtractorSimpleBody netcoreapp3.1 215ns 0.461ns 1.78ns 0.00374 0 0 272 B
#6607 ObjectExtractorSimpleBody net472 165ns 0.231ns 0.895ns 0.0446 0 0 281 B
#6607 ObjectExtractorMoreComplexBody net6.0 2.93μs 1.21ns 4.37ns 0.0542 0 0 3.78 KB
#6607 ObjectExtractorMoreComplexBody netcoreapp3.1 3.71μs 2.38ns 8.92ns 0.0499 0 0 3.69 KB
#6607 ObjectExtractorMoreComplexBody net472 4.09μs 3.4ns 13.2ns 0.602 0.00612 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 37.6μs 20.2ns 78.4ns 0.45 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.3μs 29.5ns 107ns 0.433 0 0 32.4 KB
master EncodeArgs net472 66.8μs 62.6ns 243ns 5.16 0.0665 0 32.5 KB
master EncodeLegacyArgs net6.0 70.3μs 85ns 329ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 107μs 300ns 1.16μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 155μs 61.6ns 239ns 0.309 0 0 2.15 KB
#6607 EncodeArgs net6.0 37.2μs 23.4ns 90.6ns 0.461 0 0 32.4 KB
#6607 EncodeArgs netcoreapp3.1 54.1μs 20.7ns 80.1ns 0.43 0 0 32.4 KB
#6607 EncodeArgs net472 66.5μs 72.1ns 279ns 5.15 0.066 0 32.5 KB
#6607 EncodeLegacyArgs net6.0 74.1μs 31ns 116ns 0 0 0 2.14 KB
#6607 EncodeLegacyArgs netcoreapp3.1 109μs 358ns 1.38μs 0 0 0 2.14 KB
#6607 EncodeLegacyArgs net472 156μs 96.6ns 374ns 0.31 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 176μs 217ns 840ns 0 0 0 2.54 KB
master RunWafRealisticBenchmark netcoreapp3.1 188μs 154ns 595ns 0 0 0 2.49 KB
master RunWafRealisticBenchmark net472 200μs 62.2ns 233ns 0.401 0 0 2.55 KB
master RunWafRealisticBenchmarkWithAttack net6.0 116μs 68.2ns 264ns 0 0 0 1.57 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 125μs 36.8ns 133ns 0 0 0 1.55 KB
master RunWafRealisticBenchmarkWithAttack net472 132μs 79.8ns 309ns 0.198 0 0 1.58 KB
#6607 RunWafRealisticBenchmark net6.0 174μs 194ns 752ns 0 0 0 2.54 KB
#6607 RunWafRealisticBenchmark netcoreapp3.1 189μs 216ns 835ns 0 0 0 2.49 KB
#6607 RunWafRealisticBenchmark net472 201μs 136ns 507ns 0.403 0 0 2.55 KB
#6607 RunWafRealisticBenchmarkWithAttack net6.0 116μs 116ns 451ns 0 0 0 1.57 KB
#6607 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 124μs 164ns 637ns 0 0 0 1.55 KB
#6607 RunWafRealisticBenchmarkWithAttack net472 133μs 44.2ns 153ns 0.199 0 0 1.58 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #6607

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 1.793 320,850.00 575,400.00 bimodal
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 1.202 53,900.00 64,800.00 bimodal

More allocations ⚠️ in #6607

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 255.53 KB 317.02 KB 61.49 KB 24.06%

Fewer allocations 🎉 in #6607

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 253.9 KB 252.25 KB -1.66 KB -0.65%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.89 KB 59.07 KB -816 B -1.36%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 58.2μs 730ns 7.23μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 54.9μs 303ns 2.78μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.4μs 196ns 920ns 0 0 0 59.89 KB
master StringConcatAspectBenchmark net6.0 326μs 1.87μs 14μs 0 0 0 255.53 KB
master StringConcatAspectBenchmark netcoreapp3.1 355μs 2.04μs 14.7μs 0 0 0 253.9 KB
master StringConcatAspectBenchmark net472 249μs 1.12μs 4.03μs 0 0 0 278.53 KB
#6607 StringConcatBenchmark net6.0 60.2μs 737ns 7.3μs 0 0 0 43.44 KB
#6607 StringConcatBenchmark netcoreapp3.1 66.1μs 914ns 9.05μs 0 0 0 42.64 KB
#6607 StringConcatBenchmark net472 37.2μs 110ns 398ns 0 0 0 59.07 KB
#6607 StringConcatAspectBenchmark net6.0 543μs 9.33μs 91.8μs 0 0 0 317.02 KB
#6607 StringConcatAspectBenchmark netcoreapp3.1 336μs 1.9μs 15.6μs 0 0 0 252.25 KB
#6607 StringConcatAspectBenchmark net472 299μs 7.32μs 71μs 0 0 0 278.53 KB

@NachoEchevarria NachoEchevarria changed the title Lower log level after first warning [ASM] Avoid null context repetitive log messages Jan 30, 2025
@NachoEchevarria NachoEchevarria marked this pull request as ready for review January 30, 2025 14:52
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner January 30, 2025 14:52
@NachoEchevarria
Copy link
Contributor Author

Thanks for you reviews!

@NachoEchevarria NachoEchevarria merged commit c0e5fcf into master Feb 3, 2025
142 of 145 checks passed
@NachoEchevarria NachoEchevarria deleted the nacho/NoContextLogs branch February 3, 2025 09:23
@github-actions github-actions bot added this to the vNext-v3 milestone Feb 3, 2025
@andrewlock andrewlock added identified-by:customer type:enhancement Improvement to an existing feature labels Feb 11, 2025
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.

4 participants