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

[Dynamic Instrumentation] DEBUG-2524 Fix EL numeric binary operations #5815

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

dudikeleti
Copy link
Contributor

Summary of changes

This PR fix the process of comparison different numeric types

Test coverage

Updated EL tests & system tests

@dudikeleti dudikeleti requested a review from a team as a code owner July 26, 2024 14:36
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jul 26, 2024

Datadog Report

Branch report: dudik/el-compare-numeric-types
Commit report: 161cc06
Test service: dd-trace-dotnet

❌ 26 Failed (0 Known Flaky), 351252 Passed, 2244 Skipped, 23h 23m 41.78s Total Time
⌛ 1 Performance Regression

❌ Failed Tests (26)

This report shows up to 5 failed tests.

  • MethodProbeTest - Datadog.Trace.Debugger.IntegrationTests.ProbesTests - Details

    Expand for error
     Snapshot count not found. Expected 1, actual 0
    
  • MethodProbeTest - Datadog.Trace.Debugger.IntegrationTests.ProbesTests - Details

    Expand for error
     Snapshot count not found. Expected 1, actual 0
    
  • MethodProbeTest - Datadog.Trace.Debugger.IntegrationTests.ProbesTests - Details

    Expand for error
     Snapshot count not found. Expected 1, actual 0
    
  • MethodProbeTest - Datadog.Trace.Debugger.IntegrationTests.ProbesTests - Details

    Expand for error
     Snapshot count not found. Expected 1, actual 0
    
  • MethodProbeTest - Datadog.Trace.Debugger.IntegrationTests.ProbesTests - Details

    Expand for error
     Snapshot count not found. Expected 1, actual 0
    

⌛ Performance Regressions vs Default Branch (1)

  • Profiler_liveheap - scenarios 4.52s (+225.45ms, +5%) - Details

@andrewlock
Copy link
Member

andrewlock commented Jul 26, 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 (5815) - mean (69ms)  : 67, 72
     .   : milestone, 69,
    master - mean (72ms)  : 63, 81
     .   : milestone, 72,

    section CallTarget+Inlining+NGEN
    This PR (5815) - mean (1,072ms)  : 1037, 1106
     .   : milestone, 1072,
    master - mean (1,067ms)  : 1046, 1087
     .   : milestone, 1067,

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

    section CallTarget+Inlining+NGEN
    This PR (5815) - mean (754ms)  : 725, 784
     .   : milestone, 754,
    master - mean (756ms)  : 727, 786
     .   : milestone, 756,

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

    section CallTarget+Inlining+NGEN
    This PR (5815) - mean (703ms)  : 684, 723
     .   : milestone, 703,
    master - mean (704ms)  : 681, 728
     .   : milestone, 704,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5815) - mean (193ms)  : 189, 197
     .   : milestone, 193,
    master - mean (192ms)  : 189, 195
     .   : milestone, 192,

    section CallTarget+Inlining+NGEN
    This PR (5815) - mean (1,169ms)  : 1139, 1199
     .   : milestone, 1169,
    master - mean (1,167ms)  : 1141, 1193
     .   : milestone, 1167,

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

    section CallTarget+Inlining+NGEN
    This PR (5815) - mean (924ms)  : 902, 946
     .   : milestone, 924,
    master - mean (922ms)  : 903, 941
     .   : milestone, 922,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5815) - mean (266ms)  : 263, 270
     .   : milestone, 266,
    master - mean (266ms)  : 262, 270
     .   : milestone, 266,

    section CallTarget+Inlining+NGEN
    This PR (5815) - mean (912ms)  : 881, 944
     .   : milestone, 912,
    master - mean (908ms)  : 886, 929
     .   : milestone, 908,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jul 26, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5815 compared to master:

  • 3 benchmarks are faster, with geometric mean 1.235
  • 1 benchmarks are slower, with geometric mean 1.119
  • 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.64μs 42.5ns 272ns 0.0161 0.00803 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.76μs 55.6ns 412ns 0.014 0.00468 0 5.62 KB
master StartStopWithChild net472 16.1μs 52.8ns 204ns 1.02 0.307 0.0939 6.07 KB
#5815 StartStopWithChild net6.0 7.69μs 43.5ns 285ns 0.0155 0.00773 0 5.43 KB
#5815 StartStopWithChild netcoreapp3.1 9.58μs 54.2ns 387ns 0.014 0.00468 0 5.62 KB
#5815 StartStopWithChild net472 16.1μs 53.7ns 208ns 1 0.29 0.0783 6.05 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 472μs 475ns 1.78μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 630μs 567ns 2.12μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 830μs 756ns 2.73μs 0.417 0 0 3.3 KB
#5815 WriteAndFlushEnrichedTraces net6.0 462μs 738ns 2.66μs 0 0 0 2.7 KB
#5815 WriteAndFlushEnrichedTraces netcoreapp3.1 630μs 424ns 1.64μs 0 0 0 2.7 KB
#5815 WriteAndFlushEnrichedTraces net472 826μs 798ns 3.09μ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 211μs 1.64μs 16.2μs 0.223 0 0 18.45 KB
master SendRequest netcoreapp3.1 245μs 2.12μs 21μs 0.25 0 0 20.61 KB
master SendRequest net472 0.000939ns 0.000576ns 0.00223ns 0 0 0 0 b
#5815 SendRequest net6.0 238μs 2.17μs 21.7μs 0.212 0 0 18.46 KB
#5815 SendRequest netcoreapp3.1 219μs 1.2μs 9.84μs 0.226 0 0 20.61 KB
#5815 SendRequest net472 0.00535ns 0.00147ns 0.0057ns 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 584μs 3.38μs 27.9μs 0.306 0 0 41.65 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 684μs 3.5μs 16μs 0.343 0 0 41.78 KB
master WriteAndFlushEnrichedTraces net472 898μs 4.29μs 18.2μs 8.68 2.6 0.434 53.34 KB
#5815 WriteAndFlushEnrichedTraces net6.0 584μs 3.23μs 22.4μs 0.584 0 0 41.65 KB
#5815 WriteAndFlushEnrichedTraces netcoreapp3.1 693μs 3.2μs 16.3μs 0.345 0 0 41.84 KB
#5815 WriteAndFlushEnrichedTraces net472 889μs 3.74μs 14.5μs 8.19 2.59 0.431 53.28 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.25μs 2.35ns 9.09ns 0.0143 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.82μs 1.51ns 5.65ns 0.0138 0 0 1.02 KB
master ExecuteNonQuery net472 2.1μs 2.31ns 8.64ns 0.157 0 0 987 B
#5815 ExecuteNonQuery net6.0 1.32μs 1.49ns 5.77ns 0.0144 0 0 1.02 KB
#5815 ExecuteNonQuery netcoreapp3.1 1.73μs 2.19ns 8.47ns 0.0138 0 0 1.02 KB
#5815 ExecuteNonQuery net472 2.02μs 2.05ns 7.96ns 0.157 0 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.2μs 0.681ns 2.64ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.51μs 0.507ns 1.96ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.46μs 1.81ns 7.03ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.24μs 1.12ns 4.19ns 0.013 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.66μs 3.17ns 12.3ns 0.0141 0 0 1.02 KB
master CallElasticsearchAsync net472 2.65μs 1.32ns 5.11ns 0.166 0 0 1.05 KB
#5815 CallElasticsearch net6.0 1.11μs 0.589ns 2.28ns 0.0135 0 0 976 B
#5815 CallElasticsearch netcoreapp3.1 1.5μs 0.689ns 2.58ns 0.0129 0 0 976 B
#5815 CallElasticsearch net472 2.57μs 1.58ns 5.92ns 0.157 0 0 995 B
#5815 CallElasticsearchAsync net6.0 1.14μs 0.423ns 1.58ns 0.0133 0 0 952 B
#5815 CallElasticsearchAsync netcoreapp3.1 1.64μs 0.568ns 2.2ns 0.014 0 0 1.02 KB
#5815 CallElasticsearchAsync net472 2.58μs 3.57ns 13.8ns 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.25μs 1.53ns 5.92ns 0.0137 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.63μs 1.23ns 4.76ns 0.0122 0 0 952 B
master ExecuteAsync net472 1.75μs 1.13ns 4.39ns 0.145 0 0 915 B
#5815 ExecuteAsync net6.0 1.2μs 0.796ns 3.08ns 0.0131 0 0 952 B
#5815 ExecuteAsync netcoreapp3.1 1.54μs 1.02ns 3.81ns 0.0125 0 0 952 B
#5815 ExecuteAsync net472 1.83μs 0.662ns 2.48ns 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.23μs 2.23ns 8.35ns 0.0297 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.15μs 2.83ns 11ns 0.0361 0 0 2.76 KB
master SendAsync net472 7.7μs 3.12ns 11.7ns 0.5 0 0 3.15 KB
#5815 SendAsync net6.0 4.28μs 2.07ns 7.74ns 0.0299 0 0 2.22 KB
#5815 SendAsync netcoreapp3.1 5.25μs 3.36ns 11.6ns 0.0369 0 0 2.76 KB
#5815 SendAsync net472 7.77μs 3.24ns 12.5ns 0.497 0 0 3.15 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 0.93ns 3.48ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.07μs 0.687ns 2.48ns 0.0229 0 0 1.64 KB
master EnrichedLog net472 2.74μs 3.68ns 14.3ns 0.249 0 0 1.57 KB
#5815 EnrichedLog net6.0 1.44μs 0.742ns 2.78ns 0.0232 0 0 1.64 KB
#5815 EnrichedLog netcoreapp3.1 2.15μs 1.01ns 3.79ns 0.0226 0 0 1.64 KB
#5815 EnrichedLog net472 2.54μs 0.937ns 3.63ns 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 209ns 808ns 0.0571 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 120μs 99.2ns 358ns 0 0 0 4.28 KB
master EnrichedLog net472 149μs 114ns 440ns 0.668 0.223 0 4.46 KB
#5815 EnrichedLog net6.0 118μs 139ns 500ns 0.058 0 0 4.28 KB
#5815 EnrichedLog netcoreapp3.1 118μs 269ns 1.04μs 0.0584 0 0 4.28 KB
#5815 EnrichedLog net472 147μs 229ns 886ns 0.66 0.22 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.96μs 0.98ns 3.67ns 0.0311 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.11μs 1.56ns 6.06ns 0.0288 0 0 2.2 KB
master EnrichedLog net472 4.74μs 2.05ns 7.67ns 0.319 0 0 2.02 KB
#5815 EnrichedLog net6.0 2.96μs 1.43ns 5.53ns 0.0312 0 0 2.2 KB
#5815 EnrichedLog netcoreapp3.1 4.08μs 5.24ns 20.3ns 0.0284 0 0 2.2 KB
#5815 EnrichedLog net472 4.91μs 1.52ns 5.89ns 0.321 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.42μs 0.949ns 3.55ns 0.0157 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.83μs 1.3ns 5.05ns 0.0155 0 0 1.14 KB
master SendReceive net472 2.14μs 1.01ns 3.9ns 0.183 0.00107 0 1.16 KB
#5815 SendReceive net6.0 1.3μs 3.6ns 13.9ns 0.0158 0 0 1.14 KB
#5815 SendReceive netcoreapp3.1 1.74μs 1.27ns 4.92ns 0.0157 0 0 1.14 KB
#5815 SendReceive net472 2.01μs 1.14ns 4.26ns 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.78μs 0.778ns 3.01ns 0.0223 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 4μs 2.02ns 7.84ns 0.0219 0 0 1.65 KB
master EnrichedLog net472 4.46μs 1.73ns 6.72ns 0.323 0 0 2.04 KB
#5815 EnrichedLog net6.0 2.86μs 1.25ns 4.68ns 0.0229 0 0 1.6 KB
#5815 EnrichedLog netcoreapp3.1 3.99μs 2.15ns 8.32ns 0.0219 0 0 1.65 KB
#5815 EnrichedLog net472 4.53μs 4.62ns 17.3ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5815

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.260 530.69 421.06

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 531ns 0.519ns 1.87ns 0.00811 0 0 576 B
master StartFinishSpan netcoreapp3.1 565ns 1.13ns 4.38ns 0.00775 0 0 576 B
master StartFinishSpan net472 666ns 0.577ns 2.16ns 0.0916 0 0 578 B
master StartFinishScope net6.0 503ns 0.737ns 2.85ns 0.00977 0 0 696 B
master StartFinishScope netcoreapp3.1 764ns 0.352ns 1.37ns 0.00942 0 0 696 B
master StartFinishScope net472 861ns 0.573ns 2.14ns 0.104 0 0 658 B
#5815 StartFinishSpan net6.0 421ns 0.147ns 0.552ns 0.00806 0 0 576 B
#5815 StartFinishSpan netcoreapp3.1 610ns 0.485ns 1.75ns 0.00777 0 0 576 B
#5815 StartFinishSpan net472 602ns 0.633ns 2.45ns 0.0918 0 0 578 B
#5815 StartFinishScope net6.0 476ns 0.192ns 0.743ns 0.00984 0 0 696 B
#5815 StartFinishScope netcoreapp3.1 795ns 0.395ns 1.53ns 0.00946 0 0 696 B
#5815 StartFinishScope net472 867ns 4.31ns 20.2ns 0.105 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5815

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 1.119 1,055.24 1,180.39

Faster 🎉 in #5815

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.257 818.32 650.90
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.188 1,067.92 898.74

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 820ns 1.96ns 7.35ns 0.00988 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.07μs 0.629ns 2.44ns 0.00957 0 0 696 B
master RunOnMethodBegin net472 1.06μs 2.8ns 10.8ns 0.104 0 0 658 B
#5815 RunOnMethodBegin net6.0 650ns 0.473ns 1.83ns 0.00976 0 0 696 B
#5815 RunOnMethodBegin netcoreapp3.1 899ns 0.411ns 1.48ns 0.00945 0 0 696 B
#5815 RunOnMethodBegin net472 1.18μs 2.46ns 9.22ns 0.104 0 0 658 B

@dudikeleti dudikeleti force-pushed the dudik/el-compare-numeric-types branch from 4b3b489 to 8993a61 Compare August 6, 2024 14:34
Copy link
Contributor

@GreenMatan GreenMatan left a comment

Choose a reason for hiding this comment

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

LGTM. We should start evaluating an approach to find all the edge cases using a variation of exploration testing for expression language.

@dudikeleti dudikeleti force-pushed the dudik/el-compare-numeric-types branch 2 times, most recently from 83d25e1 to 8dadf3e Compare August 8, 2024 12:20
@dudikeleti dudikeleti requested a review from a team as a code owner August 8, 2024 15:05
@dudikeleti dudikeleti force-pushed the dudik/el-compare-numeric-types branch from ebcee33 to 161cc06 Compare August 8, 2024 18:48
Copy link
Contributor

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

👍

@dudikeleti dudikeleti merged commit dc1a21f into master Aug 8, 2024
63 of 71 checks passed
@dudikeleti dudikeleti deleted the dudik/el-compare-numeric-types branch August 8, 2024 20:55
@github-actions github-actions bot added this to the vNext-v3 milestone Aug 8, 2024
dudikeleti added a commit that referenced this pull request Aug 9, 2024
## Summary of changes
Fix debugger integration test that broke in this
[PR](#5815)
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