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

Vendor in Microsoft.OpenApi #6461

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

Vendor in Microsoft.OpenApi #6461

wants to merge 4 commits into from

Conversation

vandonr
Copy link
Contributor

@vandonr vandonr commented Dec 19, 2024

Summary of changes

added the code of Microsoft.OpenApi to the tracer, removed/changed the parts that require more recent versions of the language/fwk than we have, and updated generated files.

Reason for change

It's going to be needed for the protobuf instrumentation, and I'm doing it in a separate PR to limit the size of the diff in the actual change.

Implementation details

@bouwkast ran the vendoring tool to add the files, since it's not working on Mac apparently

Test coverage

Other details

@vandonr vandonr requested review from a team as code owners December 19, 2024 09:40
@andrewlock
Copy link
Member

andrewlock commented Dec 19, 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 (6461) - mean (68ms)  : 66, 71
     .   : milestone, 68,
    master - mean (68ms)  : 66, 70
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (6461) - mean (975ms)  : 954, 996
     .   : milestone, 975,
    master - mean (973ms)  : 949, 997
     .   : milestone, 973,

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

    section CallTarget+Inlining+NGEN
    This PR (6461) - mean (675ms)  : 664, 686
     .   : milestone, 675,
    master - mean (675ms)  : 657, 693
     .   : milestone, 675,

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

    section CallTarget+Inlining+NGEN
    This PR (6461) - mean (629ms)  : 611, 646
     .   : milestone, 629,
    master - mean (630ms)  : 614, 646
     .   : milestone, 630,

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

    section CallTarget+Inlining+NGEN
    This PR (6461) - mean (1,099ms)  : 1069, 1129
     .   : milestone, 1099,
    master - mean (1,096ms)  : 1069, 1124
     .   : milestone, 1096,

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

    section CallTarget+Inlining+NGEN
    This PR (6461) - mean (868ms)  : 833, 903
     .   : milestone, 868,
    master - mean (868ms)  : 841, 896
     .   : milestone, 868,

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

    section CallTarget+Inlining+NGEN
    This PR (6461) - mean (843ms)  : 808, 878
     .   : milestone, 843,
    master - mean (850ms)  : 814, 887
     .   : milestone, 850,

Loading

@andrewlock
Copy link
Member

andrewlock commented Dec 19, 2024

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 (6461) (10.791M)   : 0, 10790745
    master (11.080M)   : 0, 11079759
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6461) (7.045M)   : 0, 7045206
    master (7.154M)   : 0, 7154253
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.512M)   : 0, 7512246

    section Manual
    master (11.035M)   : 0, 11035311

    section Manual + Automatic
    This PR (6461) (6.581M)   : 0, 6580940
    master (6.611M)   : 0, 6611049

    section DD_TRACE_ENABLED=0
    master (10.155M)   : 0, 10155447

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6461) (9.726M)   : 0, 9725698
    master (9.567M)   : 0, 9566967
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6461) (6.421M)   : 0, 6421286
    master (6.361M)   : 0, 6360592

    section Trace stats
    master (6.540M)   : 0, 6540289

    section Manual
    master (9.643M)   : 0, 9642857

    section Manual + Automatic
    This PR (6461) (5.982M)   : 0, 5982475
    master (5.877M)   : 0, 5877320

    section DD_TRACE_ENABLED=0
    master (8.928M)   : 0, 8928120

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6461) (9.729M)   : 0, 9728855
    master (9.916M)   : 0, 9915888
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6461) (6.158M)   : 0, 6157589
    master (6.337M)   : 0, 6336520
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (6.963M)   : 0, 6963468

    section Manual
    master (9.842M)   : 0, 9842464

    section Manual + Automatic
    This PR (6461) (5.994M)   : 0, 5994214
    master (6.172M)   : 0, 6171910

    section DD_TRACE_ENABLED=0
    master (9.319M)   : 0, 9318507

Loading

@andrewlock
Copy link
Member

andrewlock commented Dec 19, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6461 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.148
  • 1 benchmarks are slower, with geometric mean 1.119
  • 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 7.89μs 42.1ns 231ns 0.0191 0.00762 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.3μs 56.9ns 346ns 0.02 0.00998 0 5.8 KB
