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

[Profiler] Prep work before introducing ringbuffers

Open gleocadie opened this issue 1 year ago • 4 comments

Summary of changes

Prep work before introducing ringbuffers

Reason for change

We would like to introduce ringbuffers in the profiler to store the rawsamples. This will sensibly reduce the CPU overhead. In order to do that, we need to have a way to store directly callstack (and other snapshot result) directly in the reserved memory.

Implementation details

Try as much as possible to store the snapshot result in the Raw sample:

  • Make the Raw Sample class template
  • Indirection to the Root local span id and span id memory location in the RawSample
  • Use the internal buffer based on the type of the stack collection (prep work, in the future, with the ringbuffer it can be a std::span)

Test coverage

The current tests should still work.

Other details

gleocadie avatar Feb 19 '24 08:02 gleocadie

Datadog Report

Branch report: gleocadie/first-step-pass-rawsample-to-frame-collector Commit report: d82c308 Test service: dd-trace-dotnet

:x: 1 Failed (0 Known Flaky), 307445 Passed, 1858 Skipped, 41m 28.47s Wall Time

:x: Failed Tests (1)

  • Profiler_garbagecollections - scenarios - Details

    Expand for error
    atal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
      at System.Diagnostics.Tracing.EventPipePayloadDecoder.DecodePayload(EventMetadata ByRef, System.ReadOnlySpan\`1<Byte>)
      at System.Diagnostics.Tracing.NativeRuntimeEventSource.ProcessEvent(UInt32, UInt32, System.DateTime, System.Guid, System.Guid, System.ReadOnlySpan\`1<Byte>)
      at System.Diagnostics.Tracing.EventPipeEventDispatcher.DispatchEventsToEventListeners()
      at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
      at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
    
    ####### Starting at 02/20/2024 14:16:50
    
    sage:
    ..
    

datadog-ddstaging[bot] avatar Feb 19 '24 08:02 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 (5207) - mean (73ms)  : 65, 81
     .   : milestone, 73,
    master - mean (75ms)  : 65, 86
     .   : milestone, 75,

    section CallTarget+Inlining+NGEN
    This PR (5207) - mean (986ms)  : 963, 1009
     .   : milestone, 986,
    master - mean (989ms)  : 969, 1009
     .   : milestone, 989,

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

    section CallTarget+Inlining+NGEN
    This PR (5207) - mean (720ms)  : 694, 745
     .   : milestone, 720,
    master - mean (710ms)  : 691, 728
     .   : milestone, 710,

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

    section CallTarget+Inlining+NGEN
    This PR (5207) - mean (667ms)  : 645, 690
     .   : milestone, 667,
    master - mean (671ms)  : 646, 696
     .   : milestone, 671,

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

    section CallTarget+Inlining+NGEN
    This PR (5207) - mean (1,060ms)  : 1039, 1080
     .   : milestone, 1060,
    master - mean (1,057ms)  : 1033, 1082
     .   : milestone, 1057,

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

    section CallTarget+Inlining+NGEN
    This PR (5207) - mean (1,060ms)  : 1035, 1085
     .   : milestone, 1060,
    master - mean (1,055ms)  : 1024, 1085
     .   : milestone, 1055,

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

    section CallTarget+Inlining+NGEN
    This PR (5207) - mean (997ms)  : 976, 1018
     .   : milestone, 997,
    master - mean (994ms)  : 967, 1022
     .   : milestone, 994,

andrewlock avatar Feb 19 '24 08:02 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 (5207) (11.121M)   : 0, 11120829
    master (11.452M)   : 0, 11452280
    benchmarks/2.9.0 (11.508M)   : 0, 11507797

    section Automatic
    This PR (5207) (7.650M)   : 0, 7649770
    master (7.791M)   : 0, 7790888
    benchmarks/2.9.0 (8.301M)   : 0, 8300571

    section Trace stats
    This PR (5207) (8.118M)   : 0, 8118144
    master (8.121M)   : 0, 8120844

    section Manual
    This PR (5207) (9.708M)   : 0, 9708179
    master (9.869M)   : 0, 9869220

    section Manual + Automatic
    This PR (5207) (7.183M)   : 0, 7182797
    master (7.404M)   : 0, 7403853

    section Version Conflict
    This PR (5207) (6.581M)   : 0, 6580872
    master (6.641M)   : 0, 6641084

gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5207) (9.474M)   : 0, 9474055
    master (9.418M)   : 0, 9418403
    benchmarks/2.9.0 (9.336M)   : 0, 9336082

    section Automatic
    This PR (5207) (6.546M)   : 0, 6546139
    master (6.560M)   : 0, 6559687

    section Trace stats
    This PR (5207) (6.970M)   : 0, 6969744
    master (6.815M)   : 0, 6814975

    section Manual
    This PR (5207) (8.015M)   : 0, 8014835
    master (8.215M)   : 0, 8215195

    section Manual + Automatic
    This PR (5207) (6.138M)   : 0, 6138020
    master (6.106M)   : 0, 6105864

    section Version Conflict
    This PR (5207) (5.482M)   : 0, 5482111
    master (5.692M)   : 0, 5692455

gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5207) (10.403M)   : 0, 10403003
    master (10.270M)   : 0, 10270238
    benchmarks/2.9.0 (10.049M)   : 0, 10048647

    section Automatic
    This PR (5207) (7.600M)   : 0, 7599579
    master (7.314M)   : 0, 7313801
    benchmarks/2.9.0 (7.621M)   : 0, 7620725

    section Trace stats
    This PR (5207) (7.832M)   : 0, 7831760
    master (7.627M)   : 0, 7627472

    section Manual
    This PR (5207) (9.276M)   : 0, 9276062
    master (9.080M)   : 0, 9080294

    section Manual + Automatic
    This PR (5207) (7.175M)   : 0, 7175340
    master (7.051M)   : 0, 7051366

    section Version Conflict
    This PR (5207) (6.432M)   : 0, 6432001
    master (6.363M)   : 0, 6362577

gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    master (7.508M)   : 0, 7508094
    benchmarks/2.9.0 (7.472M)   : 0, 7471592

    section No attack
    master (1.877M)   : 0, 1876915
    benchmarks/2.9.0 (3.145M)   : 0, 3144736

    section Attack
    master (1.498M)   : 0, 1497742
    benchmarks/2.9.0 (2.494M)   : 0, 2494070

    section Blocking
    master (3.278M)   : 0, 3278177

    section IAST default
    master (6.581M)   : 0, 6581090

    section IAST full
    master (5.814M)   : 0, 5814172

    section Base vuln
    master (0.981M)   : 0, 980670

    section IAST vuln
    master (0.894M)   : 0, 894300

andrewlock avatar Feb 20 '24 08:02 andrewlock

Benchmarks Report :snail:

Benchmarks for #5207 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.188
  • 1 benchmarks are slower, with geometric mean 1.160
  • 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.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.63μs 46.8ns 256ns 0.0249 0.0124 0 7.49 KB
master StartStopWithChild netcoreapp3.1 10.6μs 48.2ns 193ns 0.0268 0.0107 0 7.59 KB
master StartStopWithChild net472 17μs 46.5ns 180ns 1.32 0.333 0.0938 7.96 KB
#5207 StartStopWithChild net6.0 8.67μs 48.9ns 321ns 0.0304 0.013 0 7.48 KB
#5207 StartStopWithChild netcoreapp3.1 11.1μs 60.1ns 335ns 0.0266 0.0107 0 7.59 KB
#5207 StartStopWithChild net472 17μs 49.5ns 185ns 1.34 0.364 0.11 7.97 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 445μs 331ns 1.24μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 637ns 2.47μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 788μs 358ns 1.34μs 0.393 0 0 3.3 KB
#5207 WriteAndFlushEnrichedTraces net6.0 462μs 177ns 662ns 0 0 0 2.7 KB
#5207 WriteAndFlushEnrichedTraces netcoreapp3.1 620μs 349ns 1.35μs 0 0 0 2.7 KB
#5207 WriteAndFlushEnrichedTraces net472 802μs 247ns 889ns 0.403 0 0 3.3 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #5207

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody‑net6.0 1.258 3,795.85 3,018.04

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 41.3μs 13.9ns 53.8ns 0.0206 0 0 2.36 KB
master AllCycleSimpleBody netcoreapp3.1 44.2μs 64.7ns 251ns 0.022 0 0 2.34 KB
master AllCycleSimpleBody net472 46.4μs 16.8ns 65ns 0.371 0 0 2.41 KB
master AllCycleMoreComplexBody net6.0 216μs 83.5ns 324ns 0.107 0 0 9.84 KB
master AllCycleMoreComplexBody netcoreapp3.1 229μs 325ns 1.26μs 0.113 0 0 9.73 KB
master AllCycleMoreComplexBody net472 242μs 127ns 492ns 1.57 0 0 9.91 KB
master ObjectExtractorSimpleBody net6.0 140ns 0.11ns 0.411ns 0.00391 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 215ns 0.235ns 0.88ns 0.00375 0 0 272 B
master ObjectExtractorSimpleBody net472 168ns 0.138ns 0.534ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.8μs 1.53ns 5.71ns 0.0533 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.84μs 1.65ns 6.39ns 0.0502 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.75μs 1.97ns 7.36ns 0.602 0.00561 0 3.8 KB
#5207 AllCycleSimpleBody net6.0 40.7μs 19.8ns 74ns 0.0203 0 0 2.36 KB
#5207 AllCycleSimpleBody netcoreapp3.1 44.6μs 28.6ns 107ns 0.0224 0 0 2.34 KB
#5207 AllCycleSimpleBody net472 46.8μs 18.6ns 72.2ns 0.374 0 0 2.41 KB
#5207 AllCycleMoreComplexBody net6.0 216μs 83.7ns 313ns 0.107 0 0 9.84 KB
#5207 AllCycleMoreComplexBody netcoreapp3.1 226μs 218ns 814ns 0.113 0 0 9.73 KB
#5207 AllCycleMoreComplexBody net472 240μs 86.6ns 312ns 1.57 0 0 9.91 KB
#5207 ObjectExtractorSimpleBody net6.0 139ns 0.0676ns 0.253ns 0.00394 0 0 280 B
#5207 ObjectExtractorSimpleBody netcoreapp3.1 204ns 0.172ns 0.645ns 0.00372 0 0 272 B
#5207 ObjectExtractorSimpleBody net472 166ns 0.0908ns 0.352ns 0.0446 0 0 281 B
#5207 ObjectExtractorMoreComplexBody net6.0 3.02μs 1.58ns 5.92ns 0.0529 0 0 3.78 KB
#5207 ObjectExtractorMoreComplexBody netcoreapp3.1 4.02μs 1.56ns 6.02ns 0.0499 0 0 3.69 KB
#5207 ObjectExtractorMoreComplexBody net472 3.81μs 1.76ns 6.81ns 0.601 0.00571 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μs 49.9ns 193ns 0.436 0 0 30.94 KB
master EncodeArgs netcoreapp3.1 70μs 66.1ns 247ns 0.42 0 0 31.47 KB
master EncodeArgs net472 83.7μs 69.8ns 270ns 5.09 0.0835 0 32.27 KB
master EncodeLegacyArgs net6.0 129μs 151ns 566ns 0.444 0 0 33.89 KB
master EncodeLegacyArgs netcoreapp3.1 157μs 400ns 1.44μs 0.458 0 0 34.09 KB
master EncodeLegacyArgs net472 209μs 88.6ns 307ns 5.56 0.419 0 35 KB
#5207 EncodeArgs net6.0 53.3μs 70.5ns 264ns 0.427 0 0 30.94 KB
#5207 EncodeArgs netcoreapp3.1 69μs 62.9ns 244ns 0.413 0 0 31.47 KB
#5207 EncodeArgs net472 84.6μs 52.7ns 204ns 5.11 0.0845 0 32.27 KB
#5207 EncodeLegacyArgs net6.0 121μs 176ns 658ns 0.442 0 0 33.89 KB
#5207 EncodeLegacyArgs netcoreapp3.1 157μs 432ns 1.67μs 0.458 0 0 34.09 KB
#5207 EncodeLegacyArgs net472 212μs 144ns 540ns 5.53 0.434 0 35 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 193μs 128ns 498ns 0.0965 0 0 6.51 KB
master RunWafRealisticBenchmark netcoreapp3.1 203μs 243ns 942ns 0 0 0 6.49 KB
master RunWafRealisticBenchmark net472 225μs 157ns 607ns 1.01 0 0 6.59 KB
master RunWafRealisticBenchmarkWithAttack net6.0 128μs 104ns 403ns 0 0 0 4.15 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 134μs 202ns 783ns 0 0 0 4.14 KB
master RunWafRealisticBenchmarkWithAttack net472 146μs 90ns 349ns 0.656 0 0 4.19 KB
#5207 RunWafRealisticBenchmark net6.0 191μs 146ns 547ns 0 0 0 6.51 KB
#5207 RunWafRealisticBenchmark netcoreapp3.1 206μs 480ns 1.86μs 0 0 0 6.49 KB
#5207 RunWafRealisticBenchmark net472 224μs 77.3ns 299ns 1.01 0 0 6.59 KB
#5207 RunWafRealisticBenchmarkWithAttack net6.0 126μs 94ns 352ns 0.0633 0 0 4.15 KB
#5207 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 136μs 215ns 832ns 0 0 0 4.14 KB
#5207 RunWafRealisticBenchmarkWithAttack net472 146μs 112ns 435ns 0.657 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 174μs 173ns 648ns 0.174 0 0 18.26 KB
master SendRequest netcoreapp3.1 191μs 175ns 679ns 0.192 0 0 20.42 KB
master SendRequest net472 0.000121ns 0.000119ns 0.000462ns 0 0 0 0 b
#5207 SendRequest net6.0 173μs 207ns 800ns 0.256 0 0 18.26 KB
#5207 SendRequest netcoreapp3.1 193μs 333ns 1.29μs 0.193 0 0 20.42 KB
#5207 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - 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 555μs 2.54μs 9.85μs 0.563 0 0 41.54 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 671μs 1.1μs 4.25μs 0.336 0 0 41.78 KB
master WriteAndFlushEnrichedTraces net472 842μs 3.73μs 14.4μs 8.22 2.47 0.411 53.23 KB
#5207 WriteAndFlushEnrichedTraces net6.0 535μs 750ns 2.9μs 0.541 0 0 41.58 KB
#5207 WriteAndFlushEnrichedTraces netcoreapp3.1 653μs 1.71μs 6.61μs 0.324 0 0 41.96 KB
#5207 WriteAndFlushEnrichedTraces net472 839μs 4.25μs 19μ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 966ns 0.495ns 1.92ns 0.0108 0 0 776 B
master ExecuteNonQuery netcoreapp3.1 1.47μs 0.985ns 3.82ns 0.0104 0 0 776 B
master ExecuteNonQuery net472 1.7μs 1.12ns 4.03ns 0.117 0 0 738 B
#5207 ExecuteNonQuery net6.0 1.04μs 0.628ns 2.43ns 0.0109 0 0 776 B
#5207 ExecuteNonQuery netcoreapp3.1 1.52μs 1.29ns 5.01ns 0.0105 0 0 776 B
#5207 ExecuteNonQuery net472 1.68μs 3.75ns 14.5ns 0.117 0 0 738 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #5207

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 1.121 1,296.70 1,156.45

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.3μs 0.709ns 2.65ns 0.013 0 0 944 B
master CallElasticsearch netcoreapp3.1 1.5μs 1.25ns 4.69ns 0.0127 0 0 944 B
master CallElasticsearch net472 2.52μs 0.815ns 3.05ns 0.152 0 0 963 B
master CallElasticsearchAsync net6.0 1.27μs 0.745ns 2.88ns 0.0127 0 0 920 B
master CallElasticsearchAsync netcoreapp3.1 1.6μs 0.443ns 1.66ns 0.0138 0 0 992 B
master CallElasticsearchAsync net472 2.58μs 1.2ns 4.5ns 0.161 0 0 1.02 KB
#5207 CallElasticsearch net6.0 1.16μs 0.748ns 2.9ns 0.0129 0 0 944 B
#5207 CallElasticsearch netcoreapp3.1 1.45μs 0.873ns 3.38ns 0.0125 0 0 944 B
#5207 CallElasticsearch net472 2.45μs 1.17ns 4.55ns 0.153 0 0 963 B
#5207 CallElasticsearchAsync net6.0 1.28μs 0.447ns 1.67ns 0.0129 0 0 920 B
#5207 CallElasticsearchAsync netcoreapp3.1 1.65μs 0.642ns 2.4ns 0.0133 0 0 992 B
#5207 CallElasticsearchAsync net472 2.72μs 0.878ns 3.4ns 0.161 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.32μs 1.12ns 4.34ns 0.0129 0 0 920 B
master ExecuteAsync netcoreapp3.1 1.55μs 0.617ns 2.39ns 0.0125 0 0 920 B
master ExecuteAsync net472 1.91μs 0.657ns 2.46ns 0.14 0 0 883 B
#5207 ExecuteAsync net6.0 1.3μs 0.35ns 1.31ns 0.013 0 0 920 B
#5207 ExecuteAsync netcoreapp3.1 1.64μs 1.61ns 6.24ns 0.0123 0 0 920 B
#5207 ExecuteAsync net472 1.76μs 1.45ns 5.6ns 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.05μs 2.03ns 7.6ns 0.0284 0 0 2.1 KB
master SendAsync netcoreapp3.1 4.94μs 8.15ns 31.5ns 0.0345 0 0 2.64 KB
master SendAsync net472 7.91μs 2.22ns 8.58ns 0.525 0 0 3.31 KB
#5207 SendAsync net6.0 4.01μs 1.32ns 5.09ns 0.028 0 0 2.1 KB
#5207 SendAsync netcoreapp3.1 4.87μs 3.01ns 11.3ns 0.0343 0 0 2.64 KB
#5207 SendAsync net472 7.63μs 2.74ns 10.6ns 0.525 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed :heavy_check_mark: More allocations :warning:

More allocations :warning: in #5207

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 60.49 KB 62.35 KB 1.86 KB 3.08%

Fewer allocations :tada: in #5207

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 214.42 KB 204.08 KB -10.34 KB -4.82%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 51.1μs 259ns 1.19μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 52.3μs 165ns 596ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.8μs 89.6ns 323ns 0 0 0 60.49 KB
master StringConcatAspectBenchmark net6.0 256μs 3.71μs 34.6μs 0 0 0 214.42 KB
master StringConcatAspectBenchmark netcoreapp3.1 283μs 1.65μs 14.5μs 0 0 0 212.36 KB
master StringConcatAspectBenchmark net472 235μs 3.03μs 28μs 0 0 0 221.18 KB
#5207 StringConcatBenchmark net6.0 56μs 745ns 7.38μs 0 0 0 43.44 KB
#5207 StringConcatBenchmark netcoreapp3.1 52.8μs 102ns 353ns 0 0 0 42.64 KB
#5207 StringConcatBenchmark net472 37.9μs 75.6ns 272ns 0 0 0 62.35 KB
#5207 StringConcatAspectBenchmark net6.0 271μs 1.34μs 8.82μs 0 0 0 204.08 KB
#5207 StringConcatAspectBenchmark netcoreapp3.1 292μs 1.71μs 14.8μs 0 0 0 213.1 KB
#5207 StringConcatAspectBenchmark net472 233μs 2.48μs 23.3μs 0 0 0 221.18 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.41μs 0.831ns 3.22ns 0.0225 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 2.16μs 1.02ns 3.8ns 0.0217 0 0 1.58 KB
master EnrichedLog net472 2.5μs 2.38ns 9.2ns 0.238 0 0 1.51 KB
#5207 EnrichedLog net6.0 1.44μs 0.73ns 2.73ns 0.0223 0 0 1.58 KB
#5207 EnrichedLog netcoreapp3.1 2.16μs 1.26ns 4.36ns 0.0216 0 0 1.58 KB
#5207 EnrichedLog net472 2.59μs 6.67ns 25.8ns 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 113μs 84.5ns 327ns 0 0 0 4.22 KB
master EnrichedLog netcoreapp3.1 119μs 211ns 818ns 0 0 0 4.22 KB
master EnrichedLog net472 149μs 229ns 887ns 0.662 0.221 0 4.4 KB
#5207 EnrichedLog net6.0 114μs 125ns 468ns 0 0 0 4.22 KB
#5207 EnrichedLog netcoreapp3.1 119μs 95.2ns 369ns 0 0 0 4.22 KB
#5207 EnrichedLog net472 148μs 168ns 629ns 0.66 0.22 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 3μs 0.856ns 3.31ns 0.0299 0 0 2.14 KB
master EnrichedLog netcoreapp3.1 4.19μs 1.42ns 5.48ns 0.0295 0 0 2.14 KB
master EnrichedLog net472 4.99μs 0.782ns 2.82ns 0.31 0 0 1.95 KB
#5207 EnrichedLog net6.0 3.1μs 1.33ns 5.16ns 0.0294 0 0 2.14 KB
#5207 EnrichedLog netcoreapp3.1 4.06μs 1.47ns 5.68ns 0.0284 0 0 2.14 KB
#5207 EnrichedLog net472 4.76μs 0.903ns 3.38ns 0.31 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.3μs 1.66ns 6.42ns 0.0156 0 0 1.11 KB
master SendReceive netcoreapp3.1 1.76μs 3.47ns 13.4ns 0.0151 0 0 1.11 KB
master SendReceive net472 2.08μs 4.32ns 16.7ns 0.178 0 0 1.12 KB
#5207 SendReceive net6.0 1.36μs 0.523ns 1.96ns 0.0157 0 0 1.11 KB
#5207 SendReceive netcoreapp3.1 1.78μs 1.8ns 6.97ns 0.0152 0 0 1.11 KB
#5207 SendReceive net472 2.01μs 1.19ns 4.46ns 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.75μs 1.4ns 5.42ns 0.0219 0 0 1.54 KB
master EnrichedLog netcoreapp3.1 4.01μs 4.2ns 16.3ns 0.0198 0 0 1.58 KB
master EnrichedLog net472 4.29μs 2.27ns 8.79ns 0.312 0 0 1.97 KB
#5207 EnrichedLog net6.0 2.74μs 0.868ns 3.25ns 0.0219 0 0 1.54 KB
#5207 EnrichedLog netcoreapp3.1 3.83μs 1.16ns 4.5ns 0.021 0 0 1.58 KB
#5207 EnrichedLog net472 4.37μs 4.69ns 16.9ns 0.313 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Slower :warning: Same allocations :heavy_check_mark:

Slower :warning: in #5207

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.160 554.37 643.30

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 481ns 0.232ns 0.898ns 0.00757 0 0 544 B
master StartFinishSpan netcoreapp3.1 650ns 0.252ns 0.944ns 0.00736 0 0 544 B
master StartFinishSpan net472 680ns 0.222ns 0.861ns 0.0865 0 0 546 B
master StartFinishScope net6.0 554ns 0.183ns 0.71ns 0.00921 0 0 664 B
master StartFinishScope netcoreapp3.1 814ns 0.147ns 0.55ns 0.00883 0 0 664 B
master StartFinishScope net472 945ns 0.899ns 3.48ns 0.0994 0 0 626 B
#5207 StartFinishSpan net6.0 473ns 0.0962ns 0.36ns 0.00756 0 0 544 B
#5207 StartFinishSpan netcoreapp3.1 701ns 0.773ns 2.79ns 0.00739 0 0 544 B
#5207 StartFinishSpan net472 710ns 1.97ns 7.64ns 0.0865 0 0 546 B
#5207 StartFinishScope net6.0 643ns 0.318ns 1.23ns 0.00913 0 0 664 B
#5207 StartFinishScope netcoreapp3.1 894ns 0.307ns 1.15ns 0.0091 0 0 664 B
#5207 StartFinishScope net472 948ns 0.671ns 2.6ns 0.0992 0 0 626 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 699ns 0.453ns 1.76ns 0.00912 0 0 664 B
master RunOnMethodBegin netcoreapp3.1 921ns 0.265ns 0.957ns 0.00898 0 0 664 B
master RunOnMethodBegin net472 1.08μs 0.662ns 2.56ns 0.099 0 0 626 B
#5207 RunOnMethodBegin net6.0 688ns 0.275ns 1.06ns 0.00936 0 0 664 B
#5207 RunOnMethodBegin netcoreapp3.1 962ns 1.2ns 4.64ns 0.00918 0 0 664 B
#5207 RunOnMethodBegin net472 1.07μs 0.213ns 0.798ns 0.0992 0 0 626 B

andrewlock avatar Feb 20 '24 15:02 andrewlock