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-2602 Collection expressions fixes #6087

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dudikeleti
Copy link
Contributor

Summary of changes

This PR fixes som eissues with evaluating expresisons on different types of collections

Reason for change

To support more collection templates and conditions expressions in our expression language

@dudikeleti dudikeleti requested a review from a team as a code owner September 26, 2024 12:12
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Sep 26, 2024

Datadog Report

Branch report: dudik/collections-expression-fixes
Commit report: 262bbb1
Test service: dd-trace-dotnet

✅ 0 Failed, 368865 Passed, 2692 Skipped, 25h 24m 3.33s Total Time

@andrewlock
Copy link
Member

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 (6087) - mean (71ms)  : 68, 75
     .   : milestone, 71,
    master - mean (78ms)  : 69, 87
     .   : milestone, 78,

    section CallTarget+Inlining+NGEN
    This PR (6087) - mean (1,107ms)  : 1079, 1135
     .   : milestone, 1107,
    master - mean (1,148ms)  : 1123, 1174
     .   : milestone, 1148,

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

    section CallTarget+Inlining+NGEN
    This PR (6087) - mean (781ms)  : 758, 803
     .   : milestone, 781,
    master - mean (816ms)  : 797, 834
     .   : milestone, 816,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6087) - mean (95ms)  : 91, 100
     .   : milestone, 95,
    master - mean (100ms)  : 94, 106
     .   : milestone, 100,

    section CallTarget+Inlining+NGEN
    This PR (6087) - mean (764ms)  : 731, 796
     .   : milestone, 764,
    master - mean (766ms)  : 735, 797
     .   : milestone, 766,

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

    section CallTarget+Inlining+NGEN
    This PR (6087) - mean (1,195ms)  : 1170, 1220
     .   : milestone, 1195,
    master - mean (1,193ms)  : 1171, 1215
     .   : milestone, 1193,

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

    section CallTarget+Inlining+NGEN
    This PR (6087) - mean (940ms)  : 924, 956
     .   : milestone, 940,
    master - mean (942ms)  : 923, 960
     .   : milestone, 942,

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

    section CallTarget+Inlining+NGEN
    This PR (6087) - mean (927ms)  : 912, 942
     .   : milestone, 927,
    master - mean (928ms)  : 910, 946
     .   : milestone, 928,

Loading

@andrewlock
Copy link
Member

Throughput/Crank Report ⚡

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 (6087) (11.056M)   : 0, 11055988
    master (11.066M)   : 0, 11065553
    benchmarks/2.9.0 (11.081M)   : 0, 11080577

    section Automatic
    This PR (6087) (7.398M)   : 0, 7397643
    master (7.168M)   : 0, 7168396
    benchmarks/2.9.0 (7.732M)   : 0, 7732233

    section Trace stats
    master (7.603M)   : 0, 7602954

    section Manual
    master (10.985M)   : 0, 10984631

    section Manual + Automatic
    This PR (6087) (6.853M)   : 0, 6852708
    master (6.859M)   : 0, 6858527

    section DD_TRACE_ENABLED=0
    master (10.326M)   : 0, 10326279

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6087) (9.473M)   : 0, 9472854
    master (9.502M)   : 0, 9501909
    benchmarks/2.9.0 (9.798M)   : 0, 9798067

    section Automatic
    This PR (6087) (6.490M)   : 0, 6490133
    master (6.547M)   : 0, 6547161

    section Trace stats
    master (6.970M)   : 0, 6970237

    section Manual
    master (9.184M)   : 0, 9184289

    section Manual + Automatic
    This PR (6087) (5.972M)   : 0, 5972088
    master (6.133M)   : 0, 6132723

    section DD_TRACE_ENABLED=0
    master (8.818M)   : 0, 8818202

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6087) (10.371M)   : 0, 10370720
    master (10.130M)   : 0, 10129657
    benchmarks/2.9.0 (10.067M)   : 0, 10067315

    section Automatic
    This PR (6087) (6.862M)   : 0, 6862315
    master (6.591M)   : 0, 6591169
    benchmarks/2.9.0 (7.552M)   : 0, 7552193

    section Trace stats
    master (7.357M)   : 0, 7357388

    section Manual
    master (10.018M)   : 0, 10018296

    section Manual + Automatic
    This PR (6087) (6.307M)   : 0, 6306670
    master (6.057M)   : 0, 6056873

    section DD_TRACE_ENABLED=0
    master (9.433M)   : 0, 9433366

Loading

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6087 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.185
  • 3 benchmarks are slower, with geometric mean 1.139
  • 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.66μs 41ns 232ns 0.0204 0.00816 0 5.43 KB