master StartStopWithChild net472 16.4μs 46.6ns 174ns 1.04 0.326 0.0979 6.21 KB
#6461 StartStopWithChild net6.0 7.83μs 43.7ns 269ns 0.0158 0.00792 0 5.61 KB
#6461 StartStopWithChild netcoreapp3.1 9.92μs 52.5ns 282ns 0.0187 0.00934 0 5.8 KB
#6461 StartStopWithChild net472 16.5μs 47ns 182ns 1.06 0.326 0.109 6.21 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 505μs 187ns 674ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 665μs 191ns 713ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 851μs 601ns 2.25μs 0.425 0 0 3.3 KB
#6461 WriteAndFlushEnrichedTraces net6.0 485μs 278ns 1.08μs 0 0 0 2.7 KB
#6461 WriteAndFlushEnrichedTraces netcoreapp3.1 655μs 549ns 2.13μs 0 0 0 2.7 KB
#6461 WriteAndFlushEnrichedTraces net472 852μs 761ns 2.95μs 0.428 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 159μs 1.17μs 11.7μs 0.155 0 0 14.47 KB
master SendRequest netcoreapp3.1 171μs 989ns 8.85μs 0.16 0 0 17.27 KB
master SendRequest net472 0.00147ns 0.000331ns 0.00119ns 0 0 0 0 b
#6461 SendRequest net6.0 152μs 893ns 8.61μs 0.157 0 0 14.47 KB
#6461 SendRequest netcoreapp3.1 178μs 1.08μs 10.5μs 0.188 0 0 17.27 KB
#6461 SendRequest net472 0.00201ns 0.000938ns 0.00363ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6461

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.6 KB 41.88 KB 277 B 0.67%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 574μs 3.16μs 19.7μs 0.571 0 0 41.6 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 667μs 3.5μs 18.2μs 0.319 0 0 41.66 KB
master WriteAndFlushEnrichedTraces net472 874μs 3.72μs 14.4μs 8.19 2.59 0.431 53.28 KB
#6461 WriteAndFlushEnrichedTraces net6.0 571μs 2.93μs 13.1μs 0.536 0 0 41.88 KB
#6461 WriteAndFlushEnrichedTraces netcoreapp3.1 676μs 3.44μs 16.5μs 0.329 0 0 41.71 KB
#6461 WriteAndFlushEnrichedTraces net472 834μs 3.98μs 15.4μs 8.33 2.5 0.417 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.28μs 1.12ns 4.19ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.86μs 1.63ns 6.3ns 0.0138 0 0 1.02 KB
master ExecuteNonQuery net472 2.11μs 1.82ns 7.04ns 0.156 0.00105 0 987 B
#6461 ExecuteNonQuery net6.0 1.33μs 0.763ns 2.75ns 0.014 0 0 1.02 KB
#6461 ExecuteNonQuery netcoreapp3.1 1.71μs 1.67ns 6.45ns 0.0137 0 0 1.02 KB
#6461 ExecuteNonQuery net472 2.03μs 1.63ns 6.3ns 0.156 0.00101 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.25μs 0.547ns 2.05ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.61μs 1.32ns 5.13ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.49μs 2.37ns 9.17ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.35μs 0.4ns 1.44ns 0.013 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.76μs 1.28ns 4.95ns 0.014 0 0 1.02 KB
master CallElasticsearchAsync net472 2.68μs 0.672ns 2.42ns 0.166 0 0 1.05 KB
#6461 CallElasticsearch net6.0 1.21μs 0.505ns 1.89ns 0.0135 0 0 976 B
#6461 CallElasticsearch netcoreapp3.1 1.58μs 0.431ns 1.49ns 0.0134 0 0 976 B
#6461 CallElasticsearch net472 2.5μs 1.44ns 5.59ns 0.158 0 0 995 B
#6461 CallElasticsearchAsync net6.0 1.34μs 0.57ns 2.21ns 0.0132 0 0 952 B
#6461 CallElasticsearchAsync netcoreapp3.1 1.71μs 0.898ns 3.36ns 0.0137 0 0 1.02 KB
#6461 CallElasticsearchAsync net472 2.65μs 1.57ns 6.09ns 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.34μs 0.61ns 2.28ns 0.0139 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.59μs 0.735ns 2.75ns 0.0129 0 0 952 B
master ExecuteAsync net472 1.84μs 0.58ns 2.17ns 0.145 0 0 915 B
#6461 ExecuteAsync net6.0 1.32μs 0.694ns 2.6ns 0.0132 0 0 952 B
#6461 ExecuteAsync netcoreapp3.1 1.7μs 0.558ns 2.09ns 0.0127 0 0 952 B
#6461 ExecuteAsync net472 1.81μs 4.8ns 18.6ns 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.46μs 0.961ns 3.72ns 0.0313 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.12μs 1.94ns 6.98ns 0.0361 0 0 2.85 KB
master SendAsync net472 7.37μs 1.27ns 4.57ns 0.494 0 0 3.12 KB
#6461 SendAsync net6.0 4.41μs 1.23ns 4.78ns 0.0312 0 0 2.31 KB
#6461 SendAsync netcoreapp3.1 5.33μs 1.25ns 4.66ns 0.0375 0 0 2.85 KB
#6461 SendAsync net472 7.37μs 2.01ns 7.52ns 0.493 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.46μs 0.521ns 1.88ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.25μs 9.33ns 36.1ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.67μs 1.31ns 4.9ns 0.25 0 0 1.57 KB
#6461 EnrichedLog net6.0 1.47μs 0.753ns 2.82ns 0.0232 0 0 1.64 KB
#6461 EnrichedLog netcoreapp3.1 2.26μs 1.26ns 4.53ns 0.0219 0 0 1.64 KB
#6461 EnrichedLog net472 2.71μs 1.8ns 6.72ns 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 119μs 165ns 616ns 0.0598 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 122μs 179ns 691ns 0 0 0 4.28 KB
master EnrichedLog net472 153μs 130ns 503ns 0.687 0.229 0 4.46 KB
#6461 EnrichedLog net6.0 120μs 222ns 859ns 0 0 0 4.28 KB
#6461 EnrichedLog netcoreapp3.1 120μs 220ns 853ns 0.0598 0 0 4.28 KB
#6461 EnrichedLog net472 152μs 190ns 737ns 0.668 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.96μs 0.942ns 3.65ns 0.0312 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.11μs 1.58ns 6.11ns 0.0289 0 0 2.2 KB
master EnrichedLog net472 4.86μs 1.22ns 4.74ns 0.32 0 0 2.02 KB
#6461 EnrichedLog net6.0 3.13μs 8.09ns 30.3ns 0.0313 0 0 2.2 KB
#6461 EnrichedLog netcoreapp3.1 4.03μs 1.1ns 4.11ns 0.0303 0 0 2.2 KB
#6461 EnrichedLog net472 5.02μs 1.48ns 5.74ns 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.4μs 0.47ns 1.76ns 0.0162 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.82μs 8.41ns 32.6ns 0.0155 0 0 1.14 KB
master SendReceive net472 2.13μs 0.448ns 1.74ns 0.184 0 0 1.16 KB
#6461 SendReceive net6.0 1.37μs 0.346ns 1.29ns 0.0157 0 0 1.14 KB
#6461 SendReceive netcoreapp3.1 1.79μs 3.23ns 12.5ns 0.0152 0 0 1.14 KB
#6461 SendReceive net472 2.05μs 0.88ns 3.41ns 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.78ns 2.92ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.87μs 2.61ns 10.1ns 0.0213 0 0 1.65 KB
master EnrichedLog net472 4.36μs 5.45ns 21.1ns 0.324 0 0 2.04 KB
#6461 EnrichedLog net6.0 2.78μs 1.58ns 5.9ns 0.0223 0 0 1.6 KB
#6461 EnrichedLog netcoreapp3.1 3.87μs 2.38ns 9.23ns 0.0213 0 0 1.65 KB
#6461 EnrichedLog net472 4.29μs 1.37ns 5.32ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6461

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.119 413.28 462.63

