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

SynchronizedRW #6636

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

tonyredondo
Copy link
Member

Summary of changes

Reason for change

Implementation details

Test coverage

Other details

@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 (6636) - mean (69ms)  : 67, 71
     .   : milestone, 69,
    master - mean (69ms)  : 67, 71
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6636) - mean (988ms)  : 964, 1012
     .   : milestone, 988,
    master - mean (987ms)  : 967, 1008
     .   : milestone, 987,

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

    section CallTarget+Inlining+NGEN
    This PR (6636) - mean (727ms)  : crit, 687, 766
     .   : crit, milestone, 727,
    master - mean (670ms)  : 652, 688
     .   : milestone, 670,

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

    section CallTarget+Inlining+NGEN
    This PR (6636) - mean (625ms)  : 599, 652
     .   : milestone, 625,
    master - mean (633ms)  : 610, 656
     .   : milestone, 633,

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

    section CallTarget+Inlining+NGEN
    This PR (6636) - mean (1,098ms)  : 1064, 1131
     .   : milestone, 1098,
    master - mean (1,094ms)  : 1071, 1117
     .   : milestone, 1094,

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

    section CallTarget+Inlining+NGEN
    This PR (6636) - mean (901ms)  : 881, 921
     .   : milestone, 901,
    master - mean (861ms)  : 829, 893
     .   : milestone, 861,

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

    section CallTarget+Inlining+NGEN
    This PR (6636) - mean (846ms)  : 803, 888
     .   : milestone, 846,
    master - mean (841ms)  : 810, 872
     .   : milestone, 841,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6636 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.239
  • 1 benchmarks are slower, with geometric mean 1.151
  • 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.89μs 44.2ns 280ns 0.0151 0.00753 0 5.61 KB
master StartStopWithChild netcoreapp3.1 9.86μs 47.4ns 183ns 0.0147 0.0049 0 5.8 KB
master StartStopWithChild net472 15.9μs 49.3ns 191ns 1.03 0.293 0.0951 6.2 KB
#6636 StartStopWithChild net6.0 8.05μs 43.4ns 245ns 0.0156 0.00781 0 5.61 KB
#6636 StartStopWithChild netcoreapp3.1 10.6μs 57.7ns 316ns 0.0246 0.00986 0 5.8 KB
#6636 StartStopWithChild net472 16.4μs 48.1ns 186ns 1.06 0.327 0.106 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 485μs 459ns 1.78μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 199ns 717ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 864μs 720ns 2.69μs 0.431 0 0 3.3 KB
#6636 WriteAndFlushEnrichedTraces net6.0 498μs 268ns 1.04μs 0 0 0 2.7 KB
#6636 WriteAndFlushEnrichedTraces netcoreapp3.1 639μs 316ns 1.22μs 0 0 0 2.7 KB
#6636 WriteAndFlushEnrichedTraces net472 867μs 2.57μs 9.96μ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 130μs 412ns 1.49μs 0.198 0 0 14.47 KB
master SendRequest netcoreapp3.1 151μs 317ns 1.23μs 0.227 0 0 17.27 KB
master SendRequest net472 0.00528ns 0.00135ns 0.00523ns 0 0 0 0 b
#6636 SendRequest net6.0 132μs 339ns 1.31μs 0.13 0 0 14.47 KB
#6636 SendRequest netcoreapp3.1 150μs 313ns 1.21μs 0.224 0 0 17.28 KB
#6636 SendRequest net472 0.001ns 0.000396ns 0.00153ns 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 560μs 3.02μs 16μs 0.543 0 0 41.4 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 653μs 3.6μs 22.2μs 0.324 0 0 41.65 KB
master WriteAndFlushEnrichedTraces net472 833μs 2.96μs 11.5μs 8.12 2.44 0.406 53.3 KB
#6636 WriteAndFlushEnrichedTraces net6.0 564μs 2.71μs 11.8μs 0.563 0 0 41.59 KB
#6636 WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 1.46μs 5.46μs 0.326 0 0 41.63 KB
#6636 WriteAndFlushEnrichedTraces net472 859μs 3.76μs 14.1μs 8.08 2.55 0.425 53.33 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 0.982ns 3.67ns 0.0141 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.79μs 1.76ns 6.82ns 0.0134 0 0 1.02 KB
master ExecuteNonQuery net472 2.03μs 2.01ns 7.51ns 0.156 0.00101 0 987 B
#6636 ExecuteNonQuery net6.0 1.27μs 1.17ns 4.53ns 0.0146 0 0 1.02 KB
#6636 ExecuteNonQuery netcoreapp3.1 1.69μs 0.767ns 2.77ns 0.0136 0 0 1.02 KB
#6636 ExecuteNonQuery net472 2.07μs 2.52ns 9.74ns 0.157 0.00103 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.23μs 0.976ns 3.78ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.56μs 1.29ns 4.83ns 0.0134 0 0 976 B
master CallElasticsearch net472 2.56μs 1.97ns 7.64ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.26μs 1.11ns 4.14ns 0.0132 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.67μs 0.959ns 3.71ns 0.0134 0 0 1.02 KB
master CallElasticsearchAsync net472 2.52μs 1.31ns 5.08ns 0.166 0 0 1.05 KB
#6636 CallElasticsearch net6.0 1.23μs 0.355ns 1.33ns 0.0135 0 0 976 B
#6636 CallElasticsearch netcoreapp3.1 1.5μs 0.496ns 1.86ns 0.0128 0 0 976 B
#6636 CallElasticsearch net472 2.57μs 1.18ns 4.41ns 0.158 0 0 995 B
#6636 CallElasticsearchAsync net6.0 1.26μs 2.02ns 7.81ns 0.0133 0 0 952 B
#6636 CallElasticsearchAsync netcoreapp3.1 1.68μs 0.449ns 1.62ns 0.0135 0 0 1.02 KB
#6636 CallElasticsearchAsync net472 2.61μs 1.71ns 6.63ns 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.44μs 0.83ns 3.21ns 0.0137 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.63μs 3.62ns 14ns 0.0122 0 0 952 B
master ExecuteAsync net472 1.77μs 0.313ns 1.17ns 0.145 0 0 915 B
#6636 ExecuteAsync net6.0 1.31μs 1.41ns 5.44ns 0.0131 0 0 952 B
#6636 ExecuteAsync netcoreapp3.1 1.71μs 2.18ns 8.45ns 0.0126 0 0 952 B
#6636 ExecuteAsync net472 1.82μs 0.526ns 1.82ns 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.32μs 1ns 3.74ns 0.0324 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.23μs 1.88ns 7.3ns 0.0393 0 0 2.85 KB
master SendAsync net472 7.38μs 2.24ns 8.68ns 0.495 0 0 3.12 KB
#6636 SendAsync net6.0 4.43μs 2.29ns 8.85ns 0.031 0 0 2.31 KB
#6636 SendAsync netcoreapp3.1 5.46μs 1.62ns 5.84ns 0.0384 0 0 2.85 KB
#6636 SendAsync net472 7.57μs 3.24ns 12.6ns 0.496 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.721ns 2.7ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.14μs 1.27ns 4.74ns 0.0222 0 0 1.64 KB
master EnrichedLog net472 2.52μs 0.772ns 2.89ns 0.249 0 0 1.57 KB
#6636 EnrichedLog net6.0 1.56μs 1.15ns 4.3ns 0.0227 0 0 1.64 KB
#6636 EnrichedLog netcoreapp3.1 2.22μs 4.25ns 16.5ns 0.0224 0 0 1.64 KB
#6636 EnrichedLog net472 2.75μs 0.788ns 3.05ns 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 112μs 123ns 475ns 0.0561 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 116μs 144ns 537ns 0 0 0 4.28 KB
master EnrichedLog net472 151μs 224ns 868ns 0.672 0.224 0 4.46 KB
#6636 EnrichedLog net6.0 112μs 126ns 489ns 0.0562 0 0 4.28 KB
#6636 EnrichedLog netcoreapp3.1 117μs 254ns 983ns 0 0 0 4.28 KB
#6636 EnrichedLog net472 150μs 123ns 477ns 0.673 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 2.95μs 1.38ns 5.36ns 0.0311 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.13μs 1.53ns 5.72ns 0.029 0 0 2.2 KB
master EnrichedLog net472 4.94μs 1.29ns 5ns 0.321 0 0 2.02 KB
#6636 EnrichedLog net6.0 3.07μs 0.918ns 3.31ns 0.0307 0 0 2.2 KB
#6636 EnrichedLog netcoreapp3.1 4.21μs 1.78ns 6.89ns 0.0297 0 0 2.2 KB
#6636 EnrichedLog net472 4.93μs 1.85ns 6.92ns 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.41μs 1.49ns 5.79ns 0.0157 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.76μs 0.847ns 3.28ns 0.015 0 0 1.14 KB
master SendReceive net472 2.12μs 7.29ns 28.2ns 0.183 0 0 1.16 KB
#6636 SendReceive net6.0 1.36μs 1.16ns 4.51ns 0.0164 0 0 1.14 KB
#6636 SendReceive netcoreapp3.1 1.78μs 1.11ns 4.29ns 0.0152 0 0 1.14 KB
#6636 SendReceive net472 2.08μs 0.973ns 3.77ns 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.73μs 1.03ns 3.85ns 0.0218 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.79μs 1.75ns 6.79ns 0.0227 0 0 1.65 KB
master EnrichedLog net472 4.44μs 2.6ns 9.73ns 0.322 0 0 2.04 KB
#6636 EnrichedLog net6.0 2.8μs 7.49ns 29ns 0.0222 0 0 1.6 KB
#6636 EnrichedLog netcoreapp3.1 3.94μs 1.13ns 4.39ns 0.0217 0 0 1.65 KB
#6636 EnrichedLog net472 4.52μs 4.13ns 16ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6636

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.239 601.04 485.28

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 387ns 0.469ns 1.82ns 0.00807 0 0 576 B
master StartFinishSpan netcoreapp3.1 542ns 1.1ns 4.24ns 0.00782 0 0 576 B
master StartFinishSpan net472 597ns 1.37ns 5.31ns 0.0917 0 0 578 B
master StartFinishScope net6.0 601ns 0.998ns 3.87ns 0.00983 0 0 696 B
master StartFinishScope netcoreapp3.1 760ns 1.81ns 6.99ns 0.00935 0 0 696 B
master StartFinishScope net472 843ns 2.07ns 8ns 0.104 0 0 658 B
#6636 StartFinishSpan net6.0 407ns 0.406ns 1.52ns 0.00815 0 0 576 B
#6636 StartFinishSpan netcoreapp3.1 570ns 0.421ns 1.58ns 0.00774 0 0 576 B
#6636 StartFinishSpan net472 651ns 1.85ns 7.39ns 0.0915 0 0 578 B
#6636 StartFinishScope net6.0 486ns 0.38ns 1.47ns 0.00975 0 0 696 B
#6636 StartFinishScope netcoreapp3.1 710ns 0.465ns 1.8ns 0.00927 0 0 696 B
#6636 StartFinishScope net472 816ns 2.73ns 10.6ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6636

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.151 611.30 703.72

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 612ns 0.778ns 3.01ns 0.0098 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 941ns 1.79ns 6.94ns 0.00942 0 0 696 B
master RunOnMethodBegin net472 1.12μs 2.26ns 8.77ns 0.104 0 0 658 B
#6636 RunOnMethodBegin net6.0 704ns 0.229ns 0.888ns 0.00987 0 0 696 B
#6636 RunOnMethodBegin netcoreapp3.1 864ns 0.737ns 2.86ns 0.00935 0 0 696 B
#6636 RunOnMethodBegin net472 1.06μs 0.506ns 1.96ns 0.104 0 0 658 B

@datadog-ddstaging
Copy link

Datadog Report

Branch report: tony/add-synchronizedrw-native-refactor
Commit report: 16c9ef3
Test service: dd-trace-dotnet

❌ 17 Failed (2 Known Flaky), 254238 Passed, 3217 Skipped, 30h 56m 0.18s Total Time

❌ Failed Tests (17)

This report shows up to 5 failed tests.

  • SubmitsTraces - Datadog.Trace.ClrProfiler.IntegrationTests.AWS.AwsLambdaTests - Details

    Expand for error
     Results do not match.
     Differences:
     Received: AwsLambdaTests.received.txt
     Verified: AwsLambdaTests.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: lambda.invocation,
     ...
    
  • SubmitsTraces - Datadog.Trace.ClrProfiler.IntegrationTests.AWS.AwsLambdaTests - Details

    Expand for error
     Results do not match.
     Differences:
     Received: AwsLambdaTests.received.txt
     Verified: AwsLambdaTests.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: lambda.invocation,
     ...
    
  • SubmitTraces - Datadog.Trace.ClrProfiler.IntegrationTests.GrpcHttpTests - Details

    Expand for error
     Results do not match.
     Differences:
     Received: GrpcDotNet.SubmitTraces_httpclient=True.SchemaV0.received.txt
     Verified: GrpcDotNet.SubmitTraces_httpclient=True.SchemaV0.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: SendBothStreamingRequest,
     ...
    
  • ReadyToRunManualAndAutomatic - Datadog.Trace.ClrProfiler.IntegrationTests.ManualInstrumentationTests - Details

    Expand for error
     Expected exit code: 0, actual exit code: 134.
    
  • ReadyToRunManualAndAutomatic - Datadog.Trace.ClrProfiler.IntegrationTests.ManualInstrumentationTests - Details

    Expand for error
     Expected exit code: 0, actual exit code: 134.
    

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.

2 participants