master StartStopWithChild netcoreapp3.1 10.1μs 55.3ns 336ns 0.0146 0.00486 0 5.62 KB
master StartStopWithChild net472 16.3μs 71.4ns 277ns 1.02 0.302 0.0953 6.07 KB
#6087 StartStopWithChild net6.0 7.66μs 40.7ns 215ns 0.018 0.00722 0 5.42 KB
#6087 StartStopWithChild netcoreapp3.1 9.88μs 53.4ns 282ns 0.0197 0.00492 0 5.62 KB
#6087 StartStopWithChild net472 16.2μs 77.7ns 301ns 1.02 0.309 0.0812 6.07 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 459μs 467ns 1.75μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 632μs 410ns 1.59μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 816μs 590ns 2.28μs 0.408 0 0 3.3 KB
#6087 WriteAndFlushEnrichedTraces net6.0 484μs 183ns 661ns 0 0 0 2.7 KB
#6087 WriteAndFlushEnrichedTraces netcoreapp3.1 641μs 207ns 775ns 0 0 0 2.7 KB
#6087 WriteAndFlushEnrichedTraces net472 839μs 348ns 1.3μs 0.419 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 195μs 1.07μs 7.85μs 0.188 0 0 18.45 KB
master SendRequest netcoreapp3.1 219μs 1.26μs 9.24μs 0.204 0 0 20.61 KB
master SendRequest net472 0.00322ns 0.00106ns 0.00409ns 0 0 0 0 b
#6087 SendRequest net6.0 195μs 1.09μs 7.26μs 0.193 0 0 18.45 KB
#6087 SendRequest netcoreapp3.1 221μs 1.25μs 9.38μs 0.217 0 0 20.61 KB
#6087 SendRequest net472 0.000376ns 0.000263ns 0.00102ns 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 567μs 2.59μs 9.7μs 0.561 0 0 41.58 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 694μs 3.74μs 19.8μs 0.331 0 0 41.7 KB
master WriteAndFlushEnrichedTraces net472 860μs 3.08μs 11.5μs 8.5 2.55 0.425 53.31 KB
#6087 WriteAndFlushEnrichedTraces net6.0 551μs 2.83μs 12.7μs 0.571 0 0 41.61 KB
#6087 WriteAndFlushEnrichedTraces netcoreapp3.1 674μs 3.2μs 12.4μs 0.332 0 0 41.56 KB
#6087 WriteAndFlushEnrichedTraces net472 856μs 2.27μs 8.79μs 8.33 2.5 0.417 53.3 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 1.32ns 5.13ns 0.0145 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.74μs 0.908ns 3.4ns 0.0132 0 0 1.02 KB
master ExecuteNonQuery net472 2.1μs 1.63ns 6.3ns 0.156 0 0 987 B
#6087 ExecuteNonQuery net6.0 1.31μs 1.23ns 4.76ns 0.0139 0 0 1.02 KB
#6087 ExecuteNonQuery netcoreapp3.1 1.77μs 1.28ns 4.78ns 0.0134 0 0 1.02 KB
#6087 ExecuteNonQuery net472 2.12μs 1.52ns 5.7ns 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.19μs 2.72ns 10.5ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.51μs 0.484ns 1.81ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.55μs 2.83ns 11ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.2μs 0.846ns 3.28ns 0.0131 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.7μs 0.992ns 3.71ns 0.0135 0 0 1.02 KB
master CallElasticsearchAsync net472 2.62μs 2.56ns 9.9ns 0.166 0 0 1.05 KB
#6087 CallElasticsearch net6.0 1.11μs 0.842ns 3.26ns 0.0134 0 0 976 B
#6087 CallElasticsearch netcoreapp3.1 1.51μs 7.03ns 27.2ns 0.0128 0 0 976 B
#6087 CallElasticsearch net472 2.63μs 2.72ns 10.5ns 0.157 0 0 995 B
#6087 CallElasticsearchAsync net6.0 1.3μs 1.09ns 4.09ns 0.013 0 0 952 B
#6087 CallElasticsearchAsync netcoreapp3.1 1.64μs 1.14ns 4.41ns 0.0139 0 0 1.02 KB
#6087 CallElasticsearchAsync net472 2.48μs 2.09ns 8.1ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6087

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.185 1,384.54 1,168.06

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.38μs 0.977ns 3.65ns 0.0131 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.62μs 0.528ns 1.9ns 0.013 0 0 952 B
master ExecuteAsync net472 1.76μs 0.534ns 2.07ns 0.145 0 0 915 B
#6087 ExecuteAsync net6.0 1.17μs 0.688ns 2.66ns 0.0136 0 0 952 B
#6087 ExecuteAsync netcoreapp3.1 1.55μs 3.19ns 12.4ns 0.0132 0 0 952 B
#6087 ExecuteAsync net472 1.72μs 0.501ns 1.81ns 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 10.6ns 41.1ns 0.0317 0 0 2.22 KB
master SendAsync netcoreapp3.1 4.96μs 1.93ns 7.24ns 0.0372 0 0 2.76 KB
master SendAsync net472 7.66μs 2.95ns 11.4ns 0.499 0 0 3.15 KB
#6087 SendAsync net6.0 4.13μs 0.939ns 3.64ns 0.031 0 0 2.22 KB
#6087 SendAsync netcoreapp3.1 5.13μs 2.29ns 8.87ns 0.0363 0 0 2.76 KB
#6087 SendAsync net472 7.75μs 1.3ns 5.04ns 0.496 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.53μs 0.952ns 3.69ns 0.0229 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.33μs 2.57ns 9.63ns 0.022 0 0 1.64 KB
master EnrichedLog net472 2.61μs 1.14ns 4.26ns 0.25 0 0 1.57 KB
#6087 EnrichedLog net6.0 1.48μs 1.23ns 4.59ns 0.0229 0 0 1.64 KB
#6087 EnrichedLog netcoreapp3.1 2.28μs 1.03ns 3.85ns 0.0218 0 0 1.64 KB
#6087 EnrichedLog net472 2.61μs 1.11ns 4.3ns 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 147ns 550ns 0.0571 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 118μs 240ns 928ns 0.0597 0 0 4.28 KB
master EnrichedLog net472 147μs 156ns 603ns 0.662 0.221 0 4.46 KB
#6087 EnrichedLog net6.0 115μs 115ns 447ns 0.0571 0 0 4.28 KB
#6087 EnrichedLog netcoreapp3.1 119μs 133ns 517ns 0 0 0 4.28 KB
#6087 EnrichedLog net472 147μs 87ns 337ns 0.661 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 3.22μs 1.67ns 6.46ns 0.0306 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.12μs 5.94ns 23ns 0.0286 0 0 2.2 KB
master EnrichedLog net472 4.75μs 2.03ns 7.86ns 0.32 0 0 2.02 KB
#6087 EnrichedLog net6.0 3.1μs 0.736ns 2.85ns 0.031 0 0 2.2 KB
#6087 EnrichedLog netcoreapp3.1 4.07μs 1.63ns 6.11ns 0.0307 0 0 2.2 KB
#6087 EnrichedLog net472 4.82μs 0.78ns 3.02ns 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.27μs 0.633ns 2.37ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.76μs 0.651ns 2.52ns 0.015 0 0 1.14 KB
master SendReceive net472 2.07μs 0.948ns 3.55ns 0.183 0 0 1.16 KB
#6087 SendReceive net6.0 1.27μs 0.64ns 2.48ns 0.016 0 0 1.14 KB
#6087 SendReceive netcoreapp3.1 1.8μs 1.16ns 4.49ns 0.0153 0 0 1.14 KB
#6087 SendReceive net472 2.14μs 1.15ns 4.45ns 0.183 0 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.81μs 0.942ns 3.65ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.88μs 2.39ns 9.27ns 0.0215 0 0 1.65 KB
master EnrichedLog net472 4.31μs 2.81ns 10.9ns 0.323 0 0 2.04 KB
#6087 EnrichedLog net6.0 2.76μs 0.815ns 3.16ns 0.0221 0 0 1.6 KB
#6087 EnrichedLog netcoreapp3.1 3.97μs 2.96ns 11.5ns 0.0217 0 0 1.65 KB
#6087 EnrichedLog net472 4.44μs 7.75ns 30ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6087

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.183 399.34 472.44
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.113 542.02 603.41

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 399ns 0.421ns 1.63ns 0.00818 0 0 576 B
master StartFinishSpan netcoreapp3.1 541ns 0.532ns 2.06ns 0.00794 0 0 576 B
master StartFinishSpan net472 735ns 0.366ns 1.42ns 0.0916 0 0 578 B
master StartFinishScope net6.0 471ns 0.411ns 1.59ns 0.00971 0 0 696 B
master StartFinishScope netcoreapp3.1 729ns 0.285ns 1.1ns 0.00918 0 0 696 B
master StartFinishScope net472 894ns 1.61ns 6.23ns 0.104 0 0 658 B
#6087 StartFinishSpan net6.0 472ns 0.208ns 0.778ns 0.00808 0 0 576 B
#6087 StartFinishSpan netcoreapp3.1 604ns 0.329ns 1.27ns 0.00768 0 0 576 B
#6087 StartFinishSpan net472 665ns 0.349ns 1.35ns 0.0916 0 0 578 B
#6087 StartFinishScope net6.0 480ns 0.225ns 0.844ns 0.00988 0 0 696 B
#6087 StartFinishScope netcoreapp3.1 707ns 0.391ns 1.52ns 0.00923 0 0 696 B
#6087 StartFinishScope net472 896ns 0.45ns 1.74ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6087

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.122 605.92 680.04

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 606ns 0.269ns 1.01ns 0.00975 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 848ns 0.522ns 1.81ns 0.00937 0 0 696 B
master RunOnMethodBegin net472 1.02μs 0.635ns 2.46ns 0.104 0 0 658 B
#6087 RunOnMethodBegin net6.0 680ns 0.274ns 1.02ns 0.00996 0 0 696 B
#6087 RunOnMethodBegin netcoreapp3.1 902ns 1.54ns 5.96ns 0.00927 0 0 696 B
#6087 RunOnMethodBegin net472 1.1μs 0.31ns 1.2ns 0.104 0 0 658 B

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.

2 participants