Faster 🎉 in #6461

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.148 652.47 568.28 several?

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 413ns 0.199ns 0.769ns 0.00802 0 0 576 B
master StartFinishSpan netcoreapp3.1 639ns 3.5ns 20.1ns 0.00752 0 0 576 B
master StartFinishSpan net472 660ns 0.547ns 2.12ns 0.0917 0 0 578 B
master StartFinishScope net6.0 594ns 0.422ns 1.63ns 0.00982 0 0 696 B
master StartFinishScope netcoreapp3.1 745ns 0.867ns 3.36ns 0.00932 0 0 696 B
master StartFinishScope net472 833ns 1.4ns 5.41ns 0.105 0 0 658 B
#6461 StartFinishSpan net6.0 463ns 0.279ns 1.08ns 0.00797 0 0 576 B
#6461 StartFinishSpan netcoreapp3.1 568ns 0.449ns 1.74ns 0.00773 0 0 576 B
#6461 StartFinishSpan net472 643ns 0.308ns 1.15ns 0.0916 0 0 578 B
#6461 StartFinishScope net6.0 598ns 0.442ns 1.71ns 0.00961 0 0 696 B
#6461 StartFinishScope netcoreapp3.1 766ns 0.423ns 1.64ns 0.00927 0 0 696 B
#6461 StartFinishScope net472 869ns 0.592ns 2.29ns 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 638ns 0.866ns 3.35ns 0.00963 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 894ns 0.805ns 3.12ns 0.00927 0 0 696 B
master RunOnMethodBegin net472 1.1μs 1.08ns 4.18ns 0.104 0 0 658 B
#6461 RunOnMethodBegin net6.0 627ns 0.436ns 1.57ns 0.00975 0 0 696 B
#6461 RunOnMethodBegin netcoreapp3.1 946ns 1.17ns 4.52ns 0.00937 0 0 696 B
#6461 RunOnMethodBegin net472 1.08μs 0.816ns 3.16ns 0.105 0 0 658 B

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Dec 19, 2024

Datadog Report

Branch report: vandonr/vendored
Commit report: 43a3d3d
Test service: dd-trace-dotnet

✅ 0 Failed, 444580 Passed, 2127 Skipped, 13h 28m 35.59s Total Time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants