Skip to content

refactor SQS send/receive instrumentation code#5120

Merged
vandonr merged 54 commits into
masterfrom
vandonr/refacto
Feb 19, 2024
Merged

refactor SQS send/receive instrumentation code#5120
vandonr merged 54 commits into
masterfrom
vandonr/refacto

Conversation

@vandonr

@vandonr vandonr commented Jan 29, 2024

Copy link
Copy Markdown
Contributor

Summary of changes

factorized together code that was copy/pasted between sync and async version of methods (or batch/non-batch)

Reason for change

https://en.wikipedia.org/wiki/Don%27t_repeat_yourself

Test coverage

Covered by existing tests, no new behavior.

Other details

I stacked this on top of #4973 to make things simpler for me (and to make the review easier compared to putting this commit in the same PR)

vandonr and others added 30 commits December 14, 2023 13:37
without delimiter, it means all spans are mixed when printed in a list
@vandonr vandonr requested a review from a team as a code owner January 29, 2024 14:13
@andrewlock

andrewlock commented Jan 29, 2024

Copy link
Copy Markdown
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 (5120) - mean (74ms)  : 66, 83
     .   : milestone, 74,
    master - mean (74ms)  : 66, 82
     .   : milestone, 74,

    section CallTarget+Inlining+NGEN
    This PR (5120) - mean (988ms)  : 970, 1006
     .   : milestone, 988,
    master - mean (985ms)  : 963, 1007
     .   : milestone, 985,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5120) - mean (111ms)  : 107, 114
     .   : milestone, 111,
    master - mean (110ms)  : 107, 112
     .   : milestone, 110,

    section CallTarget+Inlining+NGEN
    This PR (5120) - mean (716ms)  : 694, 737
     .   : milestone, 716,
    master - mean (718ms)  : 696, 740
     .   : milestone, 718,

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

    section CallTarget+Inlining+NGEN
    This PR (5120) - mean (666ms)  : 644, 688
     .   : milestone, 666,
    master - mean (679ms)  : 647, 710
     .   : milestone, 679,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5120) - mean (186ms)  : 180, 191
     .   : milestone, 186,
    master - mean (186ms)  : 180, 192
     .   : milestone, 186,

    section CallTarget+Inlining+NGEN
    This PR (5120) - mean (1,055ms)  : 1033, 1077
     .   : milestone, 1055,
    master - mean (1,052ms)  : 1027, 1078
     .   : milestone, 1052,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5120) - mean (270ms)  : 264, 276
     .   : milestone, 270,
    master - mean (270ms)  : 265, 275
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (5120) - mean (1,049ms)  : 1026, 1073
     .   : milestone, 1049,
    master - mean (1,059ms)  : 1038, 1081
     .   : milestone, 1059,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5120) - mean (259ms)  : 254, 264
     .   : milestone, 259,
    master - mean (259ms)  : 254, 264
     .   : milestone, 259,

    section CallTarget+Inlining+NGEN
    This PR (5120) - mean (994ms)  : 971, 1016
     .   : milestone, 994,
    master - mean (992ms)  : 966, 1018
     .   : milestone, 992,

Loading

@andrewlock

andrewlock commented Jan 29, 2024

Copy link
Copy Markdown
Member

Benchmarks Report 🐌

Benchmarks for #5120 compared to master:

  • 4 benchmarks are faster, with geometric mean 1.180
  • 1 benchmarks have fewer 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.67μs 43.4ns 194ns 0.0246 0.0123 0 7.49 KB
master StartStopWithChild netcoreapp3.1 10.6μs 53ns 225ns 0.0383 0.0164 0 7.58 KB
master StartStopWithChild net472 17.1μs 34.1ns 127ns 1.34 0.356 0.11 7.97 KB
#5120 StartStopWithChild net6.0 8.64μs 48.7ns 323ns 0.0217 0.00868 0 7.5 KB
#5120 StartStopWithChild netcoreapp3.1 10.6μs 47.7ns 185ns 0.0262 0.0105 0 7.59 KB
#5120 StartStopWithChild net472 16.8μs 56.1ns 217ns 1.34 0.354 0.107 7.97 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 450μs 232ns 869ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 632μs 272ns 1.05μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 804μs 567ns 2.2μs 0.401 0 0 3.3 KB
#5120 WriteAndFlushEnrichedTraces net6.0 461μs 223ns 864ns 0 0 0 2.7 KB
#5120 WriteAndFlushEnrichedTraces netcoreapp3.1 648μs 387ns 1.5μs 0 0 0 2.7 KB
#5120 WriteAndFlushEnrichedTraces net472 784μs 184ns 687ns 0.391 0 0 3.3 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5120

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 1.344 222.29 165.37

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 40.5μs 110ns 427ns 0.0201 0 0 2.36 KB
master AllCycleSimpleBody netcoreapp3.1 43.7μs 43.7ns 169ns 0.0219 0 0 2.34 KB
master AllCycleSimpleBody net472 46.6μs 24.9ns 96.5ns 0.371 0 0 2.41 KB
master AllCycleMoreComplexBody net6.0 216μs 137ns 512ns 0.107 0 0 9.84 KB
master AllCycleMoreComplexBody netcoreapp3.1 227μs 453ns 1.75μs 0.114 0 0 9.73 KB
master AllCycleMoreComplexBody net472 243μs 128ns 494ns 1.56 0 0 9.91 KB
master ObjectExtractorSimpleBody net6.0 136ns 0.0875ns 0.328ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 216ns 0.105ns 0.392ns 0.00366 0 0 272 B
master ObjectExtractorSimpleBody net472 222ns 0.0779ns 0.281ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.06μs 3.35ns 13ns 0.0536 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.93μs 1.56ns 6.03ns 0.0511 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.85μs 2.8ns 10.9ns 0.602 0.00602 0 3.8 KB
#5120 AllCycleSimpleBody net6.0 42μs 27ns 105ns 0.0208 0 0 2.36 KB
#5120 AllCycleSimpleBody netcoreapp3.1 43.9μs 39.8ns 149ns 0.0219 0 0 2.34 KB
#5120 AllCycleSimpleBody net472 46.9μs 20.1ns 77.8ns 0.373 0 0 2.41 KB
#5120 AllCycleMoreComplexBody net6.0 215μs 74.5ns 289ns 0.107 0 0 9.84 KB
#5120 AllCycleMoreComplexBody netcoreapp3.1 227μs 164ns 591ns 0.113 0 0 9.73 KB
#5120 AllCycleMoreComplexBody net472 240μs 160ns 620ns 1.55 0 0 9.91 KB
#5120 ObjectExtractorSimpleBody net6.0 137ns 0.101ns 0.377ns 0.00393 0 0 280 B
#5120 ObjectExtractorSimpleBody netcoreapp3.1 213ns 0.365ns 1.41ns 0.0036 0 0 272 B
#5120 ObjectExtractorSimpleBody net472 165ns 0.144ns 0.558ns 0.0446 0 0 281 B
#5120 ObjectExtractorMoreComplexBody net6.0 3.09μs 1.72ns 6.43ns 0.0526 0 0 3.78 KB
#5120 ObjectExtractorMoreComplexBody netcoreapp3.1 3.92μs 1.63ns 6.31ns 0.051 0 0 3.69 KB
#5120 ObjectExtractorMoreComplexBody net472 3.86μs 2.6ns 9.73ns 0.603 0.00576 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 52.8μs 44.1ns 165ns 0.423 0 0 30.94 KB
master EncodeArgs netcoreapp3.1 69.2μs 57.9ns 224ns 0.413 0 0 31.47 KB
master EncodeArgs net472 84.8μs 54.6ns 204ns 5.11 0.0851 0 32.27 KB
master EncodeLegacyArgs net6.0 125μs 236ns 912ns 0.43 0 0 33.89 KB
master EncodeLegacyArgs netcoreapp3.1 159μs 233ns 872ns 0.478 0 0 34.08 KB
master EncodeLegacyArgs net472 210μs 113ns 406ns 5.55 0.419 0 34.99 KB
#5120 EncodeArgs net6.0 51.7μs 66.4ns 257ns 0.435 0 0 30.94 KB
#5120 EncodeArgs netcoreapp3.1 70.2μs 73.3ns 284ns 0.419 0 0 31.47 KB
#5120 EncodeArgs net472 85μs 39.4ns 153ns 5.1 0.085 0 32.27 KB
#5120 EncodeLegacyArgs net6.0 128μs 714ns 4.89μs 0.503 0.0629 0.0629 33.89 KB
#5120 EncodeLegacyArgs netcoreapp3.1 157μs 632ns 2.45μs 0.466 0 0 34.09 KB
#5120 EncodeLegacyArgs net472 213μs 275ns 953ns 5.49 0.422 0 34.99 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 RunWafRealisticBenchmark net6.0 189μs 71.5ns 277ns 0.095 0 0 6.51 KB
master RunWafRealisticBenchmark netcoreapp3.1 205μs 194ns 753ns 0 0 0 6.49 KB
master RunWafRealisticBenchmark net472 223μs 123ns 477ns 0.999 0 0 6.59 KB
master RunWafRealisticBenchmarkWithAttack net6.0 125μs 55.6ns 215ns 0.063 0 0 4.15 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 134μs 181ns 653ns 0 0 0 4.14 KB
master RunWafRealisticBenchmarkWithAttack net472 146μs 121ns 453ns 0.659 0 0 4.19 KB
#5120 RunWafRealisticBenchmark net6.0 192μs 167ns 647ns 0.0962 0 0 6.51 KB
#5120 RunWafRealisticBenchmark netcoreapp3.1 204μs 210ns 813ns 0 0 0 6.49 KB
#5120 RunWafRealisticBenchmark net472 222μs 184ns 712ns 1 0 0 6.59 KB
#5120 RunWafRealisticBenchmarkWithAttack net6.0 126μs 126ns 489ns 0.0628 0 0 4.15 KB
#5120 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 133μs 129ns 481ns 0 0 0 4.14 KB
#5120 RunWafRealisticBenchmarkWithAttack net472 146μs 52.7ns 197ns 0.653 0 0 4.19 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 173μs 153ns 571ns 0.173 0 0 18.26 KB
master SendRequest netcoreapp3.1 193μs 429ns 1.66μs 0.192 0 0 20.42 KB
master SendRequest net472 0.000389ns 0.000226ns 0.000874ns 0 0 0 0 b
#5120 SendRequest net6.0 174μs 204ns 790ns 0.173 0 0 18.26 KB
#5120 SendRequest netcoreapp3.1 193μs 322ns 1.25μs 0.191 0 0 20.42 KB
#5120 SendRequest net472 6.72E‑05ns 5.23E‑05ns 0.000196ns 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 536μs 775ns 3μs 0.558 0 0 41.44 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 913ns 3.54μs 0.319 0 0 41.79 KB
master WriteAndFlushEnrichedTraces net472 838μs 3.92μs 15.7μs 8.45 2.53 0.422 53.24 KB
#5120 WriteAndFlushEnrichedTraces net6.0 538μs 910ns 3.53μs 0.543 0 0 41.62 KB
#5120 WriteAndFlushEnrichedTraces netcoreapp3.1 659μs 1.61μs 5.82μs 0.331 0 0 41.84 KB
#5120 WriteAndFlushEnrichedTraces net472 838μs 4.17μs 18.7μs 8.08 2.55 0.425 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.21μs 0.583ns 2.26ns 0.0109 0 0 776 B
master ExecuteNonQuery netcoreapp3.1 1.53μs 0.614ns 2.38ns 0.00995 0 0 776 B
master ExecuteNonQuery net472 1.85μs 4.13ns 16ns 0.117 0 0 738 B
#5120 ExecuteNonQuery net6.0 1.16μs 0.433ns 1.68ns 0.011 0 0 776 B
#5120 ExecuteNonQuery netcoreapp3.1 1.39μs 0.565ns 2.19ns 0.0104 0 0 776 B
#5120 ExecuteNonQuery net472 1.72μs 3.27ns 12.7ns 0.117 0 0 738 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.591ns 2.21ns 0.0133 0 0 944 B
master CallElasticsearch netcoreapp3.1 1.61μs 1.33ns 4.98ns 0.0121 0 0 944 B
master CallElasticsearch net472 2.53μs 1.15ns 4.47ns 0.153 0 0 963 B
master CallElasticsearchAsync net6.0 1.26μs 1.44ns 5.57ns 0.0126 0 0 920 B
master CallElasticsearchAsync netcoreapp3.1 1.6μs 2.62ns 10.1ns 0.0129 0 0 992 B
master CallElasticsearchAsync net472 2.54μs 1.37ns 5.14ns 0.161 0 0 1.02 KB
#5120 CallElasticsearch net6.0 1.2μs 0.843ns 3.27ns 0.0133 0 0 944 B
#5120 CallElasticsearch netcoreapp3.1 1.52μs 2.58ns 9.66ns 0.0131 0 0 944 B
#5120 CallElasticsearch net472 2.47μs 0.794ns 3.07ns 0.152 0 0 963 B
#5120 CallElasticsearchAsync net6.0 1.21μs 0.875ns 3.27ns 0.0125 0 0 920 B
#5120 CallElasticsearchAsync netcoreapp3.1 1.62μs 0.817ns 2.83ns 0.0137 0 0 992 B
#5120 CallElasticsearchAsync net472 2.7μs 3.26ns 12.6ns 0.162 0 0 1.02 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.35ns 5.22ns 0.0129 0 0 920 B
master ExecuteAsync netcoreapp3.1 1.55μs 1.04ns 4.04ns 0.0124 0 0 920 B
master ExecuteAsync net472 1.82μs 0.715ns 2.77ns 0.14 0 0 883 B
#5120 ExecuteAsync net6.0 1.39μs 0.674ns 2.61ns 0.0125 0 0 920 B
#5120 ExecuteAsync netcoreapp3.1 1.58μs 0.724ns 2.61ns 0.0118 0 0 920 B
#5120 ExecuteAsync net472 1.89μs 1.08ns 4.19ns 0.14 0 0 883 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.11μs 1.85ns 6.91ns 0.0289 0 0 2.1 KB
master SendAsync netcoreapp3.1 5.09μs 2.29ns 8.27ns 0.0357 0 0 2.64 KB
master SendAsync net472 7.72μs 2.7ns 10.4ns 0.524 0 0 3.31 KB
#5120 SendAsync net6.0 4.18μs 1.48ns 5.54ns 0.0291 0 0 2.1 KB
#5120 SendAsync netcoreapp3.1 4.89μs 1.64ns 6.36ns 0.0341 0 0 2.64 KB
#5120 SendAsync net472 7.71μs 3.01ns 11.7ns 0.524 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #5120

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 204.13 KB 201.59 KB -2.54 KB -1.24%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 51.2μs 202ns 758ns 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 60.3μs 595ns 5.9μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.2μs 85.9ns 321ns 0 0 0 61.66 KB
master StringConcatAspectBenchmark net6.0 253μs 3.42μs 31.3μs 0 0 0 204.13 KB
master StringConcatAspectBenchmark netcoreapp3.1 290μs 1.64μs 11.4μs 0 0 0 201.84 KB
master StringConcatAspectBenchmark net472 236μs 1.3μs 7.68μs 0 0 0 229.38 KB
#5120 StringConcatBenchmark net6.0 54.5μs 263ns 1.02μs 0 0 0 43.44 KB
#5120 StringConcatBenchmark netcoreapp3.1 53.6μs 280ns 1.37μs 0 0 0 42.64 KB
#5120 StringConcatBenchmark net472 38μs 83.1ns 311ns 0 0 0 61.42 KB
#5120 StringConcatAspectBenchmark net6.0 256μs 1.31μs 6.14μs 0 0 0 201.59 KB
#5120 StringConcatAspectBenchmark netcoreapp3.1 276μs 1.35μs 8.46μs 0 0 0 201.08 KB
#5120 StringConcatAspectBenchmark net472 233μs 1.16μs 5.3μs 0 0 0 229.38 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.51μs 0.506ns 1.89ns 0.022 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 2.24μs 1.67ns 6.47ns 0.0212 0 0 1.58 KB
master EnrichedLog net472 2.55μs 2.48ns 9.6ns 0.238 0 0 1.51 KB
#5120 EnrichedLog net6.0 1.48μs 0.627ns 2.35ns 0.0222 0 0 1.58 KB
#5120 EnrichedLog netcoreapp3.1 2.22μs 3.6ns 13.9ns 0.0215 0 0 1.58 KB
#5120 EnrichedLog net472 2.64μs 3.39ns 13.1ns 0.239 0 0 1.51 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 66.8ns 259ns 0.0565 0 0 4.22 KB
master EnrichedLog netcoreapp3.1 120μs 150ns 560ns 0 0 0 4.22 KB
master EnrichedLog net472 147μs 109ns 423ns 0.66 0.22 0 4.4 KB
#5120 EnrichedLog net6.0 113μs 92.8ns 359ns 0 0 0 4.22 KB
#5120 EnrichedLog netcoreapp3.1 121μs 114ns 440ns 0 0 0 4.22 KB
#5120 EnrichedLog net472 147μs 74.2ns 278ns 0.664 0.221 0 4.4 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.01μs 0.943ns 3.65ns 0.0303 0 0 2.14 KB
master EnrichedLog netcoreapp3.1 4.3μs 1.16ns 4.2ns 0.0279 0 0 2.14 KB
master EnrichedLog net472 4.83μs 1.27ns 4.91ns 0.311 0 0 1.95 KB
#5120 EnrichedLog net6.0 3.1μs 0.996ns 3.86ns 0.0298 0 0 2.14 KB
#5120 EnrichedLog netcoreapp3.1 4.22μs 2.65ns 9.92ns 0.0294 0 0 2.14 KB
#5120 EnrichedLog net472 4.87μs 1.47ns 5.69ns 0.308 0 0 1.95 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.37μs 0.574ns 2.15ns 0.0157 0 0 1.11 KB
master SendReceive netcoreapp3.1 1.74μs 0.988ns 3.83ns 0.0147 0 0 1.11 KB
master SendReceive net472 2.07μs 1.87ns 7.01ns 0.178 0 0 1.12 KB
#5120 SendReceive net6.0 1.42μs 1.12ns 4.18ns 0.0156 0 0 1.11 KB
#5120 SendReceive netcoreapp3.1 1.82μs 0.555ns 2.15ns 0.0146 0 0 1.11 KB
#5120 SendReceive net472 2.14μs 0.85ns 3.29ns 0.178 0 0 1.12 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.68μs 0.877ns 3.28ns 0.0215 0 0 1.54 KB
master EnrichedLog netcoreapp3.1 3.99μs 1.75ns 6.79ns 0.0201 0 0 1.58 KB
master EnrichedLog net472 4.48μs 2.48ns 9.6ns 0.312 0 0 1.97 KB
#5120 EnrichedLog net6.0 2.91μs 1.06ns 4.12ns 0.0218 0 0 1.54 KB
#5120 EnrichedLog netcoreapp3.1 3.75μs 1.65ns 6.4ns 0.0207 0 0 1.58 KB
#5120 EnrichedLog net472 4.39μs 2.08ns 8.04ns 0.313 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5120

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.150 549.04 477.45
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.124 840.10 747.39

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 549ns 0.0836ns 0.301ns 0.00755 0 0 544 B
master StartFinishSpan netcoreapp3.1 729ns 0.518ns 1.87ns 0.00743 0 0 544 B
master StartFinishSpan net472 841ns 0.25ns 0.968ns 0.0865 0 0 546 B
master StartFinishScope net6.0 585ns 0.209ns 0.81ns 0.00936 0 0 664 B
master StartFinishScope netcoreapp3.1 832ns 0.266ns 0.995ns 0.00912 0 0 664 B
master StartFinishScope net472 968ns 0.216ns 0.78ns 0.0991 0 0 626 B
#5120 StartFinishSpan net6.0 478ns 0.167ns 0.647ns 0.00762 0 0 544 B
#5120 StartFinishSpan netcoreapp3.1 731ns 0.397ns 1.38ns 0.00735 0 0 544 B
#5120 StartFinishSpan net472 748ns 0.177ns 0.612ns 0.0865 0 0 546 B
#5120 StartFinishScope net6.0 545ns 0.202ns 0.784ns 0.00931 0 0 664 B
#5120 StartFinishScope netcoreapp3.1 863ns 0.558ns 2.16ns 0.00898 0 0 664 B
#5120 StartFinishScope net472 1.02μs 0.496ns 1.92ns 0.0993 0 0 626 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5120

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.116 647.58 580.49

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 648ns 0.152ns 0.587ns 0.00937 0 0 664 B
master RunOnMethodBegin netcoreapp3.1 955ns 0.343ns 1.33ns 0.00906 0 0 664 B
master RunOnMethodBegin net472 1.07μs 0.319ns 1.19ns 0.0992 0 0 626 B
#5120 RunOnMethodBegin net6.0 580ns 0.403ns 1.56ns 0.00913 0 0 664 B
#5120 RunOnMethodBegin netcoreapp3.1 910ns 2.74ns 10.6ns 0.0092 0 0 664 B
#5120 RunOnMethodBegin net472 1.08μs 0.415ns 1.61ns 0.099 0 0 626 B

@andrewlock

andrewlock commented Jan 29, 2024

Copy link
Copy Markdown
Member

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 (5120) (11.042M)   : 0, 11041767
    master (10.975M)   : 0, 10975378
    benchmarks/2.9.0 (11.163M)   : 0, 11162756

    section Automatic
    This PR (5120) (7.627M)   : 0, 7626878
    master (7.712M)   : 0, 7712004
    benchmarks/2.9.0 (8.268M)   : 0, 8267853

    section Trace stats
    This PR (5120) (7.972M)   : 0, 7972074
    master (7.900M)   : 0, 7900048

    section Manual
    This PR (5120) (9.764M)   : 0, 9764198
    master (9.590M)   : 0, 9589996

    section Manual + Automatic
    This PR (5120) (7.241M)   : 0, 7241165
    master (7.199M)   : 0, 7199081

    section Version Conflict
    This PR (5120) (6.533M)   : 0, 6532791
    master (6.595M)   : 0, 6594857

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5120) (9.517M)   : 0, 9517260
    master (9.559M)   : 0, 9559250
    benchmarks/2.9.0 (9.367M)   : 0, 9367466

    section Automatic
    This PR (5120) (6.371M)   : 0, 6370673
    master (6.430M)   : 0, 6429697

    section Trace stats
    This PR (5120) (6.795M)   : 0, 6794737
    master (6.913M)   : 0, 6912867

    section Manual
    This PR (5120) (8.151M)   : 0, 8150842
    master (8.113M)   : 0, 8112975

    section Manual + Automatic
    This PR (5120) (6.115M)   : 0, 6114954
    master (6.193M)   : 0, 6193054

    section Version Conflict
    This PR (5120) (5.597M)   : 0, 5596822
    master (5.718M)   : 0, 5718277

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5120) (10.207M)   : 0, 10207379
    master (10.425M)   : 0, 10425449
    benchmarks/2.9.0 (10.212M)   : 0, 10211874

    section Automatic
    This PR (5120) (7.205M)   : 0, 7205148
    master (7.239M)   : 0, 7239076
    benchmarks/2.9.0 (7.605M)   : 0, 7605074

    section Trace stats
    This PR (5120) (7.570M)   : 0, 7569765
    master (7.593M)   : 0, 7592694

    section Manual
    This PR (5120) (9.016M)   : 0, 9015868
    master (9.072M)   : 0, 9071898

    section Manual + Automatic
    This PR (5120) (7.020M)   : 0, 7019944
    master (7.058M)   : 0, 7057785

    section Version Conflict
    This PR (5120) (6.407M)   : 0, 6407354
    master (6.298M)   : 0, 6298452

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    master (7.275M)   : 0, 7275478
    benchmarks/2.9.0 (7.838M)   : 0, 7838185

    section No attack
    master (1.838M)   : 0, 1838305
    benchmarks/2.9.0 (3.252M)   : 0, 3252197

    section Attack
    master (1.464M)   : 0, 1463853
    benchmarks/2.9.0 (2.508M)   : 0, 2508032

    section Blocking
    master (3.176M)   : 0, 3176014

    section IAST default
    master (6.410M)   : 0, 6409716

    section IAST full
    master (5.594M)   : 0, 5594312

    section Base vuln
    master (0.955M)   : 0, 954641

    section IAST vuln
    master (0.875M)   : 0, 874734

Loading

@vandonr vandonr mentioned this pull request Jan 30, 2024

// we can't use generic constraints for this duck typing, because we need the original type
// for the InjectHeadersIntoMessage<TSendMessageRequest> call below
var requestProxy = request.DuckCast<IAmazonSQSRequestWithQueueUrl>();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

checked with @kevingosse that duck-casting to this first and then to the specific I...Request in the methods below is not a problem in https://dd.slack.com/archives/GPTD8CS4C/p1706535183724399

@lucaspimentel lucaspimentel changed the title factorize SQS send/receive instrumentation code refactor SQS send/receive instrumentation code Feb 14, 2024

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

@vandonr

vandonr commented Feb 16, 2024

Copy link
Copy Markdown
Contributor Author

sorry I jumbled everything in the merge commit, I got my git tangled up.

@datadog-ddstaging

datadog-ddstaging Bot commented Feb 16, 2024

Copy link
Copy Markdown

Datadog Report

Branch report: vandonr/refacto
Commit report: 991c187
Test service: dd-trace-dotnet

✅ 0 Failed, 312598 Passed, 1589 Skipped, 40m 22.81s Wall Time

@DataDog DataDog deleted a comment from datadog-ddstaging Bot Feb 16, 2024
Base automatically changed from vandonr/sqs to master February 19, 2024 10:49
@vandonr vandonr requested a review from a team February 19, 2024 10:49
@vandonr vandonr requested a review from a team as a code owner February 19, 2024 10:49
@vandonr vandonr merged commit 98b6687 into master Feb 19, 2024
@vandonr vandonr deleted the vandonr/refacto branch February 19, 2024 12:32
@github-actions github-actions Bot added this to the vNext milestone Feb 19, 2024
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