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] DecompileDelegate lib bugfix #4554

Merged
merged 6 commits into from
Aug 29, 2023

Conversation

daniel-romano-DD
Copy link
Contributor

Summary of changes

Added the capability to exclude methods from Dataflow based on their decoration attributes

Reason for change

A nasty bug found on SpotFreight client, while making a LINQ to Entities query. It crashed with an "unsupported exception" because we replaced the system Concat function with out own aspect.

Implementation details

The solution consist in ignoring the methods (or properties) decorated with the DelegateDecompiler.ComputedAttribute attribute, so the DelegateDecompiler library does not crash.

Test coverage

Added a test case reproducing the bug

Other details

@andrewlock
Copy link
Member

andrewlock commented Aug 25, 2023

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 (4554) - mean (70ms)  : 63, 77
     .   : milestone, 70,
    master - mean (73ms)  : 58, 88
     .   : milestone, 73,

    section CallTarget+Inlining+NGEN
    This PR (4554) - mean (1,040ms)  : 1013, 1066
     .   : milestone, 1040,
    master - mean (1,036ms)  : 1014, 1059
     .   : milestone, 1036,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4554) - mean (107ms)  : 100, 113
     .   : milestone, 107,
    master - mean (105ms)  : 100, 109
     .   : milestone, 105,

    section CallTarget+Inlining+NGEN
    This PR (4554) - mean (729ms)  : 711, 747
     .   : milestone, 729,
    master - mean (731ms)  : 689, 773
     .   : milestone, 731,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4554) - mean (90ms)  : 85, 96
     .   : milestone, 90,
    master - mean (88ms)  : 84, 91
     .   : milestone, 88,

    section CallTarget+Inlining+NGEN
    This PR (4554) - mean (695ms)  : 671, 719
     .   : milestone, 695,
    master - mean (686ms)  : 660, 712
     .   : milestone, 686,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4554) - mean (191ms)  : 183, 198
     .   : milestone, 191,
    master - mean (190ms)  : 184, 196
     .   : milestone, 190,

    section CallTarget+Inlining+NGEN
    This PR (4554) - mean (1,132ms)  : 1097, 1168
     .   : milestone, 1132,
    master - mean (1,116ms)  : 1076, 1157
     .   : milestone, 1116,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4554) - mean (274ms)  : 266, 282
     .   : milestone, 274,
    master - mean (273ms)  : 267, 279
     .   : milestone, 273,

    section CallTarget+Inlining+NGEN
    This PR (4554) - mean (1,088ms)  : 1063, 1113
     .   : milestone, 1088,
    master - mean (1,092ms)  : 1057, 1127
     .   : milestone, 1092,

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

    section CallTarget+Inlining+NGEN
    This PR (4554) - mean (1,048ms)  : 1014, 1083
     .   : milestone, 1048,
    master - mean (1,043ms)  : 1003, 1084
     .   : milestone, 1043,

Loading

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Aug 25, 2023

Datadog Report

Branch report: dani/asm/decompile_delegate_bug
Commit report: 8a6bab0

dd-trace-dotnet: 0 Failed, 0 New Flaky, 302125 Passed, 1401 Skipped, 21m 38.85s Wall Time

@andrewlock
Copy link
Member

andrewlock commented Aug 25, 2023

Benchmarks Report 🐌

Benchmarks for #4554 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.164
  • 2 benchmarks are slower, with geometric mean 1.146
  • 1 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.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.08μs 45.9ns 334ns 0.0314 0.0157 0 7.3 KB
master StartStopWithChild netcoreapp3.1 10.3μs 55.6ns 324ns 0.0309 0.0154 0 7.4 KB
master StartStopWithChild net472 15.6μs 51.4ns 192ns 1.3 0.316 0.0925 7.67 KB
#4554 StartStopWithChild net6.0 8.37μs 42ns 192ns 0.0213 0.00851 0 7.3 KB
#4554 StartStopWithChild netcoreapp3.1 10.1μs 53.4ns 267ns 0.0243 0.0097 0 7.4 KB
#4554 StartStopWithChild net472 15.9μs 52.3ns 203ns 1.28 0.313 0.109 7.66 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 482μs 259ns 1μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 627μs 229ns 827ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 813μs 398ns 1.49μs 0.406 0 0 3.3 KB
#4554 WriteAndFlushEnrichedTraces net6.0 486μs 133ns 478ns 0 0 0 2.7 KB
#4554 WriteAndFlushEnrichedTraces netcoreapp3.1 637μs 423ns 1.64μs 0 0 0 2.7 KB
#4554 WriteAndFlushEnrichedTraces net472 808μs 372ns 1.44μs 0.401 0 0 3.3 KB
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 39μs 16.7ns 64.5ns 0.0195 0 0 1.69 KB
master AllCycleSimpleBody netcoreapp3.1 40.8μs 66.5ns 240ns 0.0202 0 0 1.67 KB
master AllCycleSimpleBody net472 43.3μs 94.9ns 342ns 0.255 0 0 1.73 KB
master AllCycleMoreComplexBody net6.0 229μs 194ns 698ns 0.114 0 0 9.26 KB
master AllCycleMoreComplexBody netcoreapp3.1 241μs 718ns 2.49μs 0 0 0 9.16 KB
master AllCycleMoreComplexBody net472 249μs 68.3ns 236ns 1.41 0 0 9.33 KB
master ObjectExtractorSimpleBody net6.0 121ns 0.0612ns 0.229ns 0.00392 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 173ns 0.268ns 1.04ns 0.00373 0 0 272 B
master ObjectExtractorSimpleBody net472 146ns 0.102ns 0.383ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.01μs 1.17ns 4.36ns 0.0543 0 0 3.88 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.06μs 0.923ns 3.58ns 0.0508 0 0 3.78 KB
master ObjectExtractorMoreComplexBody net472 4.14μs 3.21ns 12.4ns 0.618 0.00618 0 3.89 KB
#4554 AllCycleSimpleBody net6.0 38.8μs 11.6ns 43.6ns 0.0193 0 0 1.69 KB
#4554 AllCycleSimpleBody netcoreapp3.1 41.2μs 20.2ns 72.8ns 0.0204 0 0 1.67 KB
#4554 AllCycleSimpleBody net472 42.8μs 67.1ns 260ns 0.274 0 0 1.73 KB
#4554 AllCycleMoreComplexBody net6.0 231μs 77.1ns 289ns 0.116 0 0 9.26 KB
#4554 AllCycleMoreComplexBody netcoreapp3.1 239μs 129ns 501ns 0.12 0 0 9.16 KB
#4554 AllCycleMoreComplexBody net472 248μs 121ns 419ns 1.48 0 0 9.33 KB
#4554 ObjectExtractorSimpleBody net6.0 123ns 0.091ns 0.352ns 0.00396 0 0 280 B
#4554 ObjectExtractorSimpleBody netcoreapp3.1 172ns 0.169ns 0.632ns 0.0037 0 0 272 B
#4554 ObjectExtractorSimpleBody net472 148ns 0.349ns 1.35ns 0.0446 0 0 281 B
#4554 ObjectExtractorMoreComplexBody net6.0 3.01μs 0.835ns 3.12ns 0.0542 0 0 3.88 KB
#4554 ObjectExtractorMoreComplexBody netcoreapp3.1 4.12μs 1.32ns 4.77ns 0.0515 0 0 3.78 KB
#4554 ObjectExtractorMoreComplexBody net472 4.15μs 6.29ns 24.4ns 0.617 0.00621 0 3.89 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 RunWaf(args=NestedMap (10)) net6.0 129μs 1.79μs 17.9μs 0 0 0 17.62 KB
master RunWaf(args=NestedMap (10)) netcoreapp3.1 135μs 1.34μs 12.7μs 0 0 0 16.79 KB
master RunWaf(args=NestedMap (10)) net472 129μs 353ns 1.27μs 0 0 0 24.58 KB
master RunWaf(args=NestedMap (100)) net6.0 238μs 1.38μs 12μs 0 0 0 37.95 KB
master RunWaf(args=NestedMap (100)) netcoreapp3.1 257μs 1.4μs 7.78μs 0 0 0 37.78 KB
master RunWaf(args=NestedMap (100)) net472 252μs 972ns 3.5μs 0 0 0 40.96 KB
master RunWaf(args=NestedMap (1000)) net6.0 230μs 1.25μs 7.5μs 0 0 0 37.95 KB
master RunWaf(args=NestedMap (1000)) netcoreapp3.1 265μs 1.42μs 7.4μs 0 0 0 37.78 KB
master RunWaf(args=NestedMap (1000)) net472 260μs 1.26μs 5.21μs 0 0 0 40.96 KB
#4554 RunWaf(args=NestedMap (10)) net6.0 119μs 828ns 7.81μs 0 0 0 17.62 KB
#4554 RunWaf(args=NestedMap (10)) netcoreapp3.1 138μs 1.37μs 13μs 0 0 0 16.79 KB
#4554 RunWaf(args=NestedMap (10)) net472 127μs 487ns 1.82μs 0 0 0 24.58 KB
#4554 RunWaf(args=NestedMap (100)) net6.0 240μs 1.38μs 10.4μs 0 0 0 37.95 KB
#4554 RunWaf(args=NestedMap (100)) netcoreapp3.1 262μs 1.48μs 9.85μs 0 0 0 37.78 KB
#4554 RunWaf(args=NestedMap (100)) net472 254μs 1.3μs 5.8μs 0 0 0 40.96 KB
#4554 RunWaf(args=NestedMap (1000)) net6.0 233μs 908ns 3.28μs 0 0 0 37.95 KB
#4554 RunWaf(args=NestedMap (1000)) netcoreapp3.1 262μs 1.24μs 6.31μs 0 0 0 37.78 KB
#4554 RunWaf(args=NestedMap (1000)) net472 261μs 1.3μs 5.67μs 0 0 0 40.96 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 147ns 570ns 0.256 0 0 18.09 KB
master SendRequest netcoreapp3.1 191μs 334ns 1.29μs 0.19 0 0 20.25 KB
master SendRequest net472 0.000142ns 0.000142ns 0.00053ns 0 0 0 0 b
#4554 SendRequest net6.0 170μs 107ns 385ns 0.169 0 0 18.09 KB
#4554 SendRequest netcoreapp3.1 189μs 297ns 1.07μs 0.19 0 0 20.25 KB
#4554 SendRequest net472 0.00182ns 0.000405ns 0.00152ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #4554

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.56 KB 41.89 KB 331 B 0.80%

Fewer allocations 🎉 in #4554

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.72 KB 41.39 KB -327 B -0.78%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 538μs 1.19μs 4.43μs 0.534 0 0 41.72 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 612μs 1.1μs 4.28μs 0.303 0 0 41.56 KB
master WriteAndFlushEnrichedTraces net472 795μs 2.65μs 10.3μs 8.25 2.36 0.393 53.24 KB
#4554 WriteAndFlushEnrichedTraces net6.0 498μs 965ns 3.74μs 0.506 0 0 41.39 KB
#4554 WriteAndFlushEnrichedTraces netcoreapp3.1 630μs 822ns 3.07μs 0.317 0 0 41.89 KB
#4554 WriteAndFlushEnrichedTraces net472 797μs 3.11μs 11.7μs 8.25 2.36 0.393 53.24 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.15μs 0.464ns 1.8ns 0.0109 0 0 768 B
master ExecuteNonQuery netcoreapp3.1 1.36μs 0.736ns 2.75ns 0.0104 0 0 768 B
master ExecuteNonQuery net472 1.65μs 0.431ns 1.67ns 0.116 0 0 730 B
#4554 ExecuteNonQuery net6.0 1.09μs 0.477ns 1.79ns 0.0105 0 0 768 B
#4554 ExecuteNonQuery netcoreapp3.1 1.39μs 0.773ns 2.99ns 0.0104 0 0 768 B
#4554 ExecuteNonQuery net472 1.6μs 0.228ns 0.822ns 0.116 0 0 730 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.22μs 0.65ns 2.34ns 0.0141 0 0 992 B
master CallElasticsearch netcoreapp3.1 1.42μs 1.29ns 4.98ns 0.0135 0 0 992 B
master CallElasticsearch net472 2.37μs 0.601ns 2.33ns 0.158 0.00118 0 1 KB
master CallElasticsearchAsync net6.0 1.34μs 0.603ns 2.26ns 0.0135 0 0 968 B
master CallElasticsearchAsync netcoreapp3.1 1.63μs 0.565ns 2.11ns 0.0141 0 0 1.04 KB
master CallElasticsearchAsync net472 2.61μs 0.823ns 3.19ns 0.168 0.0013 0 1.06 KB
#4554 CallElasticsearch net6.0 1.27μs 0.641ns 2.48ns 0.0141 0 0 992 B
#4554 CallElasticsearch netcoreapp3.1 1.5μs 0.496ns 1.85ns 0.0136 0 0 992 B
#4554 CallElasticsearch net472 2.43μs 0.944ns 3.53ns 0.159 0.00122 0 1 KB
#4554 CallElasticsearchAsync net6.0 1.44μs 0.822ns 3.18ns 0.0136 0 0 968 B
#4554 CallElasticsearchAsync netcoreapp3.1 1.64μs 0.545ns 2.11ns 0.014 0 0 1.04 KB
#4554 CallElasticsearchAsync net472 2.45μs 2.54ns 9.17ns 0.168 0.00122 0 1.06 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 1.25ns 4.84ns 0.0129 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.54μs 0.523ns 1.96ns 0.0122 0 0 912 B
master ExecuteAsync net472 1.64μs 0.637ns 2.38ns 0.138 0 0 875 B
#4554 ExecuteAsync net6.0 1.31μs 0.693ns 2.59ns 0.0123 0 0 912 B
#4554 ExecuteAsync netcoreapp3.1 1.43μs 0.711ns 2.75ns 0.0121 0 0 912 B
#4554 ExecuteAsync net472 1.78μs 0.782ns 3.03ns 0.138 0.000892 0 875 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 3.81μs 1.58ns 6.12ns 0.0266 0 0 1.94 KB
master SendAsync netcoreapp3.1 4.49μs 6.8ns 26.3ns 0.0332 0 0 2.48 KB
master SendAsync net472 7.17μs 4.31ns 16.7ns 0.483 0 0 3.05 KB
#4554 SendAsync net6.0 3.89μs 1.9ns 6.86ns 0.0272 0 0 1.94 KB
#4554 SendAsync netcoreapp3.1 4.44μs 2.7ns 10.1ns 0.0333 0 0 2.48 KB
#4554 SendAsync net472 7.24μs 2.75ns 10.7ns 0.483 0 0 3.05 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.34μs 0.851ns 3.18ns 0.0228 0 0 1.62 KB
master EnrichedLog netcoreapp3.1 1.87μs 0.768ns 2.97ns 0.022 0 0 1.62 KB
master EnrichedLog net472 2.22μs 2.44ns 9.13ns 0.244 0 0 1.54 KB
#4554 EnrichedLog net6.0 1.36μs 0.632ns 2.36ns 0.0226 0 0 1.62 KB
#4554 EnrichedLog netcoreapp3.1 1.87μs 1.21ns 4.67ns 0.0225 0 0 1.62 KB
#4554 EnrichedLog net472 2.29μs 0.512ns 1.77ns 0.244 0 0 1.54 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 167ns 645ns 0.0564 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 120μs 189ns 733ns 0.0595 0 0 4.21 KB
master EnrichedLog net472 150μs 117ns 404ns 0.675 0.225 0 4.38 KB
#4554 EnrichedLog net6.0 112μs 110ns 426ns 0.0563 0 0 4.21 KB
#4554 EnrichedLog netcoreapp3.1 120μs 127ns 492ns 0 0 0 4.21 KB
#4554 EnrichedLog net472 148μs 212ns 822ns 0.665 0.222 0 4.38 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.85μs 0.755ns 2.92ns 0.03 0 0 2.18 KB
master EnrichedLog netcoreapp3.1 3.81μs 1.37ns 5.29ns 0.0286 0 0 2.18 KB
master EnrichedLog net472 4.59μs 1.46ns 5.66ns 0.314 0 0 1.99 KB
#4554 EnrichedLog net6.0 2.84μs 0.866ns 3.24ns 0.0309 0 0 2.18 KB
#4554 EnrichedLog netcoreapp3.1 3.85μs 1.02ns 3.94ns 0.0288 0 0 2.18 KB
#4554 EnrichedLog net472 4.54μs 1.17ns 4.37ns 0.314 0 0 1.99 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.29μs 0.596ns 2.31ns 0.0162 0 0 1.16 KB
master SendReceive netcoreapp3.1 1.66μs 0.629ns 2.35ns 0.0157 0 0 1.16 KB
master SendReceive net472 2.14μs 2.26ns 8.77ns 0.184 0.00107 0 1.16 KB
#4554 SendReceive net6.0 1.28μs 0.65ns 2.43ns 0.0166 0 0 1.16 KB
#4554 SendReceive netcoreapp3.1 1.61μs 0.619ns 2.32ns 0.0154 0 0 1.16 KB
#4554 SendReceive net472 2.05μs 1.48ns 5.74ns 0.185 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.61μs 0.712ns 2.66ns 0.021 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.71μs 1.2ns 4.31ns 0.0204 0 0 1.58 KB
master EnrichedLog net472 3.94μs 1.76ns 6.58ns 0.311 0 0 1.96 KB
#4554 EnrichedLog net6.0 2.56μs 0.871ns 3.37ns 0.0205 0 0 1.53 KB
#4554 EnrichedLog netcoreapp3.1 3.8μs 1.03ns 3.86ns 0.021 0 0 1.58 KB
#4554 EnrichedLog net472 4.02μs 1.14ns 4.1ns 0.31 0 0 1.96 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4554

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.174 451.85 530.48
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 1.119 678.44 759.27

Faster 🎉 in #4554

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.164 603.02 518.22

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 452ns 0.181ns 0.678ns 0.00757 0 0 536 B
master StartFinishSpan netcoreapp3.1 603ns 0.313ns 1.17ns 0.00723 0 0 536 B
master StartFinishSpan net472 651ns 0.419ns 1.62ns 0.0853 0 0 538 B
master StartFinishScope net6.0 536ns 0.135ns 0.503ns 0.00903 0 0 656 B
master StartFinishScope netcoreapp3.1 678ns 0.357ns 1.38ns 0.00894 0 0 656 B
master StartFinishScope net472 854ns 0.368ns 1.43ns 0.0981 0 0 618 B
#4554 StartFinishSpan net6.0 530ns 0.131ns 0.492ns 0.00734 0 0 536 B
#4554 StartFinishSpan netcoreapp3.1 518ns 0.162ns 0.606ns 0.00728 0 0 536 B
#4554 StartFinishSpan net472 599ns 0.479ns 1.85ns 0.0852 0 0 538 B
#4554 StartFinishScope net6.0 563ns 0.294ns 1.14ns 0.00908 0 0 656 B
#4554 StartFinishScope netcoreapp3.1 759ns 0.816ns 3.05ns 0.00874 0 0 656 B
#4554 StartFinishScope net472 870ns 0.707ns 2.74ns 0.0979 0 0 618 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 573ns 0.411ns 1.59ns 0.00917 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 811ns 0.311ns 1.16ns 0.00904 0 0 656 B
master RunOnMethodBegin net472 1.01μs 0.516ns 2ns 0.0979 0 0 618 B
#4554 RunOnMethodBegin net6.0 582ns 0.12ns 0.465ns 0.00915 0 0 656 B
#4554 RunOnMethodBegin netcoreapp3.1 767ns 0.233ns 0.901ns 0.00886 0 0 656 B
#4554 RunOnMethodBegin net472 990ns 0.249ns 0.932ns 0.0982 0 0 618 B

@andrewlock
Copy link
Member

andrewlock commented Aug 28, 2023

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 (4554) (11.323M)   : 0, 11322820
    master (11.781M)   : 0, 11780743
    benchmarks/2.36.0 (11.382M)   : 0, 11382084
    benchmarks/2.9.0 (11.174M)   : 0, 11173638

    section Automatic
    This PR (4554) (7.937M)   : 0, 7937221
    master (8.225M)   : 0, 8224850
    benchmarks/2.36.0 (7.895M)   : 0, 7895036
    benchmarks/2.9.0 (8.231M)   : 0, 8230767

    section Trace stats
    master (7.967M)   : 0, 7966905
    benchmarks/2.36.0 (7.934M)   : 0, 7934498

    section Manual
    This PR (4554) (10.096M)   : 0, 10095685
    master (10.159M)   : 0, 10159061
    benchmarks/2.36.0 (10.135M)   : 0, 10135365

    section Manual + Automatic
    This PR (4554) (7.634M)   : 0, 7633576
    master (7.692M)   : 0, 7691807
    benchmarks/2.36.0 (7.687M)   : 0, 7686860

    section Version Conflict
    master (6.922M)   : 0, 6922354
    benchmarks/2.36.0 (6.950M)   : 0, 6950075

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4554) (9.481M)   : 0, 9481018
    master (9.519M)   : 0, 9518509
    benchmarks/2.36.0 (9.679M)   : 0, 9678578
    benchmarks/2.9.0 (9.598M)   : 0, 9597680

    section Automatic
    This PR (4554) (6.776M)   : 0, 6775754
    master (6.882M)   : 0, 6882197
    benchmarks/2.36.0 (6.765M)   : 0, 6764548

    section Trace stats
    master (6.674M)   : 0, 6674489
    benchmarks/2.36.0 (6.684M)   : 0, 6684198

    section Manual
    This PR (4554) (8.499M)   : 0, 8499033
    master (8.473M)   : 0, 8473261
    benchmarks/2.36.0 (8.556M)   : 0, 8555932

    section Manual + Automatic
    This PR (4554) (6.493M)   : 0, 6492756
    master (6.450M)   : 0, 6450446
    benchmarks/2.36.0 (6.546M)   : 0, 6545995

    section Version Conflict
    master (5.974M)   : 0, 5973609
    benchmarks/2.36.0 (5.717M)   : 0, 5717018

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4554) (10.053M)   : 0, 10053284
    master (10.380M)   : 0, 10380352
    benchmarks/2.36.0 (10.614M)   : 0, 10613686
    benchmarks/2.9.0 (10.703M)   : 0, 10703397

    section Automatic
    This PR (4554) (7.360M)   : 0, 7360198
    master (7.481M)   : 0, 7481240
    benchmarks/2.36.0 (7.670M)   : 0, 7670031
    benchmarks/2.9.0 (7.805M)   : 0, 7805318

    section Trace stats
    master (7.547M)   : 0, 7547055
    benchmarks/2.36.0 (7.600M)   : 0, 7600232

    section Manual
    This PR (4554) (9.135M)   : 0, 9135486
    master (9.416M)   : 0, 9416423
    benchmarks/2.36.0 (9.431M)   : 0, 9431272

    section Manual + Automatic
    This PR (4554) (7.078M)   : 0, 7078071
    master (7.369M)   : 0, 7368642
    benchmarks/2.36.0 (7.296M)   : 0, 7296323

    section Version Conflict
    master (6.664M)   : 0, 6663909
    benchmarks/2.36.0 (6.914M)   : 0, 6914150

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4554) (7.381M)   : 0, 7381379
    master (7.428M)   : 0, 7427633
    benchmarks/2.36.0 (7.399M)   : 0, 7398988
    benchmarks/2.9.0 (7.797M)   : 0, 7797019

    section No attack
    This PR (4554) (2.121M)   : 0, 2121273
    master (2.128M)   : 0, 2127733
    benchmarks/2.36.0 (2.133M)   : 0, 2133428
    benchmarks/2.9.0 (3.234M)   : 0, 3234355

    section Attack
    This PR (4554) (1.670M)   : 0, 1669932
    master (1.684M)   : 0, 1684069
    benchmarks/2.36.0 (1.660M)   : 0, 1660412
    benchmarks/2.9.0 (2.471M)   : 0, 2471012

    section Blocking
    This PR (4554) (3.121M)   : 0, 3121059
    master (3.094M)   : 0, 3094326
    benchmarks/2.36.0 (3.090M)   : 0, 3090340

Loading

@@ -526,4 +559,30 @@ namespace iast
_nMethodIL = 0;
DEL_ARR(_pMethodIL);
}

bool MethodInfo::IsPropertyAccessor()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the computed attribute be used in methods other than property accessors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. And the getter is a method anyways...

Comment on lines 64 to 68
//var data = (db as ApplicationDbContext).Books.Decompile().Where(x => x.FullTitle != "eeef").ToList();
if (any)
{

}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//var data = (db as ApplicationDbContext).Books.Decompile().Where(x => x.FullTitle != "eeef").ToList();
if (any)
{
}
any.Should().Be(true);

I would check in the test that we still can read from the DDBB.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8a6bab0

Copy link
Contributor

@NachoEchevarria NachoEchevarria left a comment

Choose a reason for hiding this comment

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

LGTM!

@daniel-romano-DD daniel-romano-DD marked this pull request as ready for review August 29, 2023 07:56
@daniel-romano-DD daniel-romano-DD requested a review from a team as a code owner August 29, 2023 07:56
var books = (db as ApplicationDbContext).Books;
var decompiled = books.Decompile();
var any = decompiled.Any(x => x.FullTitle != ft);
//var data = (db as ApplicationDbContext).Books.Decompile().Where(x => x.FullTitle != "eeef").ToList();
Copy link
Member

Choose a reason for hiding this comment

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

I would remove the commented code, or at least explain why it's there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8a6bab0

[DelegateDecompiler.Computed]
public string FullTitle
{
// [DelegateDecompiler.Computed]
Copy link
Member

Choose a reason for hiding this comment

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

Can the attribute be applied here? If so I would add another test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a test, but DecompileDelegate does not support it

Copy link
Member

@robertpi robertpi left a comment

Choose a reason for hiding this comment

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

Couple of minor comments, can be taken into account later if you want to merge as is.

@daniel-romano-DD daniel-romano-DD changed the title Dani/asm/decompile delegate bug [ASM] [BUG] DecompileDelegate lib bug Aug 29, 2023
@daniel-romano-DD daniel-romano-DD changed the title [ASM] [BUG] DecompileDelegate lib bug [ASM] DecompileDelegate lib bug Aug 29, 2023
@daniel-romano-DD daniel-romano-DD changed the title [ASM] DecompileDelegate lib bug [ASM] DecompileDelegate lib bugfix Aug 29, 2023
@daniel-romano-DD daniel-romano-DD merged commit 3c8a407 into master Aug 29, 2023
@daniel-romano-DD daniel-romano-DD deleted the dani/asm/decompile_delegate_bug branch August 29, 2023 12:21
@github-actions github-actions bot added this to the vNext milestone Aug 29, 2023
NachoEchevarria pushed a commit that referenced this pull request Aug 29, 2023
* Initial flawed fix

* Working fix

* Minor improvement

* Linux compilation fix

* Added more tests
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