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][IAST] Fix System.Text.Json: Properly implement GetRawText() aspect #5572

Merged
merged 1 commit into from
May 17, 2024

Conversation

e-n-0
Copy link
Member

@e-n-0 e-n-0 commented May 16, 2024

Summary of changes

Fix the aspect method for System.Text.Json.JsonElement::GetRawText().
The original method called always was GetString() and not GetRawText().

Reason for change

The aspect method for GetRawText() wasn't properly implemented.

Implementation details

Implement the GetRawText() aspect method in its own method, so the correct original method can be called.

Test coverage

Fixed a test that didn't compare the resulting string value with a real returned one without instrumentation.

@e-n-0 e-n-0 requested review from a team as code owners May 16, 2024 13:08
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.

Good catch

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented May 16, 2024

Datadog Report

Branch report: flavien/iast/fix-json-crash
Commit report: 9811c2a
Test service: dd-trace-dotnet

❌ 3 Failed (0 Known Flaky), 416636 Passed, 2410 Skipped, 24h 27m 32.77s Total Time

❌ Failed Tests (3)

  • SubmitsTraces - Datadog.Trace.ClrProfiler.IntegrationTests.AWS.AwsLambdaTests - Details

    Expand for error
     Value cannot be null. (Parameter 'source')
    
  • SubmitsTraces - Datadog.Trace.ClrProfiler.IntegrationTests.AWS.AwsLambdaTests - Details

    Expand for error
     Value cannot be null. (Parameter 'source')
    
  • SubmitsTraces - Datadog.Trace.ClrProfiler.IntegrationTests.AWS.AwsLambdaTests - Details

    Expand for error
     Value cannot be null. (Parameter 'source')
    

@andrewlock
Copy link
Member

andrewlock commented May 16, 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 (5572) - mean (74ms)  : 63, 84
     .   : milestone, 74,
    master - mean (75ms)  : 67, 83
     .   : milestone, 75,

    section CallTarget+Inlining+NGEN
    This PR (5572) - mean (1,010ms)  : 985, 1036
     .   : milestone, 1010,
    master - mean (1,013ms)  : 987, 1039
     .   : milestone, 1013,

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

    section CallTarget+Inlining+NGEN
    This PR (5572) - mean (727ms)  : 700, 754
     .   : milestone, 727,
    master - mean (729ms)  : 708, 750
     .   : milestone, 729,

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

    section CallTarget+Inlining+NGEN
    This PR (5572) - mean (683ms)  : 654, 712
     .   : milestone, 683,
    master - mean (679ms)  : 655, 703
     .   : milestone, 679,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5572) - mean (194ms)  : 190, 199
     .   : milestone, 194,
    master - mean (193ms)  : 189, 196
     .   : milestone, 193,

    section CallTarget+Inlining+NGEN
    This PR (5572) - mean (1,125ms)  : 1103, 1146
     .   : milestone, 1125,
    master - mean (1,115ms)  : 1091, 1139
     .   : milestone, 1115,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5572) - mean (278ms)  : 271, 285
     .   : milestone, 278,
    master - mean (276ms)  : 270, 281
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (5572) - mean (916ms)  : 896, 936
     .   : milestone, 916,
    master - mean (913ms)  : 891, 935
     .   : milestone, 913,

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

    section CallTarget+Inlining+NGEN
    This PR (5572) - mean (901ms)  : 883, 920
     .   : milestone, 901,
    master - mean (895ms)  : 873, 917
     .   : milestone, 895,

Loading

@e-n-0 e-n-0 force-pushed the flavien/iast/fix-json-crash branch from dd0827d to 9811c2a Compare May 16, 2024 14:26
@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #5572 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.130
  • 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.8μs 48.6ns 315ns 0.0218 0.00873 0 7.56 KB
master StartStopWithChild netcoreapp3.1 10.6μs 49.8ns 193ns 0.0215 0.0107 0 7.66 KB
master StartStopWithChild net472 17.1μs 56.2ns 218ns 1.33 0.342 0.102 8.06 KB
#5572 StartStopWithChild net6.0 9.08μs 50.6ns 312ns 0.0316 0.0136 0 7.56 KB
#5572 StartStopWithChild netcoreapp3.1 10.9μs 59.1ns 324ns 0.0266 0.0106 0 7.65 KB
#5572 StartStopWithChild net472 17.1μs 80.2ns 311ns 1.37 0.389 0.101 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 507μs 168ns 629ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 622μs 459ns 1.78μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 823μs 404ns 1.51μs 0.411 0 0 3.3 KB
#5572 WriteAndFlushEnrichedTraces net6.0 468μs 203ns 786ns 0 0 0 2.7 KB
#5572 WriteAndFlushEnrichedTraces netcoreapp3.1 637μs 309ns 1.2μs 0 0 0 2.7 KB
#5572 WriteAndFlushEnrichedTraces net472 827μs 463ns 1.79μs 0.414 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 170μs 95ns 355ns 0.169 0 0 18.49 KB
master SendRequest netcoreapp3.1 192μs 270ns 1.05μs 0.192 0 0 20.65 KB
master SendRequest net472 0.000792ns 0.00041ns 0.00153ns 0 0 0 0 b
#5572 SendRequest net6.0 172μs 424ns 1.64μs 0.257 0 0 18.49 KB
#5572 SendRequest netcoreapp3.1 191μs 332ns 1.28μs 0.191 0 0 20.65 KB
#5572 SendRequest net472 0.000798ns 0.000282ns 0.00109ns 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 301ns 1.17μs 0.548 0 0 41.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 650μs 2.49μs 9.66μs 0.324 0 0 41.69 KB
master WriteAndFlushEnrichedTraces net472 818μs 3.69μs 14.3μs 8.22 2.47 0.411 53.24 KB
#5572 WriteAndFlushEnrichedTraces net6.0 567μs 586ns 2.27μs 0.553 0 0 41.55 KB
#5572 WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 288ns 1.12μs 0.319 0 0 41.71 KB
#5572 WriteAndFlushEnrichedTraces net472 894μs 3.42μs 13.2μs 8.09 2.25 0.45 53.29 KB
Benchmarks.Trace.DbCommandBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5572

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 1.130 1,087.46 1,228.62

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.09μs 0.739ns 2.86ns 0.0114 0 0 808 B
master ExecuteNonQuery netcoreapp3.1 1.5μs 0.948ns 3.67ns 0.0111 0 0 808 B
master ExecuteNonQuery net472 1.77μs 0.424ns 1.47ns 0.122 0 0 770 B
#5572 ExecuteNonQuery net6.0 1.23μs 0.684ns 2.65ns 0.0113 0 0 808 B
#5572 ExecuteNonQuery netcoreapp3.1 1.54μs 2.2ns 8.53ns 0.011 0 0 808 B
#5572 ExecuteNonQuery net472 1.7μs 0.721ns 2.7ns 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.25μs 0.668ns 2.59ns 0.0143 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 1.65μs 1.63ns 6.31ns 0.0141 0 0 1.03 KB
master CallElasticsearch net472 2.62μs 0.951ns 3.68ns 0.166 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.28μs 0.6ns 2.32ns 0.0141 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 1.7μs 1.31ns 5.06ns 0.0145 0 0 1.08 KB
master CallElasticsearchAsync net472 2.55μs 0.849ns 3.29ns 0.175 0 0 1.1 KB
#5572 CallElasticsearch net6.0 1.2μs 0.7ns 2.71ns 0.0144 0 0 1.03 KB
#5572 CallElasticsearch netcoreapp3.1 1.59μs 2.51ns 9.72ns 0.0135 0 0 1.03 KB
#5572 CallElasticsearch net472 2.54μs 1.27ns 4.75ns 0.165 0 0 1.04 KB
#5572 CallElasticsearchAsync net6.0 1.34μs 0.511ns 1.98ns 0.014 0 0 1.01 KB
#5572 CallElasticsearchAsync netcoreapp3.1 1.79μs 0.912ns 3.53ns 0.0143 0 0 1.08 KB
#5572 CallElasticsearchAsync net472 2.64μs 2.81ns 10.1ns 0.175 0 0 1.1 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.925ns 3.46ns 0.0134 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.64μs 0.676ns 2.62ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.77μs 0.66ns 2.56ns 0.145 0.000883 0 915 B
#5572 ExecuteAsync net6.0 1.23μs 0.542ns 2.03ns 0.013 0 0 952 B
#5572 ExecuteAsync netcoreapp3.1 1.67μs 1.4ns 5.04ns 0.0126 0 0 952 B
#5572 ExecuteAsync net472 1.9μs 2.77ns 9.98ns 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.11μs 1.74ns 6.75ns 0.0307 0 0 2.27 KB
master SendAsync netcoreapp3.1 5.08μs 3.47ns 12.5ns 0.0381 0 0 2.81 KB
master SendAsync net472 7.64μs 2.72ns 10.5ns 0.503 0 0 3.18 KB
#5572 SendAsync net6.0 4.32μs 1.56ns 6.05ns 0.0325 0 0 2.27 KB
#5572 SendAsync netcoreapp3.1 5.01μs 1.5ns 5.61ns 0.0376 0 0 2.81 KB
#5572 SendAsync net472 7.65μs 3.43ns 13.3ns 0.504 0 0 3.18 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.58μs 1.08ns 4.03ns 0.0238 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 2.23μs 1.18ns 4.41ns 0.0235 0 0 1.7 KB
master EnrichedLog net472 2.69μs 1.62ns 6.26ns 0.257 0 0 1.62 KB
#5572 EnrichedLog net6.0 1.46μs 0.817ns 3.06ns 0.024 0 0 1.7 KB
#5572 EnrichedLog netcoreapp3.1 2.31μs 1.24ns 4.62ns 0.0232 0 0 1.7 KB
#5572 EnrichedLog net472 2.69μs 2.13ns 8.26ns 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 86.4ns 323ns 0.0562 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 117μs 119ns 459ns 0.0586 0 0 4.28 KB
master EnrichedLog net472 147μs 50.9ns 190ns 0.659 0.22 0 4.46 KB
#5572 EnrichedLog net6.0 113μs 84.9ns 329ns 0.0568 0 0 4.28 KB
#5572 EnrichedLog netcoreapp3.1 119μs 125ns 469ns 0 0 0 4.28 KB
#5572 EnrichedLog net472 149μs 58.8ns 228ns 0.67 0.223 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 2.88μs 0.727ns 2.72ns 0.0306 0 0 2.25 KB
master EnrichedLog netcoreapp3.1 4.25μs 1.88ns 7.04ns 0.0299 0 0 2.25 KB
master EnrichedLog net472 4.88μs 1.54ns 5.78ns 0.328 0 0 2.07 KB
#5572 EnrichedLog net6.0 3.08μs 1.39ns 5.19ns 0.0307 0 0 2.25 KB
#5572 EnrichedLog netcoreapp3.1 4.19μs 1.08ns 4.05ns 0.0294 0 0 2.25 KB
#5572 EnrichedLog net472 4.97μs 1.9ns 7.36ns 0.328 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.35μs 0.964ns 3.61ns 0.0168 0 0 1.2 KB
master SendReceive netcoreapp3.1 1.82μs 3.32ns 12.4ns 0.0163 0 0 1.2 KB
master SendReceive net472 2.25μs 1.42ns 5.33ns 0.19 0.00113 0 1.2 KB
#5572 SendReceive net6.0 1.43μs 0.563ns 2.03ns 0.0171 0 0 1.2 KB
#5572 SendReceive netcoreapp3.1 1.87μs 0.625ns 2.34ns 0.0168 0 0 1.2 KB
#5572 SendReceive net472 2.21μs 1.14ns 4.12ns 0.191 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.88μs 3.25ns 12.2ns 0.0216 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 4.18μs 4.84ns 18.8ns 0.0223 0 0 1.65 KB
master EnrichedLog net472 4.44μs 1.57ns 6.09ns 0.322 0 0 2.04 KB
#5572 EnrichedLog net6.0 2.69μs 1.92ns 7.43ns 0.0229 0 0 1.6 KB
#5572 EnrichedLog netcoreapp3.1 3.78μs 1.04ns 3.76ns 0.0212 0 0 1.65 KB
#5572 EnrichedLog net472 4.59μs 4.25ns 16.5ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 465ns 0.144ns 0.558ns 0.00814 0 0 576 B
master StartFinishSpan netcoreapp3.1 736ns 2.96ns 11.5ns 0.00758 0 0 576 B
master StartFinishSpan net472 892ns 0.204ns 0.764ns 0.0914 0 0 578 B
master StartFinishScope net6.0 626ns 0.293ns 1.1ns 0.0098 0 0 696 B
master StartFinishScope netcoreapp3.1 906ns 1.76ns 6.8ns 0.00952 0 0 696 B
master StartFinishScope net472 1.07μs 0.694ns 2.69ns 0.104 0 0 658 B
#5572 StartFinishSpan net6.0 467ns 0.124ns 0.465ns 0.00794 0 0 576 B
#5572 StartFinishSpan netcoreapp3.1 704ns 0.405ns 1.52ns 0.00777 0 0 576 B
#5572 StartFinishSpan net472 865ns 0.804ns 3.12ns 0.0915 0 0 578 B
#5572 StartFinishScope net6.0 667ns 0.206ns 0.771ns 0.00961 0 0 696 B
#5572 StartFinishScope netcoreapp3.1 859ns 0.292ns 1.13ns 0.00952 0 0 696 B
#5572 StartFinishScope net472 1.01μs 0.947ns 3.67ns 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 607ns 0.185ns 0.715ns 0.00994 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 931ns 1.33ns 5.14ns 0.00914 0 0 696 B
master RunOnMethodBegin net472 1.13μs 0.343ns 1.33ns 0.104 0 0 658 B
#5572 RunOnMethodBegin net6.0 584ns 0.232ns 0.867ns 0.00969 0 0 696 B
#5572 RunOnMethodBegin netcoreapp3.1 916ns 1.23ns 4.6ns 0.00951 0 0 696 B
#5572 RunOnMethodBegin net472 1.22μs 0.39ns 1.51ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

Benchmarks Report for appsec 🐌

Benchmarks for #5572 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.187
  • 1 benchmarks are slower, with geometric mean 1.148
  • 2 benchmarks have fewer allocations
  • 2 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 - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5572

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net6.0 1.148 142.26 163.24

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 71.5μs 72.7ns 281ns 0.0713 0 0 6 KB
master AllCycleSimpleBody netcoreapp3.1 62.4μs 87.5ns 339ns 0.0931 0 0 6.94 KB
master AllCycleSimpleBody net472 47μs 59.8ns 207ns 1.31 0 0 8.33 KB
master AllCycleMoreComplexBody net6.0 77.5μs 79.7ns 298ns 0.116 0 0 9.5 KB
master AllCycleMoreComplexBody netcoreapp3.1 69.8μs 102ns 396ns 0.14 0 0 10.36 KB
master AllCycleMoreComplexBody net472 54.3μs 80.3ns 311ns 1.88 0.0272 0 11.84 KB
master ObjectExtractorSimpleBody net6.0 142ns 0.174ns 0.628ns 0.00398 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 205ns 1.03ns 4.61ns 0.00362 0 0 272 B
master ObjectExtractorSimpleBody net472 171ns 0.166ns 0.644ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.98μs 1.36ns 4.89ns 0.0536 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.03μs 1.32ns 4.93ns 0.0505 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.78μs 2.29ns 8.86ns 0.601 0.00569 0 3.8 KB
#5572 AllCycleSimpleBody net6.0 70.8μs 119ns 460ns 0.0711 0 0 6 KB
#5572 AllCycleSimpleBody netcoreapp3.1 60.7μs 78.5ns 294ns 0.0911 0 0 6.94 KB
#5572 AllCycleSimpleBody net472 46.5μs 80.4ns 311ns 1.3 0 0 8.33 KB
#5572 AllCycleMoreComplexBody net6.0 75.2μs 78.6ns 283ns 0.113 0 0 9.5 KB
#5572 AllCycleMoreComplexBody netcoreapp3.1 67.7μs 103ns 401ns 0.136 0 0 10.36 KB
#5572 AllCycleMoreComplexBody net472 53.9μs 35.8ns 134ns 1.86 0.0269 0 11.84 KB
#5572 ObjectExtractorSimpleBody net6.0 162ns 0.89ns 5.27ns 0.00397 0 0 280 B
#5572 ObjectExtractorSimpleBody netcoreapp3.1 228ns 0.137ns 0.532ns 0.00368 0 0 272 B
#5572 ObjectExtractorSimpleBody net472 172ns 0.213ns 0.797ns 0.0446 0 0 281 B
#5572 ObjectExtractorMoreComplexBody net6.0 2.98μs 1.36ns 5.27ns 0.0541 0 0 3.78 KB
#5572 ObjectExtractorMoreComplexBody netcoreapp3.1 3.97μs 1.44ns 5.57ns 0.0495 0 0 3.69 KB
#5572 ObjectExtractorMoreComplexBody net472 4.18μs 0.888ns 3.32ns 0.602 0.00627 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.5μs 25ns 93.5ns 0.467 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.7μs 21.7ns 83.9ns 0.437 0 0 32.4 KB
master EncodeArgs net472 68.3μs 55.9ns 216ns 5.15 0.0682 0 32.5 KB
master EncodeLegacyArgs net6.0 76.1μs 413ns 2.37μs 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 104μs 107ns 415ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 156μs 105ns 380ns 0.309 0 0 2.15 KB
#5572 EncodeArgs net6.0 39.5μs 30.5ns 118ns 0.455 0 0 32.4 KB
#5572 EncodeArgs netcoreapp3.1 55.6μs 21.8ns 84.3ns 0.442 0 0 32.4 KB
#5572 EncodeArgs net472 68.9μs 54.7ns 212ns 5.13 0.0689 0 32.5 KB
#5572 EncodeLegacyArgs net6.0 72.7μs 30.9ns 107ns 0 0 0 2.14 KB
#5572 EncodeLegacyArgs netcoreapp3.1 105μs 375ns 1.45μs 0 0 0 2.14 KB
#5572 EncodeLegacyArgs net472 155μs 135ns 522ns 0.308 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 182μs 62.7ns 243ns 0 0 0 2.34 KB
master RunWafRealisticBenchmark netcoreapp3.1 197μs 197ns 761ns 0 0 0 2.3 KB
master RunWafRealisticBenchmark net472 217μs 69ns 267ns 0.323 0 0 2.36 KB
master RunWafRealisticBenchmarkWithAttack net6.0 123μs 166ns 644ns 0 0 0 1.44 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 323ns 1.21μs 0 0 0 1.42 KB
master RunWafRealisticBenchmarkWithAttack net472 142μs 22.9ns 88.7ns 0.213 0 0 1.45 KB
#5572 RunWafRealisticBenchmark net6.0 183μs 213ns 768ns 0 0 0 2.34 KB
#5572 RunWafRealisticBenchmark netcoreapp3.1 196μs 221ns 856ns 0 0 0 2.3 KB
#5572 RunWafRealisticBenchmark net472 216μs 55.5ns 208ns 0.324 0 0 2.36 KB
#5572 RunWafRealisticBenchmarkWithAttack net6.0 121μs 61.7ns 214ns 0 0 0 1.44 KB
#5572 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 132μs 82.9ns 310ns 0 0 0 1.42 KB
#5572 RunWafRealisticBenchmarkWithAttack net472 141μs 94.3ns 365ns 0.211 0 0 1.45 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #5572

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 1.187 61,950.00 52,200.00 bimodal

More allocations ⚠️ in #5572

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 201.81 KB 203.78 KB 1.97 KB 0.98%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.07 KB 59.41 KB 336 B 0.57%

Fewer allocations 🎉 in #5572

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 229.38 KB 221.18 KB -8.19 KB -3.57%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 268.81 KB 203.7 KB -65.1 KB -24.22%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 51.5μs 209ns 754ns 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 62.9μs 823ns 8.07μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 38.4μs 55.7ns 193ns 0 0 0 59.07 KB
master StringConcatAspectBenchmark net6.0 287μs 5.51μs 54.6μs 0 0 0 268.81 KB
master StringConcatAspectBenchmark netcoreapp3.1 303μs 1.58μs 10.7μs 0 0 0 201.81 KB
master StringConcatAspectBenchmark net472 240μs 1.3μs 7.55μs 0 0 0 229.38 KB
#5572 StringConcatBenchmark net6.0 51.3μs 148ns 553ns 0 0 0 43.44 KB
#5572 StringConcatBenchmark netcoreapp3.1 52.3μs 215ns 776ns 0 0 0 42.64 KB
#5572 StringConcatBenchmark net472 38.7μs 82ns 296ns 0 0 0 59.41 KB
#5572 StringConcatAspectBenchmark net6.0 290μs 1.43μs 5.91μs 0 0 0 203.7 KB
#5572 StringConcatAspectBenchmark netcoreapp3.1 319μs 1.63μs 9.61μs 0 0 0 203.78 KB
#5572 StringConcatAspectBenchmark net472 241μs 1.25μs 6.11μs 0 0 0 221.18 KB

@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 (5572) (11.857M)   : 0, 11856956
    master (11.879M)   : 0, 11879110
    benchmarks/2.9.0 (11.983M)   : 0, 11982622

    section Automatic
    This PR (5572) (7.812M)   : 0, 7812124
    master (8.054M)   : 0, 8053530
    benchmarks/2.9.0 (8.324M)   : 0, 8324349

    section Trace stats
    master (8.362M)   : 0, 8361687

    section Manual
    This PR (5572) (10.166M)   : 0, 10166229
    master (10.229M)   : 0, 10229080

    section Manual + Automatic
    This PR (5572) (7.487M)   : 0, 7487372
    master (7.641M)   : 0, 7641349

    section Version Conflict
    master (6.825M)   : 0, 6824800

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5572) (9.588M)   : 0, 9588121
    master (9.599M)   : 0, 9598656
    benchmarks/2.9.0 (9.587M)   : 0, 9587201

    section Automatic
    This PR (5572) (6.648M)   : 0, 6648354
    master (6.588M)   : 0, 6588326

    section Trace stats
    master (6.893M)   : 0, 6892670

    section Manual
    This PR (5572) (8.469M)   : 0, 8468934
    master (8.131M)   : 0, 8130516

    section Manual + Automatic
    This PR (5572) (6.253M)   : 0, 6252887
    master (6.167M)   : 0, 6167127

    section Version Conflict
    master (5.576M)   : 0, 5575919

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5572) (9.996M)   : 0, 9996421
    master (9.987M)   : 0, 9986822
    benchmarks/2.9.0 (9.913M)   : 0, 9912627

    section Automatic
    This PR (5572) (6.964M)   : 0, 6964318
    master (6.986M)   : 0, 6985911
    benchmarks/2.9.0 (7.312M)   : 0, 7312269

    section Trace stats
    master (7.286M)   : 0, 7285868

    section Manual
    This PR (5572) (8.617M)   : 0, 8616919
    master (8.789M)   : 0, 8788786

    section Manual + Automatic
    This PR (5572) (6.723M)   : 0, 6723450
    master (6.745M)   : 0, 6745109

    section Version Conflict
    master (6.204M)   : 0, 6204499

Loading

@e-n-0 e-n-0 merged commit 18d5da4 into master May 17, 2024
57 of 58 checks passed
@e-n-0 e-n-0 deleted the flavien/iast/fix-json-crash branch May 17, 2024 08:53
@github-actions github-actions bot added this to the vNext-v2 milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants