dd-trace-dotnet icon indicating copy to clipboard operation
dd-trace-dotnet copied to clipboard

[v3] Add DSM checkpoints to the public inject/extract API

Open vandonr opened this issue 1 year ago • 4 comments

Summary of changes

DSM asked for a public interface that'd allow users to manually set checkpoints, so that DSM can be used with exotic systems. It's been done in Java with a specialized method, see this doc At the same time, there was a reflection in dotnet in this document about including checkpointing as part of the existing methods that can be used to inject or extract trace context (for distributed tracing).

Implementation details

I added an overload (actually not an overload because it has a different name, but almost) to the extract and inject methods, taking the necessary extra parameters for checkpointing. If they are passed, on top of the current method responsibilities (dealing with distributed tracing), it also deals with DSM checkpointing and context injection.

Test coverage

TODO


AIT-9676

vandonr avatar Jan 31 '24 14:01 vandonr

Datadog Report

Branch report: vandonr/dsm Commit report: 0f8310d Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 337118 Passed, 2312 Skipped, 49m 41.99s Wall Time

datadog-ddstaging[bot] avatar Jan 31 '24 14:01 datadog-ddstaging[bot]

Execution-Time Benchmarks Report :stopwatch:

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 (5128) - mean (74ms)  : 65, 84
     .   : milestone, 74,
    master - mean (85ms)  : 61, 108
     .   : milestone, 85,

    section CallTarget+Inlining+NGEN
    This PR (5128) - mean (1,008ms)  : 989, 1028
     .   : milestone, 1008,
    master - mean (998ms)  : 978, 1018
     .   : milestone, 998,

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

    section CallTarget+Inlining+NGEN
    This PR (5128) - mean (731ms)  : 709, 754
     .   : milestone, 731,
    master - mean (712ms)  : 692, 733
     .   : milestone, 712,

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

    section CallTarget+Inlining+NGEN
    This PR (5128) - mean (686ms)  : 662, 709
     .   : milestone, 686,
    master - mean (670ms)  : 645, 696
     .   : milestone, 670,

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

    section CallTarget+Inlining+NGEN
    This PR (5128) - mean (1,084ms)  : 1049, 1120
     .   : milestone, 1084,
    master - mean (1,068ms)  : 1047, 1089
     .   : milestone, 1068,

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

    section CallTarget+Inlining+NGEN
    This PR (5128) - mean (880ms)  : 858, 902
     .   : milestone, 880,
    master - mean (866ms)  : 838, 895
     .   : milestone, 866,

gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5128) - mean (259ms)  : 253, 265
     .   : milestone, 259,
    master - mean (259ms)  : 252, 266
     .   : milestone, 259,

    section CallTarget+Inlining+NGEN
    This PR (5128) - mean (868ms)  : 841, 896
     .   : milestone, 868,
    master - mean (856ms)  : 822, 889
     .   : milestone, 856,

andrewlock avatar Jan 31 '24 14:01 andrewlock

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 (5128) (11.321M)   : 0, 11321035
    master (11.355M)   : 0, 11355258
    benchmarks/2.9.0 (11.163M)   : 0, 11163221

    section Automatic
    This PR (5128) (7.770M)   : 0, 7769845
    master (7.892M)   : 0, 7891710
    benchmarks/2.9.0 (8.041M)   : 0, 8041123

    section Trace stats
    This PR (5128) (8.211M)   : 0, 8211000
    master (8.117M)   : 0, 8116633

    section Manual
    This PR (5128) (11.359M)   : 0, 11358697
    master (9.966M)   : 0, 9966286

    section Manual + Automatic
    This PR (5128) (7.195M)   : 0, 7194680
    master (7.418M)   : 0, 7418265

gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5128) (9.729M)   : 0, 9728630
    master (9.348M)   : 0, 9348402
    benchmarks/2.9.0 (9.499M)   : 0, 9498789

    section Automatic
    This PR (5128) (6.680M)   : 0, 6680382
    master (6.324M)   : 0, 6324218

    section Trace stats
    This PR (5128) (6.855M)   : 0, 6855105
    master (6.931M)   : 0, 6930643

    section Manual
    This PR (5128) (9.403M)   : 0, 9403013
    master (8.193M)   : 0, 8192839

    section Manual + Automatic
    This PR (5128) (6.207M)   : 0, 6206874
    master (6.146M)   : 0, 6145919

gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5128) (8.559M)   : 0, 8559038
    master (8.820M)   : 0, 8819834
    benchmarks/2.9.0 (8.713M)   : 0, 8712570

    section Automatic
    This PR (5128) (6.244M)   : 0, 6244185
    master (6.189M)   : 0, 6188747
    benchmarks/2.9.0 (6.427M)   : 0, 6427457

    section Trace stats
    This PR (5128) (6.356M)   : 0, 6356171
    master (6.432M)   : 0, 6431860

    section Manual
    This PR (5128) (8.693M)   : 0, 8692834
    master (7.498M)   : 0, 7498128

    section Manual + Automatic
    This PR (5128) (5.771M)   : 0, 5770989
    master (5.972M)   : 0, 5972087

andrewlock avatar Jan 31 '24 16:01 andrewlock

Benchmarks Report :snail:

Benchmarks for #5128 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.209
  • 1 benchmarks have fewer allocations
  • 3 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 :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 8.78μs 48.6ns 292ns 0.0216 0.00863 0 7.49 KB
master StartStopWithChild netcoreapp3.1 10.5μs 56.1ns 317ns 0.021 0.0105 0 7.59 KB
master StartStopWithChild net472 17.5μs 59.5ns 230ns 1.33 0.347 0.107 7.96 KB
#5128 StartStopWithChild net6.0 8.77μs 49.5ns 328ns 0.0267 0.00891 0 7.49 KB
#5128 StartStopWithChild netcoreapp3.1 10.6μs 56.9ns 322ns 0.0267 0.0107 0 7.58 KB
#5128 StartStopWithChild net472 16.9μs 74.7ns 289ns 1.34 0.361 0.117 7.95 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 454μs 253ns 981ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 628μs 318ns 1.23μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 813μs 227ns 817ns 0.403 0 0 3.3 KB
#5128 WriteAndFlushEnrichedTraces net6.0 465μs 302ns 1.09μs 0 0 0 2.7 KB
#5128 WriteAndFlushEnrichedTraces netcoreapp3.1 628μs 260ns 1.01μs 0 0 0 2.7 KB
#5128 WriteAndFlushEnrichedTraces net472 813μs 382ns 1.48μs 0.406 0 0 3.3 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 40.6μs 16.6ns 64.2ns 0.0203 0 0 2.36 KB
master AllCycleSimpleBody netcoreapp3.1 43.7μs 42.5ns 165ns 0.0217 0 0 2.34 KB
master AllCycleSimpleBody net472 46.7μs 18.7ns 72.5ns 0.374 0 0 2.41 KB
master AllCycleMoreComplexBody net6.0 216μs 299ns 1.16μs 0.106 0 0 9.84 KB
master AllCycleMoreComplexBody netcoreapp3.1 226μs 337ns 1.31μs 0.113 0 0 9.73 KB
master AllCycleMoreComplexBody net472 242μs 77.9ns 302ns 1.57 0 0 9.91 KB
master ObjectExtractorSimpleBody net6.0 142ns 0.0578ns 0.2ns 0.00396 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 199ns 0.18ns 0.698ns 0.0037 0 0 272 B
master ObjectExtractorSimpleBody net472 172ns 0.061ns 0.236ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.02μs 1.48ns 5.33ns 0.053 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.15μs 10.2ns 38ns 0.0494 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.8μs 3.05ns 11.8ns 0.602 0.00568 0 3.8 KB
#5128 AllCycleSimpleBody net6.0 41.2μs 48.9ns 189ns 0.0204 0 0 2.36 KB
#5128 AllCycleSimpleBody netcoreapp3.1 44.2μs 47.1ns 183ns 0.0221 0 0 2.34 KB
#5128 AllCycleSimpleBody net472 47.1μs 13.5ns 50.4ns 0.374 0 0 2.41 KB
#5128 AllCycleMoreComplexBody net6.0 212μs 77.5ns 300ns 0.107 0 0 9.84 KB
#5128 AllCycleMoreComplexBody netcoreapp3.1 228μs 412ns 1.6μs 0.113 0 0 9.73 KB
#5128 AllCycleMoreComplexBody net472 241μs 28.9ns 108ns 1.56 0 0 9.91 KB
#5128 ObjectExtractorSimpleBody net6.0 156ns 0.102ns 0.38ns 0.00394 0 0 280 B
#5128 ObjectExtractorSimpleBody netcoreapp3.1 202ns 0.194ns 0.75ns 0.00375 0 0 272 B
#5128 ObjectExtractorSimpleBody net472 174ns 0.0845ns 0.327ns 0.0445 0 0 281 B
#5128 ObjectExtractorMoreComplexBody net6.0 3.12μs 1.6ns 6ns 0.0534 0 0 3.78 KB
#5128 ObjectExtractorMoreComplexBody netcoreapp3.1 4.01μs 1.73ns 6.48ns 0.05 0 0 3.69 KB
#5128 ObjectExtractorMoreComplexBody net472 3.85μs 3.07ns 11.1ns 0.602 0.00579 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 52.9μs 53.9ns 209ns 0.423 0 0 30.94 KB
master EncodeArgs netcoreapp3.1 69.2μs 91ns 341ns 0.418 0 0 31.47 KB
master EncodeArgs net472 83.3μs 45.7ns 177ns 5.11 0.0832 0 32.27 KB
master EncodeLegacyArgs net6.0 126μs 304ns 1.18μs 0.444 0 0 33.89 KB
master EncodeLegacyArgs netcoreapp3.1 154μs 452ns 1.75μs 0.455 0 0 34.09 KB
master EncodeLegacyArgs net472 214μs 876ns 3.39μs 5.52 0.424 0 34.99 KB
#5128 EncodeArgs net6.0 50.9μs 63.9ns 239ns 0.433 0 0 30.94 KB
#5128 EncodeArgs netcoreapp3.1 68μs 67.4ns 261ns 0.409 0 0 31.47 KB
#5128 EncodeArgs net472 84.8μs 91.1ns 353ns 5.13 0.0841 0 32.27 KB
#5128 EncodeLegacyArgs net6.0 123μs 541ns 2.03μs 0.476 0 0 33.89 KB
#5128 EncodeLegacyArgs netcoreapp3.1 154μs 509ns 1.91μs 0.46 0 0 34.09 KB
#5128 EncodeLegacyArgs net472 214μs 143ns 552ns 5.46 0.42 0 34.99 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 190μs 158ns 610ns 0.0962 0 0 6.51 KB
master RunWafRealisticBenchmark netcoreapp3.1 205μs 255ns 953ns 0 0 0 6.49 KB
master RunWafRealisticBenchmark net472 223μs 137ns 530ns 1 0 0 6.59 KB
master RunWafRealisticBenchmarkWithAttack net6.0 126μs 61.5ns 238ns 0 0 0 4.15 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 135μs 164ns 634ns 0 0 0 4.14 KB
master RunWafRealisticBenchmarkWithAttack net472 148μs 74.3ns 268ns 0.659 0 0 4.19 KB
#5128 RunWafRealisticBenchmark net6.0 190μs 102ns 396ns 0.0948 0 0 6.51 KB
#5128 RunWafRealisticBenchmark netcoreapp3.1 206μs 164ns 635ns 0 0 0 6.49 KB
#5128 RunWafRealisticBenchmark net472 223μs 108ns 404ns 1.02 0 0 6.59 KB
#5128 RunWafRealisticBenchmarkWithAttack net6.0 125μs 50.8ns 197ns 0.0628 0 0 4.15 KB
#5128 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 135μs 226ns 874ns 0 0 0 4.14 KB
#5128 RunWafRealisticBenchmarkWithAttack net472 147μs 78.8ns 305ns 0.659 0 0 4.19 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 168μs 282ns 1.05μs 0.251 0 0 18.26 KB
master SendRequest netcoreapp3.1 191μs 213ns 796ns 0.191 0 0 20.42 KB
master SendRequest net472 0.000834ns 0.000387ns 0.00145ns 0 0 0 0 b
#5128 SendRequest net6.0 170μs 176ns 681ns 0.255 0 0 18.27 KB
#5128 SendRequest netcoreapp3.1 192μs 195ns 728ns 0.192 0 0 20.42 KB
#5128 SendRequest net472 0.000494ns 0.000215ns 0.000831ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed :heavy_check_mark: More allocations :warning:

More allocations :warning: in #5128

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.4 KB 41.64 KB 241 B 0.58%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 534μs 2.64μs 10.9μs 0.553 0 0 41.4 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 656μs 778ns 2.91μs 0.334 0 0 41.89 KB
master WriteAndFlushEnrichedTraces net472 846μs 3.74μs 14.5μs 8.08 2.55 0.425 53.25 KB
#5128 WriteAndFlushEnrichedTraces net6.0 560μs 1.28μs 4.94μs 0.561 0 0 41.64 KB
#5128 WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 678ns 2.63μs 0.324 0 0 41.77 KB
#5128 WriteAndFlushEnrichedTraces net472 843μs 3.28μs 12.7μs 8.39 2.52 0.419 53.24 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.13μs 0.507ns 1.9ns 0.0108 0 0 776 B
master ExecuteNonQuery netcoreapp3.1 1.47μs 0.866ns 3.35ns 0.0102 0 0 776 B
master ExecuteNonQuery net472 1.69μs 0.891ns 3.21ns 0.117 0 0 738 B
#5128 ExecuteNonQuery net6.0 1.07μs 0.519ns 2.01ns 0.0107 0 0 776 B
#5128 ExecuteNonQuery netcoreapp3.1 1.44μs 6.9ns 27.6ns 0.0106 0 0 776 B
#5128 ExecuteNonQuery net472 1.74μs 1.79ns 6.46ns 0.117 0 0 738 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.24μs 0.718ns 2.68ns 0.0131 0 0 944 B
master CallElasticsearch netcoreapp3.1 1.56μs 0.799ns 2.88ns 0.0124 0 0 944 B
master CallElasticsearch net472 2.4μs 1.07ns 4.14ns 0.152 0 0 963 B
master CallElasticsearchAsync net6.0 1.22μs 0.713ns 2.76ns 0.0133 0 0 920 B
master CallElasticsearchAsync netcoreapp3.1 1.67μs 0.731ns 2.83ns 0.0133 0 0 992 B
master CallElasticsearchAsync net472 2.55μs 1.55ns 6.01ns 0.162 0 0 1.02 KB
#5128 CallElasticsearch net6.0 1.19μs 0.432ns 1.62ns 0.0133 0 0 944 B
#5128 CallElasticsearch netcoreapp3.1 1.46μs 2.87ns 10.4ns 0.0124 0 0 944 B
#5128 CallElasticsearch net472 2.5μs 0.808ns 3.13ns 0.153 0 0 963 B
#5128 CallElasticsearchAsync net6.0 1.19μs 0.34ns 1.23ns 0.0128 0 0 920 B
#5128 CallElasticsearchAsync netcoreapp3.1 1.57μs 1.04ns 3.76ns 0.0135 0 0 992 B
#5128 CallElasticsearchAsync net472 2.58μs 1.06ns 3.98ns 0.162 0 0 1.02 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.3μs 0.832ns 3.11ns 0.0129 0 0 920 B
master ExecuteAsync netcoreapp3.1 1.62μs 1.01ns 3.79ns 0.0122 0 0 920 B
master ExecuteAsync net472 1.86μs 0.549ns 2.06ns 0.14 0 0 883 B
#5128 ExecuteAsync net6.0 1.28μs 0.379ns 1.42ns 0.0128 0 0 920 B
#5128 ExecuteAsync netcoreapp3.1 1.65μs 0.922ns 3.19ns 0.0123 0 0 920 B
#5128 ExecuteAsync net472 1.93μs 3.02ns 10.5ns 0.14 0 0 883 B
Benchmarks.Trace.HttpClientBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.1μs 3.81ns 14.7ns 0.029 0 0 2.1 KB
master SendAsync netcoreapp3.1 4.82μs 1.63ns 5.88ns 0.0362 0 0 2.64 KB
master SendAsync net472 7.74μs 2.53ns 9.47ns 0.524 0 0 3.31 KB
#5128 SendAsync net6.0 3.97μs 0.911ns 3.41ns 0.0299 0 0 2.1 KB
#5128 SendAsync netcoreapp3.1 4.87μs 2.34ns 9.08ns 0.034 0 0 2.64 KB
#5128 SendAsync net472 7.73μs 2.7ns 10.5ns 0.523 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed :heavy_check_mark: More allocations :warning:

More allocations :warning: in #5128

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 221.18 KB 231.65 KB 10.46 KB 4.73%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 202.89 KB 212.26 KB 9.38 KB 4.62%

Fewer allocations :tada: in #5128

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 205.46 KB 201.95 KB -3.51 KB -1.71%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 60.2μs 846ns 8.2μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 52.8μs 226ns 781ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.4μs 80.6ns 290ns 0 0 0 59.26 KB
master StringConcatAspectBenchmark net6.0 286μs 5.49μs 54.3μs 0 0 0 205.46 KB
master StringConcatAspectBenchmark netcoreapp3.1 275μs 1.4μs 8.54μs 0 0 0 202.89 KB
master StringConcatAspectBenchmark net472 232μs 1.16μs 5.31μs 0 0 0 221.18 KB
#5128 StringConcatBenchmark net6.0 50.1μs 133ns 497ns 0 0 0 43.44 KB
#5128 StringConcatBenchmark netcoreapp3.1 56.2μs 569ns 5.61μs 0 0 0 42.64 KB
#5128 StringConcatBenchmark net472 37.5μs 93.8ns 338ns 0 0 0 59.07 KB
#5128 StringConcatAspectBenchmark net6.0 264μs 1.51μs 11.1μs 0 0 0 201.95 KB
#5128 StringConcatAspectBenchmark netcoreapp3.1 287μs 1.61μs 10.8μs 0 0 0 212.26 KB
#5128 StringConcatAspectBenchmark net472 228μs 1.23μs 7.09μs 0 0 0 231.65 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.47μs 0.906ns 3.51ns 0.0222 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 2.16μs 1.72ns 6.65ns 0.0217 0 0 1.58 KB
master EnrichedLog net472 2.53μs 1.35ns 5.21ns 0.239 0 0 1.51 KB
#5128 EnrichedLog net6.0 1.62μs 0.613ns 2.37ns 0.0222 0 0 1.58 KB
#5128 EnrichedLog netcoreapp3.1 2.12μs 1.45ns 5.61ns 0.0214 0 0 1.58 KB
#5128 EnrichedLog net472 2.46μs 2.39ns 9.26ns 0.239 0 0 1.51 KB
Benchmarks.Trace.Log4netBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 114μs 278ns 1.08μs 0.0567 0 0 4.22 KB
master EnrichedLog netcoreapp3.1 118μs 112ns 434ns 0 0 0 4.22 KB
master EnrichedLog net472 147μs 77.4ns 290ns 0.658 0.219 0 4.4 KB
#5128 EnrichedLog net6.0 113μs 75.4ns 282ns 0.0563 0 0 4.22 KB
#5128 EnrichedLog netcoreapp3.1 118μs 155ns 582ns 0.0587 0 0 4.22 KB
#5128 EnrichedLog net472 149μs 218ns 844ns 0.669 0.223 0 4.4 KB
Benchmarks.Trace.NLogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.96μs 0.994ns 3.85ns 0.0296 0 0 2.14 KB
master EnrichedLog netcoreapp3.1 4.16μs 1.5ns 5.83ns 0.0292 0 0 2.14 KB
master EnrichedLog net472 4.9μs 2.74ns 10.3ns 0.309 0 0 1.95 KB
#5128 EnrichedLog net6.0 3.17μs 0.829ns 3.1ns 0.0294 0 0 2.14 KB
#5128 EnrichedLog netcoreapp3.1 4.26μs 1.96ns 7.61ns 0.0276 0 0 2.14 KB
#5128 EnrichedLog net472 4.7μs 1.9ns 7.34ns 0.311 0 0 1.95 KB
Benchmarks.Trace.RedisBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.46μs 0.448ns 1.73ns 0.016 0 0 1.11 KB
master SendReceive netcoreapp3.1 1.84μs 1.57ns 6.09ns 0.0146 0 0 1.11 KB
master SendReceive net472 2.19μs 1.56ns 6.05ns 0.178 0 0 1.12 KB
#5128 SendReceive net6.0 1.32μs 0.547ns 2.12ns 0.0157 0 0 1.11 KB
#5128 SendReceive netcoreapp3.1 1.76μs 1.08ns 4.17ns 0.0148 0 0 1.11 KB
#5128 SendReceive net472 2.09μs 0.691ns 2.59ns 0.178 0 0 1.12 KB
Benchmarks.Trace.SerilogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.84μs 0.956ns 3.31ns 0.0213 0 0 1.54 KB
master EnrichedLog netcoreapp3.1 3.85μs 1.81ns 6.54ns 0.0213 0 0 1.58 KB
master EnrichedLog net472 4.27μs 2.2ns 8.22ns 0.312 0 0 1.97 KB
#5128 EnrichedLog net6.0 2.88μs 1.04ns 4.01ns 0.0217 0 0 1.54 KB
#5128 EnrichedLog netcoreapp3.1 3.91μs 1.36ns 5.28ns 0.0198 0 0 1.58 KB
#5128 EnrichedLog net472 4.33μs 3.27ns 12.7ns 0.313 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #5128

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.165 515.78 442.55

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 515ns 0.492ns 1.77ns 0.00751 0 0 544 B
master StartFinishSpan netcoreapp3.1 722ns 0.691ns 2.59ns 0.00718 0 0 544 B
master StartFinishSpan net472 752ns 0.957ns 3.71ns 0.0865 0 0 546 B
master StartFinishScope net6.0 605ns 0.484ns 1.87ns 0.00915 0 0 664 B
master StartFinishScope netcoreapp3.1 829ns 1.08ns 4.2ns 0.0089 0 0 664 B
master StartFinishScope net472 1.03μs 3.04ns 11.8ns 0.0991 0 0 626 B
#5128 StartFinishSpan net6.0 441ns 0.971ns 3.76ns 0.0077 0 0 544 B
#5128 StartFinishSpan netcoreapp3.1 739ns 1.18ns 4.57ns 0.00736 0 0 544 B
#5128 StartFinishSpan net472 718ns 1.6ns 6.21ns 0.0865 0 0 546 B
#5128 StartFinishScope net6.0 617ns 1.18ns 4.55ns 0.00924 0 0 664 B
#5128 StartFinishScope netcoreapp3.1 790ns 1.3ns 5.03ns 0.00907 0 0 664 B
#5128 StartFinishScope net472 946ns 1.76ns 6.81ns 0.0993 0 0 626 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #5128

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.254 746.09 594.88

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 746ns 0.669ns 2.5ns 0.00931 0 0 664 B
master RunOnMethodBegin netcoreapp3.1 1.05μs 0.785ns 3.04ns 0.00899 0 0 664 B
master RunOnMethodBegin net472 1.05μs 1.75ns 6.76ns 0.0995 0 0 626 B
#5128 RunOnMethodBegin net6.0 594ns 0.856ns 3.32ns 0.00914 0 0 664 B
#5128 RunOnMethodBegin netcoreapp3.1 984ns 2.24ns 8.68ns 0.00895 0 0 664 B
#5128 RunOnMethodBegin net472 1.08μs 2.39ns 9.25ns 0.0991 0 0 626 B

andrewlock avatar Feb 01 '24 02:02 andrewlock

Benchmarks Report for tracer :snail:

Benchmarks for #5128 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.216
  • 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 :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 8.62μs 45.1ns 285ns 0.0218 0.00874 0 7.51 KB
master StartStopWithChild netcoreapp3.1 10.5μs 58.6ns 361ns 0.0382 0.0164 0.00546 7.6 KB
master StartStopWithChild net472 16.9μs 68.8ns 267ns 1.37 0.372 0.124 8.06 KB
#5128 StartStopWithChild net6.0 8.66μs 47.9ns 284ns 0.0307 0.0131 0 7.5 KB
#5128 StartStopWithChild netcoreapp3.1 10.7μs 57ns 285ns 0.0311 0.0155 0 7.6 KB
#5128 StartStopWithChild net472 17.1μs 45.1ns 175ns 1.35 0.347 0.11 8.05 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 451μs 137ns 494ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 626μs 192ns 717ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 816μs 323ns 1.25μs 0.406 0 0 3.3 KB
#5128 WriteAndFlushEnrichedTraces net6.0 447μs 286ns 1.07μs 0 0 0 2.7 KB
#5128 WriteAndFlushEnrichedTraces netcoreapp3.1 589μs 218ns 815ns 0 0 0 2.7 KB
#5128 WriteAndFlushEnrichedTraces net472 801μs 401ns 1.5μs 0.398 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 175μs 225ns 871ns 0.259 0 0 18.33 KB
master SendRequest netcoreapp3.1 191μs 371ns 1.39μs 0.193 0 0 20.49 KB
master SendRequest net472 0.000155ns 0.00014ns 0.000504ns 0 0 0 0 b
#5128 SendRequest net6.0 175μs 223ns 864ns 0.261 0 0 18.33 KB
#5128 SendRequest netcoreapp3.1 192μs 354ns 1.37μs 0.19 0 0 20.49 KB
#5128 SendRequest net472 0.00149ns 0.000303ns 0.00109ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed :heavy_check_mark: More allocations :warning:

More allocations :warning: in #5128

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.49 KB 41.86 KB 374 B 0.90%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 540μs 1.31μs 5.07μs 0.546 0 0 41.49 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 657μs 1.46μs 5.64μs 0.331 0 0 41.8 KB
master WriteAndFlushEnrichedTraces net472 885μs 2.09μs 7.82μs 8.3 2.62 0.437 53.25 KB
#5128 WriteAndFlushEnrichedTraces net6.0 548μs 949ns 3.67μs 0.543 0 0 41.86 KB
#5128 WriteAndFlushEnrichedTraces netcoreapp3.1 655μs 1.16μs 4.48μs 0.324 0 0 41.66 KB
#5128 WriteAndFlushEnrichedTraces net472 853μs 3.63μs 14.1μs 8.45 2.53 0.422 53.23 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.22μs 0.27ns 1.01ns 0.011 0 0 784 B
master ExecuteNonQuery netcoreapp3.1 1.53μs 1.78ns 6.88ns 0.0101 0 0 784 B
master ExecuteNonQuery net472 1.87μs 0.585ns 2.19ns 0.118 0 0 746 B
#5128 ExecuteNonQuery net6.0 1.2μs 0.66ns 2.55ns 0.0108 0 0 784 B
#5128 ExecuteNonQuery netcoreapp3.1 1.55μs 1.88ns 7.27ns 0.01 0 0 784 B
#5128 ExecuteNonQuery net472 1.88μs 1.03ns 3.99ns 0.118 0 0 746 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #5128

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 1.216 1,531.45 1,259.17

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.2μs 0.412ns 1.6ns 0.0144 0 0 1.01 KB
master CallElasticsearch netcoreapp3.1 1.64μs 1.33ns 5.14ns 0.0138 0 0 1.01 KB
master CallElasticsearch net472 2.55μs 1.26ns 4.73ns 0.161 0 0 1.02 KB
master CallElasticsearchAsync net6.0 1.53μs 1.04ns 3.9ns 0.0138 0 0 984 B
master CallElasticsearchAsync netcoreapp3.1 1.8μs 4.97ns 21.1ns 0.0135 0 0 1.06 KB
master CallElasticsearchAsync net472 2.56μs 0.733ns 2.74ns 0.17 0 0 1.08 KB
#5128 CallElasticsearch net6.0 1.28μs 0.57ns 2.06ns 0.0142 0 0 1.01 KB
#5128 CallElasticsearch netcoreapp3.1 1.64μs 0.93ns 3.48ns 0.0132 0 0 1.01 KB
#5128 CallElasticsearch net472 2.42μs 0.856ns 3.2ns 0.162 0 0 1.02 KB
#5128 CallElasticsearchAsync net6.0 1.26μs 0.479ns 1.79ns 0.014 0 0 984 B
#5128 CallElasticsearchAsync netcoreapp3.1 1.69μs 1.43ns 5.34ns 0.0144 0 0 1.06 KB
#5128 CallElasticsearchAsync net472 2.65μs 2.1ns 8.13ns 0.171 0 0 1.08 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.3μs 0.576ns 2.23ns 0.0131 0 0 928 B
master ExecuteAsync netcoreapp3.1 1.68μs 0.939ns 3.64ns 0.012 0 0 928 B
master ExecuteAsync net472 1.93μs 0.724ns 2.8ns 0.141 0 0 891 B
#5128 ExecuteAsync net6.0 1.43μs 3.32ns 12.9ns 0.0128 0 0 928 B
#5128 ExecuteAsync netcoreapp3.1 1.68μs 2.43ns 9.1ns 0.0126 0 0 928 B
#5128 ExecuteAsync net472 1.91μs 1.19ns 4.6ns 0.142 0 0 891 B
Benchmarks.Trace.HttpClientBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.16μs 3.05ns 11.8ns 0.0292 0 0 2.16 KB
master SendAsync netcoreapp3.1 5.03μs 8.78ns 31.6ns 0.0377 0 0 2.7 KB
master SendAsync net472 7.71μs 2.54ns 9.85ns 0.482 0 0 3.05 KB
#5128 SendAsync net6.0 4.37μs 12.9ns 48.1ns 0.0298 0 0 2.16 KB
#5128 SendAsync netcoreapp3.1 5.18μs 3.1ns 12ns 0.0361 0 0 2.7 KB
#5128 SendAsync net472 7.71μs 3.76ns 14.6ns 0.483 0 0 3.05 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.56μs 1.48ns 5.74ns 0.0234 0 0 1.65 KB
master EnrichedLog netcoreapp3.1 2.35μs 1.07ns 3.85ns 0.0222 0 0 1.65 KB
master EnrichedLog net472 2.78μs 1.24ns 4.47ns 0.249 0 0 1.57 KB
#5128 EnrichedLog net6.0 1.55μs 1.25ns 4.69ns 0.0232 0 0 1.65 KB
#5128 EnrichedLog netcoreapp3.1 2.37μs 0.502ns 1.81ns 0.0224 0 0 1.65 KB
#5128 EnrichedLog net472 2.76μs 3.02ns 11.7ns 0.25 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 112μs 63.9ns 247ns 0.0558 0 0 4.23 KB
master EnrichedLog netcoreapp3.1 117μs 112ns 433ns 0.0584 0 0 4.23 KB
master EnrichedLog net472 146μs 52.1ns 202ns 0.655 0.218 0 4.41 KB
#5128 EnrichedLog net6.0 112μs 117ns 438ns 0.0557 0 0 4.23 KB
#5128 EnrichedLog netcoreapp3.1 116μs 87.3ns 327ns 0.0581 0 0 4.23 KB
#5128 EnrichedLog net472 147μs 114ns 440ns 0.659 0.22 0 4.41 KB
Benchmarks.Trace.NLogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.99μs 1.28ns 4.95ns 0.0299 0 0 2.21 KB
master EnrichedLog netcoreapp3.1 4.32μs 1.38ns 4.98ns 0.0283 0 0 2.21 KB
master EnrichedLog net472 4.78μs 2.67ns 10.3ns 0.319 0 0 2.02 KB
#5128 EnrichedLog net6.0 2.98μs 0.877ns 3.16ns 0.0313 0 0 2.21 KB
#5128 EnrichedLog netcoreapp3.1 4.16μs 2.39ns 8.93ns 0.0291 0 0 2.21 KB
#5128 EnrichedLog net472 4.96μs 3.17ns 12.3ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.41μs 0.866ns 3.35ns 0.0162 0 0 1.18 KB
master SendReceive netcoreapp3.1 1.94μs 1.4ns 5.4ns 0.0161 0 0 1.18 KB
master SendReceive net472 2.41μs 2.36ns 8.83ns 0.186 0.0012 0 1.18 KB
#5128 SendReceive net6.0 1.39μs 1.82ns 6.82ns 0.0161 0 0 1.18 KB
#5128 SendReceive netcoreapp3.1 1.8μs 0.71ns 2.75ns 0.0153 0 0 1.18 KB
#5128 SendReceive net472 2.38μs 1.13ns 4.38ns 0.187 0.00119 0 1.18 KB
Benchmarks.Trace.SerilogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.71μs 0.974ns 3.77ns 0.0217 0 0 1.55 KB
master EnrichedLog netcoreapp3.1 3.86μs 1.87ns 7ns 0.0213 0 0 1.6 KB
master EnrichedLog net472 4.45μs 1.01ns 3.78ns 0.315 0 0 1.99 KB
#5128 EnrichedLog net6.0 2.8μs 1.08ns 4.18ns 0.021 0 0 1.55 KB
#5128 EnrichedLog netcoreapp3.1 3.8μs 2.09ns 7.53ns 0.021 0 0 1.6 KB
#5128 EnrichedLog net472 4.52μs 2.29ns 8.85ns 0.315 0 0 1.99 KB
Benchmarks.Trace.SpanBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 520ns 0.67ns 2.6ns 0.00766 0 0 552 B
master StartFinishSpan netcoreapp3.1 685ns 1.66ns 6.21ns 0.00742 0 0 552 B
master StartFinishSpan net472 745ns 1.13ns 4.37ns 0.0878 0 0 554 B
master StartFinishScope net6.0 600ns 0.867ns 3.36ns 0.0094 0 0 672 B
master StartFinishScope netcoreapp3.1 794ns 1.35ns 5.24ns 0.00902 0 0 672 B
master StartFinishScope net472 955ns 1.87ns 7.26ns 0.1 0 0 634 B
#5128 StartFinishSpan net6.0 559ns 1.09ns 4.22ns 0.00773 0 0 552 B
#5128 StartFinishSpan netcoreapp3.1 647ns 1.69ns 6.53ns 0.00769 0 0 552 B
#5128 StartFinishSpan net472 819ns 2.29ns 8.86ns 0.0876 0 0 554 B
#5128 StartFinishScope net6.0 598ns 1.13ns 4.37ns 0.0095 0 0 672 B
#5128 StartFinishScope netcoreapp3.1 822ns 2.27ns 8.8ns 0.00883 0 0 672 B
#5128 StartFinishScope net472 879ns 1.99ns 7.7ns 0.101 0 0 634 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 644ns 0.685ns 2.65ns 0.00926 0 0 672 B
master RunOnMethodBegin netcoreapp3.1 976ns 1.95ns 7.57ns 0.00895 0 0 672 B
master RunOnMethodBegin net472 1.11μs 2.56ns 9.9ns 0.101 0 0 634 B
#5128 RunOnMethodBegin net6.0 671ns 1.22ns 4.71ns 0.00946 0 0 672 B
#5128 RunOnMethodBegin netcoreapp3.1 1.02μs 1.85ns 7.17ns 0.00906 0 0 672 B
#5128 RunOnMethodBegin net472 1.09μs 2.63ns 10.2ns 0.101 0 0 634 B

andrewlock avatar Mar 19 '24 16:03 andrewlock

Benchmarks Report for appsec :snail:

Benchmarks for #5128 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.266
  • 1 benchmarks have fewer allocations
  • 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.Asm.AppSecBodyBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #5128

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 1.329 216.61 162.96
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑netcoreapp3.1 1.206 273.36 226.58

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 74.4μs 143ns 535ns 0.0731 0 0 5.97 KB
master AllCycleSimpleBody netcoreapp3.1 60.9μs 69.4ns 260ns 0.0911 0 0 6.92 KB
master AllCycleSimpleBody net472 48.3μs 57.2ns 206ns 1.3 0 0 8.3 KB
master AllCycleMoreComplexBody net6.0 79.2μs 128ns 494ns 0.12 0 0 9.48 KB
master AllCycleMoreComplexBody netcoreapp3.1 68.7μs 56.3ns 211ns 0.137 0 0 10.33 KB
master AllCycleMoreComplexBody net472 55.9μs 69.9ns 350ns 1.87 0.0279 0 11.82 KB
master ObjectExtractorSimpleBody net6.0 144ns 0.167ns 0.648ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 274ns 0.718ns 2.78ns 0.00369 0 0 272 B
master ObjectExtractorSimpleBody net472 217ns 0.0877ns 0.328ns 0.0445 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.05μs 1.44ns 5.59ns 0.0536 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.94μs 1.97ns 7.36ns 0.0501 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.79μs 3.1ns 12ns 0.603 0.00572 0 3.8 KB
#5128 AllCycleSimpleBody net6.0 73.3μs 86.3ns 334ns 0.0729 0 0 5.97 KB
#5128 AllCycleSimpleBody netcoreapp3.1 62.1μs 84.9ns 329ns 0.0928 0 0 6.92 KB
#5128 AllCycleSimpleBody net472 48.7μs 68.2ns 255ns 1.31 0 0 8.3 KB
#5128 AllCycleMoreComplexBody net6.0 79μs 147ns 551ns 0.119 0 0 9.48 KB
#5128 AllCycleMoreComplexBody netcoreapp3.1 69.6μs 89.1ns 345ns 0.139 0 0 10.33 KB
#5128 AllCycleMoreComplexBody net472 56.6μs 36.1ns 130ns 1.86 0.0282 0 11.82 KB
#5128 ObjectExtractorSimpleBody net6.0 147ns 0.0995ns 0.372ns 0.00396 0 0 280 B
#5128 ObjectExtractorSimpleBody netcoreapp3.1 227ns 0.149ns 0.556ns 0.00369 0 0 272 B
#5128 ObjectExtractorSimpleBody net472 163ns 0.136ns 0.527ns 0.0446 0 0 281 B
#5128 ObjectExtractorMoreComplexBody net6.0 3.05μs 1.08ns 4.2ns 0.0533 0 0 3.78 KB
#5128 ObjectExtractorMoreComplexBody netcoreapp3.1 4μs 1.57ns 5.86ns 0.0498 0 0 3.69 KB
#5128 ObjectExtractorMoreComplexBody net472 3.76μs 2.42ns 9.36ns 0.602 0.00565 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 39.8μs 15.7ns 60.8ns 0.461 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 55.4μs 21.2ns 82.2ns 0.442 0 0 32.4 KB
master EncodeArgs net472 68.9μs 42.5ns 159ns 5.14 0.069 0 32.5 KB
master EncodeLegacyArgs net6.0 71.9μs 183ns 707ns 0.0359 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 105μs 90.4ns 350ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 158μs 40.3ns 151ns 0.314 0 0 2.15 KB
#5128 EncodeArgs net6.0 39.1μs 14.5ns 50.2ns 0.451 0 0 32.4 KB
#5128 EncodeArgs netcoreapp3.1 55.4μs 21.4ns 80.2ns 0.413 0 0 32.4 KB
#5128 EncodeArgs net472 69.7μs 27.2ns 105ns 5.16 0.0697 0 32.5 KB
#5128 EncodeLegacyArgs net6.0 76.7μs 50.7ns 196ns 0 0 0 2.14 KB
#5128 EncodeLegacyArgs netcoreapp3.1 106μs 391ns 1.52μs 0 0 0 2.14 KB
#5128 EncodeLegacyArgs net472 157μs 123ns 476ns 0.314 0 0 2.15 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 183μs 144ns 558ns 0 0 0 2.13 KB
master RunWafRealisticBenchmark netcoreapp3.1 196μs 217ns 839ns 0 0 0 2.11 KB
master RunWafRealisticBenchmark net472 216μs 183ns 710ns 0.323 0 0 2.17 KB
master RunWafRealisticBenchmarkWithAttack net6.0 121μs 107ns 413ns 0 0 0 1.37 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 129μs 171ns 663ns 0 0 0 1.36 KB
master RunWafRealisticBenchmarkWithAttack net472 142μs 52.3ns 181ns 0.212 0 0 1.39 KB
#5128 RunWafRealisticBenchmark net6.0 182μs 82ns 284ns 0 0 0 2.13 KB
#5128 RunWafRealisticBenchmark netcoreapp3.1 195μs 106ns 412ns 0 0 0 2.11 KB
#5128 RunWafRealisticBenchmark net472 215μs 133ns 515ns 0.322 0 0 2.17 KB
#5128 RunWafRealisticBenchmarkWithAttack net6.0 121μs 138ns 535ns 0 0 0 1.37 KB
#5128 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 131μs 44ns 170ns 0 0 0 1.36 KB
#5128 RunWafRealisticBenchmarkWithAttack net472 141μs 77.4ns 300ns 0.212 0 0 1.39 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed :heavy_check_mark: More allocations :warning:

More allocations :warning: in #5128

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.07 KB 62.06 KB 2.99 KB 5.07%

Fewer allocations :tada: in #5128

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 211.95 KB 203.93 KB -8.02 KB -3.79%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 52.9μs 291ns 1.69μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 61.3μs 721ns 6.92μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 38.2μs 73.2ns 264ns 0 0 0 59.07 KB
master StringConcatAspectBenchmark net6.0 291μs 1.57μs 9.04μs 0 0 0 203.92 KB
master StringConcatAspectBenchmark netcoreapp3.1 312μs 1.76μs 11.4μs 0 0 0 211.95 KB
master StringConcatAspectBenchmark net472 255μs 5.29μs 50.2μs 0 0 0 221.18 KB
#5128 StringConcatBenchmark net6.0 62.1μs 806ns 7.9μs 0 0 0 43.44 KB
#5128 StringConcatBenchmark netcoreapp3.1 62.5μs 818ns 7.93μs 0 0 0 42.64 KB
#5128 StringConcatBenchmark net472 37.8μs 107ns 384ns 0 0 0 62.06 KB
#5128 StringConcatAspectBenchmark net6.0 278μs 5.67μs 56.1μs 0 0 0 203.74 KB
#5128 StringConcatAspectBenchmark netcoreapp3.1 317μs 1.62μs 8.58μs 0 0 0 203.93 KB
#5128 StringConcatAspectBenchmark net472 281μs 7.47μs 72.4μs 0 0 0 221.18 KB

andrewlock avatar Mar 19 '24 16:03 andrewlock