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

[IAST] Fix flaky Interpolated Strings tests #6555

Merged
merged 12 commits into from
Jan 31, 2025

Conversation

daniel-romano-DD
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD commented Jan 15, 2025

Summary of changes

Fix test flakiness by keeping alive the tainted boxed object during the lifespan of the ref struct

Reason for change

If a GC collect happened between the tainting of the DefaultInterpolatedStringHandler and the call to ToString the boxed object was collected and the weak reference was lost, causing the loss of the tainted status.
Thanks to @e-n-0 for finding what was happening

IDK who said flakiness was bad

Implementation details

Added a thread local queue to hold the boxed object of the tainted ref structs

Test coverage

Added a unit test

Other details

@daniel-romano-DD daniel-romano-DD added area:tests unit tests, integration tests area:asm-iast labels Jan 15, 2025
@daniel-romano-DD daniel-romano-DD requested a review from a team as a code owner January 15, 2025 15:01
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 15, 2025

Datadog Report

Branch report: dani/iast/interpolatedstrings_flaky_fix
Commit report: 3d2ad73
Test service: dd-trace-dotnet

✅ 0 Failed, 242184 Passed, 2001 Skipped, 19h 16m 48.56s Total Time

@daniel-romano-DD daniel-romano-DD marked this pull request as draft January 15, 2025 16:04
@andrewlock
Copy link
Member

andrewlock commented Jan 15, 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 (6555) - mean (69ms)  : 66, 72
     .   : milestone, 69,
    master - mean (69ms)  : 65, 74
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6555) - mean (982ms)  : 954, 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 (6555) - mean (108ms)  : 105, 110
     .   : milestone, 108,
    master - mean (108ms)  : 106, 111
     .   : milestone, 108,

    section CallTarget+Inlining+NGEN
    This PR (6555) - mean (677ms)  : 661, 693
     .   : milestone, 677,
    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 (6555) - mean (91ms)  : 89, 94
     .   : milestone, 91,
    master - mean (91ms)  : 89, 93
     .   : milestone, 91,

    section CallTarget+Inlining+NGEN
    This PR (6555) - mean (630ms)  : 611, 648
     .   : milestone, 630,
    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 (6555) - mean (190ms)  : 185, 195
     .   : milestone, 190,
    master - mean (190ms)  : 185, 195
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (6555) - mean (1,087ms)  : 1065, 1110
     .   : milestone, 1087,
    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 (6555) - mean (276ms)  : 272, 280
     .   : milestone, 276,
    master - mean (276ms)  : 272, 281
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (6555) - mean (866ms)  : 835, 896
     .   : milestone, 866,
    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 (6555) - mean (264ms)  : 260, 269
     .   : milestone, 264,
    master - mean (264ms)  : 260, 268
     .   : milestone, 264,

    section CallTarget+Inlining+NGEN
    This PR (6555) - mean (844ms)  : 807, 881
     .   : milestone, 844,
    master - mean (846ms)  : 807, 885
     .   : milestone, 846,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jan 16, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6555 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.144
  • 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 7.98μs 45.1ns 296ns 0.0152 0.0076 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.1μs 55.5ns 314ns 0.0207 0.0103 0 5.8 KB
master StartStopWithChild net472 16.1μs 50.1ns 194ns 1.05 0.326 0.0953 6.21 KB
#6555 StartStopWithChild net6.0 7.73μs 40.1ns 204ns 0.0184 0.00737 0 5.61 KB
#6555 StartStopWithChild netcoreapp3.1 10.1μs 55.6ns 334ns 0.0147 0.0049 0 5.8 KB
#6555 StartStopWithChild net472 16.2μs 63.7ns 247ns 1.06 0.323 0.102 6.2 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 485μs 285ns 1.11μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 655μs 413ns 1.6μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 857μs 620ns 2.15μs 0.425 0 0 3.3 KB
#6555 WriteAndFlushEnrichedTraces net6.0 488μs 420ns 1.57μs 0 0 0 2.7 KB
#6555 WriteAndFlushEnrichedTraces netcoreapp3.1 645μs 329ns 1.23μs 0 0 0 2.7 KB
#6555 WriteAndFlushEnrichedTraces net472 858μs 435ns 1.63μs 0.425 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 127μs 595ns 2.38μs 0.194 0 0 14.47 KB
master SendRequest netcoreapp3.1 144μs 637ns 2.47μs 0.217 0 0 17.27 KB
master SendRequest net472 0.00201ns 0.000798ns 0.00299ns 0 0 0 0 b
#6555 SendRequest net6.0 131μs 369ns 1.43μs 0.191 0 0 14.47 KB
#6555 SendRequest netcoreapp3.1 151μs 279ns 1.08μs 0.151 0 0 17.27 KB
#6555 SendRequest net472 0.000318ns 0.000123ns 0.000476ns 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 571μs 2.95μs 13.5μs 0.541 0 0 41.73 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 663μs 3.6μs 21μs 0.334 0 0 41.76 KB
master WriteAndFlushEnrichedTraces net472 837μs 2.99μs 11.2μs 8.08 2.55 0.425 53.29 KB
#6555 WriteAndFlushEnrichedTraces net6.0 565μs 2.67μs 10.7μs 0.561 0 0 41.67 KB
#6555 WriteAndFlushEnrichedTraces netcoreapp3.1 648μs 3.31μs 15.9μs 0.324 0 0 41.75 KB
#6555 WriteAndFlushEnrichedTraces net472 836μs 3.26μs 12.2μs 8.41 2.4 0.401 53.32 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.41μs 1.25ns 4.67ns 0.0147 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.82μs 2ns 7.76ns 0.0136 0 0 1.02 KB
master ExecuteNonQuery net472 2.01μs 1.01ns 3.64ns 0.156 0.00101 0 987 B
#6555 ExecuteNonQuery net6.0 1.4μs 1.36ns 5.26ns 0.014 0 0 1.02 KB
#6555 ExecuteNonQuery netcoreapp3.1 1.71μs 1.34ns 5.18ns 0.0136 0 0 1.02 KB
#6555 ExecuteNonQuery net472 2.12μs 1.86ns 6.98ns 0.157 0.00106 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.35μs 0.54ns 2.09ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.64μs 0.932ns 3.36ns 0.0132 0 0 976 B
master CallElasticsearch net472 2.57μs 1.65ns 6.37ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.26μs 0.981ns 3.54ns 0.0132 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.59μs 0.944ns 3.4ns 0.0142 0 0 1.02 KB
master CallElasticsearchAsync net472 2.66μs 1.12ns 4.04ns 0.166 0 0 1.05 KB
#6555 CallElasticsearch net6.0 1.22μs 0.773ns 2.99ns 0.0134 0 0 976 B
#6555 CallElasticsearch netcoreapp3.1 1.51μs 1.01ns 3.65ns 0.013 0 0 976 B
#6555 CallElasticsearch net472 2.65μs 1.89ns 7.31ns 0.158 0 0 995 B
#6555 CallElasticsearchAsync net6.0 1.18μs 0.321ns 1.16ns 0.0135 0 0 952 B
#6555 CallElasticsearchAsync netcoreapp3.1 1.59μs 1.28ns 4.97ns 0.0135 0 0 1.02 KB
#6555 CallElasticsearchAsync net472 2.66μs 1.13ns 4.08ns 0.166 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.35μs 0.872ns 3.26ns 0.0135 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.72μs 2.08ns 7.8ns 0.012 0 0 952 B
master ExecuteAsync net472 1.85μs 0.467ns 1.81ns 0.145 0 0 915 B
#6555 ExecuteAsync net6.0 1.28μs 0.418ns 1.56ns 0.0136 0 0 952 B
#6555 ExecuteAsync netcoreapp3.1 1.68μs 0.731ns 2.74ns 0.0126 0 0 952 B
#6555 ExecuteAsync net472 1.79μs 0.449ns 1.74ns 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.43μs 1.39ns 5.01ns 0.031 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.17μs 2.98ns 11.5ns 0.0386 0 0 2.85 KB
master SendAsync net472 7.36μs 1.09ns 4.07ns 0.494 0 0 3.12 KB
#6555 SendAsync net6.0 4.52μs 1.73ns 6.24ns 0.0315 0 0 2.31 KB
#6555 SendAsync netcoreapp3.1 5.31μs 1.55ns 5.57ns 0.0371 0 0 2.85 KB
#6555 SendAsync net472 7.42μs 1.29ns 5ns 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.45μs 0.879ns 3.41ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.06μs 0.847ns 3.05ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.65μs 0.735ns 2.65ns 0.249 0 0 1.57 KB
#6555 EnrichedLog net6.0 1.44μs 0.594ns 2.3ns 0.0229 0 0 1.64 KB
#6555 EnrichedLog netcoreapp3.1 2.13μs 1.07ns 4.01ns 0.0222 0 0 1.64 KB
#6555 EnrichedLog net472 2.71μs 0.688ns 2.58ns 0.25 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 116μs 76.3ns 285ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 119μs 109ns 379ns 0 0 0 4.28 KB
master EnrichedLog net472 150μs 94.2ns 365ns 0.679 0.226 0 4.46 KB
#6555 EnrichedLog net6.0 117μs 105ns 406ns 0.058 0 0 4.28 KB
#6555 EnrichedLog netcoreapp3.1 119μs 145ns 563ns 0.0592 0 0 4.28 KB
#6555 EnrichedLog net472 150μs 132ns 511ns 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.05μs 2.17ns 8.13ns 0.0306 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.26μs 0.929ns 3.35ns 0.0297 0 0 2.2 KB
master EnrichedLog net472 4.85μs 1.77ns 6.86ns 0.319 0 0 2.02 KB
#6555 EnrichedLog net6.0 3.05μs 1.2ns 4.49ns 0.0307 0 0 2.2 KB
#6555 EnrichedLog netcoreapp3.1 4.27μs 1.42ns 5.52ns 0.0286 0 0 2.2 KB
#6555 EnrichedLog net472 4.87μs 2.05ns 7.93ns 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.34μs 0.537ns 1.94ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.74μs 1.94ns 7.49ns 0.0156 0 0 1.14 KB
master SendReceive net472 2.14μs 1.04ns 4.03ns 0.183 0 0 1.16 KB
#6555 SendReceive net6.0 1.39μs 1.45ns 5.63ns 0.0159 0 0 1.14 KB
#6555 SendReceive netcoreapp3.1 1.76μs 0.88ns 3.41ns 0.0149 0 0 1.14 KB
#6555 SendReceive net472 2μs 4.45ns 17.2ns 0.184 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.08ns 4.19ns 0.0225 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.85μs 1.39ns 5.38ns 0.0231 0 0 1.65 KB
master EnrichedLog net472 4.47μs 2.69ns 10.4ns 0.323 0 0 2.04 KB
#6555 EnrichedLog net6.0 2.68μs 0.819ns 3.07ns 0.0229 0 0 1.6 KB
#6555 EnrichedLog netcoreapp3.1 4μs 3.45ns 13.3ns 0.0219 0 0 1.65 KB
#6555 EnrichedLog net472 4.34μs 2.52ns 9.76ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6555

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.145 393.90 451.08
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.144 547.93 626.62

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 394ns 0.68ns 2.63ns 0.00797 0 0 576 B
master StartFinishSpan netcoreapp3.1 549ns 0.822ns 3.18ns 0.00775 0 0 576 B
master StartFinishSpan net472 633ns 1.31ns 5.09ns 0.0915 0 0 578 B
master StartFinishScope net6.0 487ns 1.12ns 4.35ns 0.00976 0 0 696 B
master StartFinishScope netcoreapp3.1 698ns 1.82ns 6.8ns 0.00952 0 0 696 B
master StartFinishScope net472 827ns 1.31ns 5.08ns 0.104 0 0 658 B
#6555 StartFinishSpan net6.0 451ns 0.397ns 1.54ns 0.00806 0 0 576 B
#6555 StartFinishSpan netcoreapp3.1 626ns 0.953ns 3.57ns 0.0076 0 0 576 B
#6555 StartFinishSpan net472 628ns 1.05ns 4.07ns 0.0918 0 0 578 B
#6555 StartFinishScope net6.0 474ns 0.518ns 2.01ns 0.00979 0 0 696 B
#6555 StartFinishScope netcoreapp3.1 678ns 0.937ns 3.51ns 0.00953 0 0 696 B
#6555 StartFinishScope net472 869ns 1.45ns 5.62ns 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 694ns 0.825ns 3.2ns 0.00981 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 903ns 1.37ns 5.29ns 0.00918 0 0 696 B
master RunOnMethodBegin net472 1.04μs 1.37ns 5.3ns 0.104 0 0 658 B
#6555 RunOnMethodBegin net6.0 626ns 0.949ns 3.55ns 0.00962 0 0 696 B
#6555 RunOnMethodBegin netcoreapp3.1 913ns 0.9ns 3.49ns 0.00902 0 0 696 B
#6555 RunOnMethodBegin net472 1.09μs 2.54ns 9.83ns 0.104 0 0 658 B

@daniel-romano-DD daniel-romano-DD force-pushed the dani/iast/interpolatedstrings_flaky_fix branch from 3d2ad73 to 126c73b Compare January 29, 2025 15:54
@daniel-romano-DD daniel-romano-DD marked this pull request as ready for review January 29, 2025 16:03
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 29, 2025

Datadog Report

Branch report: dani/iast/interpolatedstrings_flaky_fix
Commit report: b28b996
Test service: dd-trace-dotnet

✅ 0 Failed, 243786 Passed, 2076 Skipped, 19h 34m 48.68s Total Time

Copy link
Member

@e-n-0 e-n-0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally a fix for this one 😄 Thanks!

@andrewlock
Copy link
Member

andrewlock commented Jan 29, 2025

Benchmarks Report for appsec 🐌

Benchmarks for #6555 compared to master:

  • All benchmarks have the same speed
  • 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 204μs 112ns 420ns 2.65 0 0 188.69 KB
master AllCycleSimpleBody netcoreapp3.1 307μs 294ns 1.1μs 2.61 0 0 196.02 KB
master AllCycleSimpleBody net472 269μs 117ns 452ns 35.8 2.04 0 225.76 KB
master AllCycleMoreComplexBody net6.0 207μs 163ns 611ns 2.67 0 0 192.19 KB
master AllCycleMoreComplexBody netcoreapp3.1 311μs 78.5ns 294ns 2.64 0 0 199.43 KB
master AllCycleMoreComplexBody net472 281μs 170ns 657ns 36.4 2.11 0 229.27 KB
master ObjectExtractorSimpleBody net6.0 140ns 0.105ns 0.395ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 197ns 0.0731ns 0.274ns 0.00378 0 0 272 B
master ObjectExtractorSimpleBody net472 175ns 0.735ns 2.85ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.91μs 7.76ns 30.1ns 0.0539 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.81μs 2.65ns 9.92ns 0.0496 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.65μs 3.14ns 12.2ns 0.603 0.0055 0 3.8 KB
#6555 AllCycleSimpleBody net6.0 202μs 85.1ns 319ns 2.63 0 0 188.69 KB
#6555 AllCycleSimpleBody netcoreapp3.1 308μs 73.9ns 277ns 2.6 0 0 196.02 KB
#6555 AllCycleSimpleBody net472 269μs 161ns 604ns 35.8 2.02 0 225.75 KB
#6555 AllCycleMoreComplexBody net6.0 209μs 97.7ns 365ns 2.62 0 0 192.19 KB
#6555 AllCycleMoreComplexBody netcoreapp3.1 312μs 128ns 478ns 2.65 0 0 199.43 KB
#6555 AllCycleMoreComplexBody net472 275μs 363ns 1.41μs 36.4 1.95 0 229.27 KB
#6555 ObjectExtractorSimpleBody net6.0 142ns 0.0893ns 0.334ns 0.0039 0 0 280 B
#6555 ObjectExtractorSimpleBody netcoreapp3.1 195ns 0.116ns 0.451ns 0.00371 0 0 272 B
#6555 ObjectExtractorSimpleBody net472 164ns 0.17ns 0.66ns 0.0446 0 0 281 B
#6555 ObjectExtractorMoreComplexBody net6.0 2.93μs 1.3ns 4.86ns 0.0541 0 0 3.78 KB
#6555 ObjectExtractorMoreComplexBody netcoreapp3.1 3.81μs 1.98ns 7.69ns 0.0494 0 0 3.69 KB
#6555 ObjectExtractorMoreComplexBody net472 3.7μs 2ns 7.74ns 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 37.8μs 18.3ns 68.4ns 0.456 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 55.6μs 12.7ns 49ns 0.442 0 0 32.4 KB
master EncodeArgs net472 67μs 38.6ns 144ns 5.16 0.0675 0 32.5 KB
master EncodeLegacyArgs net6.0 72.8μs 34.1ns 123ns 0.0403 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 103μs 96.9ns 375ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 152μs 35.2ns 136ns 0.304 0 0 2.15 KB
#6555 EncodeArgs net6.0 39.5μs 18.6ns 72ns 0.454 0 0 32.4 KB
#6555 EncodeArgs netcoreapp3.1 54μs 28.3ns 110ns 0.432 0 0 32.4 KB
#6555 EncodeArgs net472 66.8μs 88ns 341ns 5.15 0.0664 0 32.5 KB
#6555 EncodeLegacyArgs net6.0 78.9μs 21.8ns 81.5ns 0 0 0 2.14 KB
#6555 EncodeLegacyArgs netcoreapp3.1 107μs 316ns 1.22μs 0 0 0 2.14 KB
#6555 EncodeLegacyArgs net472 153μs 107ns 415ns 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 176μs 292ns 1.13μs 0 0 0 2.54 KB
master RunWafRealisticBenchmark netcoreapp3.1 187μs 332ns 1.24μs 0 0 0 2.49 KB
master RunWafRealisticBenchmark net472 202μs 141ns 545ns 0.397 0 0 2.55 KB
master RunWafRealisticBenchmarkWithAttack net6.0 120μs 32.7ns 127ns 0 0 0 1.57 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 175ns 677ns 0 0 0 1.55 KB
master RunWafRealisticBenchmarkWithAttack net472 132μs 41.3ns 155ns 0.198 0 0 1.58 KB
#6555 RunWafRealisticBenchmark net6.0 176μs 68ns 263ns 0 0 0 2.54 KB
#6555 RunWafRealisticBenchmark netcoreapp3.1 188μs 410ns 1.59μs 0 0 0 2.49 KB
#6555 RunWafRealisticBenchmark net472 200μs 76.2ns 285ns 0.402 0 0 2.55 KB
#6555 RunWafRealisticBenchmarkWithAttack net6.0 115μs 42.1ns 152ns 0 0 0 1.57 KB
#6555 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 124μs 178ns 690ns 0 0 0 1.55 KB
#6555 RunWafRealisticBenchmarkWithAttack net472 132μs 47.7ns 185ns 0.198 0 0 1.58 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6555

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 254.7 KB 266.09 KB 11.38 KB 4.47%

Fewer allocations 🎉 in #6555

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 262.55 KB 252.89 KB -9.66 KB -3.68%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 61.9 KB 59.43 KB -2.47 KB -3.99%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 52.9μs 248ns 1.24μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 59.5μs 754ns 7.31μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.4μs 152ns 527ns 0 0 0 61.9 KB
master StringConcatAspectBenchmark net6.0 302μs 5.51μs 54.8μs 0 0 0 254.7 KB
master StringConcatAspectBenchmark netcoreapp3.1 348μs 1.95μs 12.3μs 0 0 0 262.55 KB
master StringConcatAspectBenchmark net472 293μs 5.78μs 56.6μs 0 0 0 278.53 KB
#6555 StringConcatBenchmark net6.0 60.2μs 740ns 7.32μs 0 0 0 43.44 KB
#6555 StringConcatBenchmark netcoreapp3.1 54.4μs 269ns 1.07μs 0 0 0 42.64 KB
#6555 StringConcatBenchmark net472 37.8μs 166ns 620ns 0 0 0 59.43 KB
#6555 StringConcatAspectBenchmark net6.0 315μs 1.7μs 10.5μs 0 0 0 266.09 KB
#6555 StringConcatAspectBenchmark netcoreapp3.1 317μs 5.07μs 50μs 0 0 0 252.89 KB
#6555 StringConcatAspectBenchmark net472 295μs 6.55μs 64.5μs 0 0 0 278.53 KB

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

1 occurrences of :

-            "value": "'3','32.38','Vins et alcools Chevalier','John',",
+            "value": "'3','32','Vins et alcools Chevalier','John',",
[...]
-            "value": "'Reims','51100','France')",
-            "source": 0
-          },
-          {
-            "value": ";\nSELECT OrderID FROM Orders ORDER BY OrderID DESC LIMIT 1;"
+            "value": "'Reims','51100','France');\nSELECT OrderID FROM Orders ORDER BY OrderID DESC LIMIT 1;"

@e-n-0 e-n-0 force-pushed the dani/iast/interpolatedstrings_flaky_fix branch from 439ee01 to b28b996 Compare January 30, 2025 17:00
@e-n-0 e-n-0 merged commit 43d174b into master Jan 31, 2025
137 of 140 checks passed
@e-n-0 e-n-0 deleted the dani/iast/interpolatedstrings_flaky_fix branch January 31, 2025 09:07
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm-iast area:tests unit tests, integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants