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

[v3] Change `netstandard2.0` target to `netcoreapp2.1` i.e. drop `netcoreapp2.0`

Open andrewlock opened this issue 1 year ago • 6 comments

Summary of changes

  • Change automatic instrumentation to target netcoreapp2.1 instead of netstandard2.0
  • Replace some code paths with NETCOREAPP instead of NETCOREAPP3_1_OR_GREATER (or vice-versa)

Reason for change

As part of the progress forward, basically we drop support for netcoreapp2.0 entirely at this stage. This also makes it easier to use Span<T> etc

Implementation details

  • Replace netstandard2.0 -> netcoreapp2.1

The main question mark around this is the change in target for Datadog.Trace.Coverage.collector. It's vstest, so all bets are off 😅

Resolved issue

Originally I thought we had to add a reference to System.Runtime.CompilerServices.Unsafe.dll, but that came down to me incorrectly updating one of our usages of Unsafe.As<> to be in .NET Core 2.1. Even though it's available, we must not use it, as it's part of the platform extensions, not shipped with the runtime.

Details: Also, I had to add a reference to System.Runtime.CompilerServices.Unsafe.dll in the netcoreapp2.1 folder... I don't understand this one - we didn't have it before with netstandard2.0 (we had other references before, like System.Reflection.Emit instead...) but without it, we crash like this:

Exception occurred when calling the CallTarget integration continuation. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load the specified file.
File name: 'System.Runtime.CompilerServices.Unsafe'
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
   at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.ContinuationGenerator`2.FromTReturn[TTo](TReturn returnValue)
   at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ExecuteCallback(TTarget instance, TReturn returnValue, Exception exception, CallTargetState& state) in C:\repos\dd-trace-dotnet\tracer\src\Datadog.Trace\ClrProfiler\CallTarget\Handlers\Continuations\TaskContinuationGenerator`1.cs:line 75
   at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SetContinuation(TTarget instance, TReturn returnValue, Exception exception, CallTargetState& state) in C:\repos\dd-trace-dotnet\tracer\src\Datadog.Trace\ClrProfiler\CallTarget\Handlers\Continuations\TaskContinuationGenerator`1.cs:line 53
   at Datadog.Trace.ClrProfiler.CallTarget.Handlers.EndMethodHandler`3.Invoke(TTarget instance, TReturn returnValue, Exception exception, CallTargetState& state) in C:\repos\dd-trace-dotnet\tracer\src\Datadog.Trace\ClrProfiler\CallTarget\Handlers\EndMethodHandler`1.cs:line 76
   at Datadog.Trace.ClrProfiler.CallTarget.CallTargetInvoker.EndMethod[TIntegration,TTarget,TReturn](TTarget instance, TReturn returnValue, Exception exception, CallTargetState& state) in C:\repos\dd-trace-dotnet\tracer\src\Datadog.Trace\ClrProfiler\CallTarget\CallTargetInvoker.cs:line 599
   at System.Net.Http.SocketsHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)

Test coverage

We're still testing against .NET Core 2.1 for now, so this should be a mostly safe (breaking) change

Other details

Besides some missing APIs, there are still some C# features we can't use in NETCOREAPP sections, because they're not included in .NET Core 2.1, namely ^1 indexing and Range. Which I'm not too sad about seeing as they're pretty much my least favourite C# features 😉

andrewlock avatar Mar 04 '24 13:03 andrewlock

Datadog Report

Branch report: andrew/v3-public-apis/drop-netcoreapp2_0 Commit report: 52925f6 Test service: dd-trace-dotnet

:x: 1 Failed (0 Known Flaky), 341678 Passed, 2333 Skipped, 43m 44.62s Wall Time

:x: Failed Tests (1)

  • CheckLineNumberAreDisabledByDefault - Datadog.Profiler.IntegrationTests.DebugInfo.LineNumberTest - Details

    Expand for error
    xit code of "Samples.Computer01.exe" should be 0 instead of -1073741819 (= 0xC0000005)
    xpected: True
    ctual:   False
    

datadog-ddstaging[bot] avatar Mar 04 '24 14:03 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 (5260) - mean (74ms)  : 65, 84
     .   : milestone, 74,
    master - mean (73ms)  : 65, 81
     .   : milestone, 73,

    section CallTarget+Inlining+NGEN
    This PR (5260) - mean (1,012ms)  : 993, 1032
     .   : milestone, 1012,
    master - mean (1,004ms)  : 981, 1026
     .   : milestone, 1004,

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

    section CallTarget+Inlining+NGEN
    This PR (5260) - mean (737ms)  : 712, 762
     .   : milestone, 737,
    master - mean (724ms)  : 700, 749
     .   : milestone, 724,

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

    section CallTarget+Inlining+NGEN
    This PR (5260) - mean (697ms)  : 672, 722
     .   : milestone, 697,
    master - mean (679ms)  : 656, 702
     .   : milestone, 679,

gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5260) - mean (188ms)  : 185, 192
     .   : milestone, 188,
    master - mean (188ms)  : 183, 193
     .   : milestone, 188,

    section CallTarget+Inlining+NGEN
    This PR (5260) - mean (1,095ms)  : 1073, 1117
     .   : milestone, 1095,
    master - mean (1,071ms)  : 1052, 1090
     .   : milestone, 1071,

gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5260) - mean (272ms)  : 268, 276
     .   : milestone, 272,
    master - mean (270ms)  : 263, 276
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (5260) - mean (881ms)  : 857, 905
     .   : milestone, 881,
    master - mean (866ms)  : 844, 888
     .   : milestone, 866,

gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5260) - mean (261ms)  : 256, 266
     .   : milestone, 261,
    master - mean (260ms)  : 254, 266
     .   : milestone, 260,

    section CallTarget+Inlining+NGEN
    This PR (5260) - mean (869ms)  : 849, 888
     .   : milestone, 869,
    master - mean (852ms)  : 826, 877
     .   : milestone, 852,

andrewlock avatar Mar 04 '24 14:03 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 (5260) (11.189M)   : 0, 11189485
    master (11.301M)   : 0, 11301171
    benchmarks/2.9.0 (10.912M)   : 0, 10912209

    section Automatic
    This PR (5260) (7.882M)   : 0, 7882249
    master (7.786M)   : 0, 7786387
    benchmarks/2.9.0 (8.150M)   : 0, 8149943

    section Trace stats
    This PR (5260) (8.244M)   : 0, 8244179
    master (8.162M)   : 0, 8161989

    section Manual
    This PR (5260) (11.474M)   : 0, 11474078
    master (9.926M)   : 0, 9926297

    section Manual + Automatic
    This PR (5260) (7.361M)   : 0, 7360846
    master (7.412M)   : 0, 7411648

gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5260) (9.832M)   : 0, 9831961
    master (9.529M)   : 0, 9529282
    benchmarks/2.9.0 (9.446M)   : 0, 9446328

    section Automatic
    This PR (5260) (6.676M)   : 0, 6675651
    master (6.506M)   : 0, 6505611

    section Trace stats
    This PR (5260) (7.063M)   : 0, 7063495
    master (6.940M)   : 0, 6940301

    section Manual
    This PR (5260) (9.702M)   : 0, 9701837
    master (8.383M)   : 0, 8383218

    section Manual + Automatic
    This PR (5260) (6.278M)   : 0, 6278111
    master (6.263M)   : 0, 6262794

gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5260) (10.173M)   : 0, 10173229
    master (10.221M)   : 0, 10221490
    benchmarks/2.9.0 (10.227M)   : 0, 10226734

    section Automatic
    This PR (5260) (7.340M)   : 0, 7340178
    master (7.341M)   : 0, 7340809
    benchmarks/2.9.0 (7.735M)   : 0, 7734705

    section Trace stats
    This PR (5260) (7.653M)   : 0, 7652781
    master (7.697M)   : 0, 7697428

    section Manual
    This PR (5260) (10.414M)   : 0, 10413960
    master (9.139M)   : 0, 9138836

    section Manual + Automatic
    This PR (5260) (7.068M)   : 0, 7067943
    master (7.059M)   : 0, 7058587

gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5260) (7.420M)   : 0, 7420399
    master (7.461M)   : 0, 7461396
    benchmarks/2.9.0 (7.826M)   : 0, 7826159

    section No attack
    This PR (5260) (1.841M)   : 0, 1840792
    master (1.854M)   : 0, 1853890
    benchmarks/2.9.0 (3.248M)   : 0, 3247998

    section Attack
    This PR (5260) (1.453M)   : 0, 1452994
    master (1.450M)   : 0, 1449724
    benchmarks/2.9.0 (2.477M)   : 0, 2477217

    section Blocking
    This PR (5260) (3.198M)   : 0, 3198047
    master (3.161M)   : 0, 3160542

    section IAST default
    This PR (5260) (6.479M)   : 0, 6479335
    master (6.464M)   : 0, 6464188

    section IAST full
    This PR (5260) (5.724M)   : 0, 5724463
    master (5.600M)   : 0, 5600403

    section Base vuln
    This PR (5260) (0.920M)   : 0, 920292
    master (0.918M)   : 0, 917723

    section IAST vuln
    This PR (5260) (0.850M)   : 0, 850412
    master (0.859M)   : 0, 859223

andrewlock avatar Mar 04 '24 21:03 andrewlock

Benchmarks Report :snail:

Benchmarks for #5260 compared to master:

  • 4 benchmarks are slower, with geometric mean 1.164
  • 2 benchmarks have fewer allocations
  • 2 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.83μs 47.6ns 265ns 0.022 0.00881 0 7.49 KB
master StartStopWithChild netcoreapp3.1 10.9μs 52.4ns 216ns 0.0223 0.0112 0 7.59 KB
master StartStopWithChild net472 16.8μs 43.2ns 168ns 1.34 0.363 0.11 7.96 KB
#5260 StartStopWithChild net6.0 8.56μs 48.7ns 364ns 0.0304 0.013 0 7.49 KB
#5260 StartStopWithChild netcoreapp3.1 10.8μs 55.4ns 248ns 0.0333 0.0166 0 7.59 KB
#5260 StartStopWithChild net472 17.1μs 58.1ns 225ns 1.33 0.348 0.108 7.96 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 448μs 315ns 1.22μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 612μs 255ns 989ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 822μs 559ns 2.16μs 0.411 0 0 3.3 KB
#5260 WriteAndFlushEnrichedTraces net6.0 438μs 198ns 767ns 0 0 0 2.7 KB
#5260 WriteAndFlushEnrichedTraces netcoreapp3.1 614μs 259ns 1μs 0 0 0 2.7 KB
#5260 WriteAndFlushEnrichedTraces net472 803μs 143ns 556ns 0.401 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 41μs 25.7ns 99.5ns 0.0203 0 0 2.36 KB
master AllCycleSimpleBody netcoreapp3.1 44μs 61.1ns 237ns 0.0221 0 0 2.34 KB
master AllCycleSimpleBody net472 46.9μs 17.1ns 66.4ns 0.373 0 0 2.41 KB
master AllCycleMoreComplexBody net6.0 213μs 73.3ns 274ns 0.108 0 0 9.84 KB
master AllCycleMoreComplexBody netcoreapp3.1 226μs 179ns 693ns 0.112 0 0 9.73 KB
master AllCycleMoreComplexBody net472 241μs 84ns 314ns 1.57 0 0 9.91 KB
master ObjectExtractorSimpleBody net6.0 141ns 0.0601ns 0.217ns 0.00392 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 205ns 0.126ns 0.486ns 0.00362 0 0 272 B
master ObjectExtractorSimpleBody net472 172ns 0.0769ns 0.298ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.03μs 4.03ns 14.5ns 0.053 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.93μs 2ns 7.76ns 0.0492 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.79μs 2.65ns 10.3ns 0.602 0.00569 0 3.8 KB
#5260 AllCycleSimpleBody net6.0 40.7μs 21.3ns 82.3ns 0.0204 0 0 2.36 KB
#5260 AllCycleSimpleBody netcoreapp3.1 43.7μs 58.7ns 227ns 0.0216 0 0 2.34 KB
#5260 AllCycleSimpleBody net472 46.9μs 23.4ns 90.5ns 0.372 0 0 2.41 KB
#5260 AllCycleMoreComplexBody net6.0 219μs 243ns 942ns 0.11 0 0 9.84 KB
#5260 AllCycleMoreComplexBody netcoreapp3.1 229μs 277ns 1.07μs 0.115 0 0 9.73 KB
#5260 AllCycleMoreComplexBody net472 241μs 114ns 442ns 1.57 0 0 9.91 KB
#5260 ObjectExtractorSimpleBody net6.0 142ns 0.078ns 0.302ns 0.00395 0 0 280 B
#5260 ObjectExtractorSimpleBody netcoreapp3.1 209ns 0.0855ns 0.32ns 0.00369 0 0 272 B
#5260 ObjectExtractorSimpleBody net472 167ns 0.0953ns 0.369ns 0.0446 0 0 281 B
#5260 ObjectExtractorMoreComplexBody net6.0 3.13μs 2.28ns 8.53ns 0.0532 0 0 3.78 KB
#5260 ObjectExtractorMoreComplexBody netcoreapp3.1 3.95μs 2ns 7.5ns 0.0496 0 0 3.69 KB
#5260 ObjectExtractorMoreComplexBody net472 3.87μs 3.81ns 14.7ns 0.603 0.00578 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 32μs 21.7ns 84ns 0.397 0 0 27.94 KB
master EncodeArgs netcoreapp3.1 46.6μs 19.4ns 72.7ns 0.373 0 0 27.94 KB
master EncodeArgs net472 59.7μs 34.5ns 134ns 4.45 0.0597 0 28.03 KB
master EncodeLegacyArgs net6.0 97.8μs 197ns 711ns 0.391 0 0 30.34 KB
master EncodeLegacyArgs netcoreapp3.1 127μs 338ns 1.31μs 0.37 0 0 30.34 KB
master EncodeLegacyArgs net472 186μs 264ns 1.02μs 4.81 0.363 0 30.44 KB
#5260 EncodeArgs net6.0 32.4μs 14.4ns 49.8ns 0.392 0 0 27.94 KB
#5260 EncodeArgs netcoreapp3.1 45.9μs 23.6ns 91.3ns 0.39 0 0 27.94 KB
#5260 EncodeArgs net472 59μs 26.1ns 101ns 4.45 0.0586 0 28.03 KB
#5260 EncodeLegacyArgs net6.0 104μs 355ns 1.33μs 0.4 0 0 30.34 KB
#5260 EncodeLegacyArgs netcoreapp3.1 128μs 115ns 446ns 0.367 0 0 30.34 KB
#5260 EncodeLegacyArgs net472 183μs 377ns 1.46μs 4.84 0.365 0 30.44 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 188μs 184ns 665ns 0.0936 0 0 6.51 KB
master RunWafRealisticBenchmark netcoreapp3.1 204μs 369ns 1.43μs 0 0 0 6.49 KB
master RunWafRealisticBenchmark net472 223μs 149ns 578ns 1.01 0 0 6.59 KB
master RunWafRealisticBenchmarkWithAttack net6.0 125μs 67.9ns 263ns 0.0631 0 0 4.15 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 134μs 279ns 1.08μs 0 0 0 4.14 KB
master RunWafRealisticBenchmarkWithAttack net472 147μs 39.7ns 149ns 0.657 0 0 4.19 KB
#5260 RunWafRealisticBenchmark net6.0 195μs 179ns 670ns 0 0 0 6.51 KB
#5260 RunWafRealisticBenchmark netcoreapp3.1 207μs 301ns 1.16μs 0 0 0 6.49 KB
#5260 RunWafRealisticBenchmark net472 227μs 69.4ns 269ns 1.02 0 0 6.59 KB
#5260 RunWafRealisticBenchmarkWithAttack net6.0 128μs 113ns 439ns 0 0 0 4.15 KB
#5260 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 134μs 151ns 544ns 0 0 0 4.14 KB
#5260 RunWafRealisticBenchmarkWithAttack net472 148μs 63.2ns 236ns 0.663 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 170μs 170ns 635ns 0.255 0 0 18.26 KB
master SendRequest netcoreapp3.1 189μs 185ns 717ns 0.189 0 0 20.42 KB
master SendRequest net472 0.000528ns 0.000196ns 0.000735ns 0 0 0 0 b
#5260 SendRequest net6.0 171μs 197ns 764ns 0.17 0 0 18.26 KB
#5260 SendRequest netcoreapp3.1 194μs 338ns 1.31μs 0.194 0 0 20.42 KB
#5260 SendRequest net472 0.000647ns 0.000246ns 0.000921ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed :heavy_check_mark: More allocations :warning:

More allocations :warning: in #5260

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.42 KB 41.77 KB 349 B 0.84%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 534μs 201ns 724ns 0.563 0 0 41.42 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 653μs 864ns 3.35μs 0.322 0 0 41.92 KB
master WriteAndFlushEnrichedTraces net472 849μs 3.34μs 12.9μs 8.45 2.53 0.422 53.24 KB
#5260 WriteAndFlushEnrichedTraces net6.0 561μs 825ns 3.2μs 0.566 0 0 41.77 KB
#5260 WriteAndFlushEnrichedTraces netcoreapp3.1 654μs 929ns 3.6μs 0.324 0 0 41.93 KB
#5260 WriteAndFlushEnrichedTraces net472 816μs 3.38μs 13.1μs 8.33 2.5 0.417 53.22 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.02μs 0.851ns 3.3ns 0.0107 0 0 776 B
master ExecuteNonQuery netcoreapp3.1 1.47μs 1.45ns 5.43ns 0.0103 0 0 776 B
master ExecuteNonQuery net472 1.73μs 0.953ns 3.69ns 0.117 0 0 738 B
#5260 ExecuteNonQuery net6.0 1.09μs 0.683ns 2.65ns 0.0109 0 0 776 B
#5260 ExecuteNonQuery netcoreapp3.1 1.45μs 0.664ns 2.48ns 0.0102 0 0 776 B
#5260 ExecuteNonQuery net472 1.84μs 0.47ns 1.76ns 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.14μs 0.398ns 1.49ns 0.0132 0 0 944 B
master CallElasticsearch netcoreapp3.1 1.46μs 0.551ns 2.13ns 0.013 0 0 944 B
master CallElasticsearch net472 2.45μs 1.14ns 4.41ns 0.152 0 0 963 B
master CallElasticsearchAsync net6.0 1.32μs 0.736ns 2.85ns 0.0132 0 0 920 B
master CallElasticsearchAsync netcoreapp3.1 1.61μs 0.524ns 1.96ns 0.013 0 0 992 B
master CallElasticsearchAsync net472 2.63μs 0.712ns 2.76ns 0.161 0 0 1.02 KB
#5260 CallElasticsearch net6.0 1.21μs 0.978ns 3.79ns 0.0133 0 0 944 B
#5260 CallElasticsearch netcoreapp3.1 1.48μs 0.581ns 2.25ns 0.0128 0 0 944 B
#5260 CallElasticsearch net472 2.46μs 1.37ns 5.32ns 0.152 0 0 963 B
#5260 CallElasticsearchAsync net6.0 1.32μs 0.597ns 2.23ns 0.013 0 0 920 B
#5260 CallElasticsearchAsync netcoreapp3.1 1.78μs 0.572ns 2.14ns 0.0134 0 0 992 B
#5260 CallElasticsearchAsync net472 2.64μs 1.3ns 4.86ns 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.29μs 2.03ns 7.3ns 0.013 0 0 920 B
master ExecuteAsync netcoreapp3.1 1.68μs 3.9ns 14.1ns 0.0123 0 0 920 B
master ExecuteAsync net472 1.85μs 0.732ns 2.83ns 0.14 0 0 883 B
#5260 ExecuteAsync net6.0 1.29μs 0.715ns 2.77ns 0.013 0 0 920 B
#5260 ExecuteAsync netcoreapp3.1 1.59μs 0.361ns 1.3ns 0.0119 0 0 920 B
#5260 ExecuteAsync net472 1.83μs 1.31ns 5.07ns 0.139 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.16μs 1.35ns 5.25ns 0.0291 0 0 2.1 KB
master SendAsync netcoreapp3.1 5μs 3.26ns 12.6ns 0.035 0 0 2.64 KB
master SendAsync net472 7.61μs 3.14ns 12.2ns 0.524 0 0 3.31 KB
#5260 SendAsync net6.0 3.95μs 1.94ns 7.51ns 0.028 0 0 2.1 KB
#5260 SendAsync netcoreapp3.1 5.06μs 1.98ns 7.42ns 0.0356 0 0 2.64 KB
#5260 SendAsync net472 7.59μs 2.14ns 8.27ns 0.524 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower :warning: More allocations :warning:

Slower :warning: in #5260

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 1.189 50,600.00 60,150.00 bimodal

More allocations :warning: in #5260

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 202.2 KB 203.37 KB 1.17 KB 0.58%

Fewer allocations :tada: in #5260

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 215.6 KB 203.87 KB -11.73 KB -5.44%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 62.46 KB 57.34 KB -5.12 KB -8.20%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 50.8μs 164ns 615ns 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 52μs 183ns 659ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.4μs 87.3ns 315ns 0 0 0 62.46 KB
master StringConcatAspectBenchmark net6.0 277μs 1.39μs 9.35μs 0 0 0 215.6 KB
master StringConcatAspectBenchmark netcoreapp3.1 277μs 1.32μs 8.15μs 0 0 0 202.2 KB
master StringConcatAspectBenchmark net472 233μs 2.59μs 24.7μs 0 0 0 221.18 KB
#5260 StringConcatBenchmark net6.0 59.5μs 678ns 6.71μs 0 0 0 43.44 KB
#5260 StringConcatBenchmark netcoreapp3.1 52.5μs 181ns 677ns 0 0 0 42.64 KB
#5260 StringConcatBenchmark net472 37.6μs 88.6ns 332ns 0 0 0 57.34 KB
#5260 StringConcatAspectBenchmark net6.0 263μs 1.34μs 6.14μs 0 0 0 203.87 KB
#5260 StringConcatAspectBenchmark netcoreapp3.1 290μs 1.22μs 5.7μs 0 0 0 203.37 KB
#5260 StringConcatAspectBenchmark net472 249μs 3.76μs 36.1μs 0 0 0 221.18 KB
Benchmarks.Trace.ILoggerBenchmark - Slower :warning: Same allocations :heavy_check_mark:

Slower :warning: in #5260

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.119 1,398.82 1,565.87

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.4μs 0.663ns 2.48ns 0.0218 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 2.18μs 0.583ns 2.1ns 0.0217 0 0 1.58 KB
master EnrichedLog net472 2.66μs 1.57ns 5.89ns 0.239 0 0 1.51 KB
#5260 EnrichedLog net6.0 1.57μs 0.505ns 1.89ns 0.0219 0 0 1.58 KB
#5260 EnrichedLog netcoreapp3.1 2.1μs 1.11ns 4.14ns 0.0209 0 0 1.58 KB
#5260 EnrichedLog net472 2.62μs 1.35ns 5.23ns 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 184ns 713ns 0.0565 0 0 4.22 KB
master EnrichedLog netcoreapp3.1 119μs 152ns 590ns 0.0591 0 0 4.22 KB
master EnrichedLog net472 148μs 199ns 771ns 0.663 0.221 0 4.4 KB
#5260 EnrichedLog net6.0 113μs 91.2ns 329ns 0.0566 0 0 4.22 KB
#5260 EnrichedLog netcoreapp3.1 119μs 132ns 510ns 0 0 0 4.22 KB
#5260 EnrichedLog net472 147μs 65.5ns 236ns 0.661 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 2.95μs 8.8ns 32.9ns 0.0292 0 0 2.14 KB
master EnrichedLog netcoreapp3.1 4.05μs 2.42ns 9.06ns 0.0284 0 0 2.14 KB
master EnrichedLog net472 4.72μs 5.48ns 21.2ns 0.308 0 0 1.95 KB
#5260 EnrichedLog net6.0 3μs 1.38ns 5.35ns 0.0303 0 0 2.14 KB
#5260 EnrichedLog netcoreapp3.1 4.29μs 1.64ns 5.67ns 0.0278 0 0 2.14 KB
#5260 EnrichedLog net472 4.89μs 1.81ns 7.02ns 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.38μs 0.856ns 3.31ns 0.0158 0 0 1.11 KB
master SendReceive netcoreapp3.1 1.75μs 1.06ns 3.96ns 0.0157 0 0 1.11 KB
master SendReceive net472 1.98μs 0.765ns 2.86ns 0.178 0 0 1.12 KB
#5260 SendReceive net6.0 1.37μs 0.574ns 2.22ns 0.0158 0 0 1.11 KB
#5260 SendReceive netcoreapp3.1 1.68μs 1.52ns 5.71ns 0.0153 0 0 1.11 KB
#5260 SendReceive net472 2.01μs 2.42ns 9.39ns 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.9μs 0.839ns 3.25ns 0.0209 0 0 1.54 KB
master EnrichedLog netcoreapp3.1 3.74μs 1.47ns 5.52ns 0.0208 0 0 1.58 KB
master EnrichedLog net472 4.33μs 1.85ns 7.15ns 0.313 0 0 1.97 KB
#5260 EnrichedLog net6.0 2.79μs 0.839ns 3.14ns 0.021 0 0 1.54 KB
#5260 EnrichedLog netcoreapp3.1 3.84μs 1.41ns 5.26ns 0.0211 0 0 1.58 KB
#5260 EnrichedLog net472 4.31μs 2.26ns 8.74ns 0.313 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Slower :warning: Same allocations :heavy_check_mark:

Slower :warning: in #5260

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.159 461.68 535.28

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 461ns 0.827ns 3.2ns 0.00759 0 0 544 B
master StartFinishSpan netcoreapp3.1 724ns 1.98ns 7.68ns 0.00747 0 0 544 B
master StartFinishSpan net472 723ns 1.66ns 6.42ns 0.0866 0 0 546 B
master StartFinishScope net6.0 597ns 0.85ns 3.29ns 0.00927 0 0 664 B
master StartFinishScope netcoreapp3.1 773ns 1.91ns 7.41ns 0.00881 0 0 664 B
master StartFinishScope net472 987ns 1.82ns 7.05ns 0.0992 0 0 626 B
#5260 StartFinishSpan net6.0 536ns 0.994ns 3.85ns 0.00752 0 0 544 B
#5260 StartFinishSpan netcoreapp3.1 733ns 1.14ns 4.41ns 0.00727 0 0 544 B
#5260 StartFinishSpan net472 738ns 1.57ns 6.08ns 0.0864 0 0 546 B
#5260 StartFinishScope net6.0 638ns 1.18ns 4.56ns 0.00924 0 0 664 B
#5260 StartFinishScope netcoreapp3.1 831ns 1.09ns 4.22ns 0.00876 0 0 664 B
#5260 StartFinishScope net472 972ns 2.06ns 7.96ns 0.0992 0 0 626 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower :warning: Same allocations :heavy_check_mark:

Slower :warning: in #5260

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.191 633.23 754.46

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 632ns 1.01ns 3.91ns 0.00927 0 0 664 B
master RunOnMethodBegin netcoreapp3.1 1.03μs 1.38ns 5.34ns 0.00878 0 0 664 B
master RunOnMethodBegin net472 1.08μs 2.75ns 10.7ns 0.0995 0 0 626 B
#5260 RunOnMethodBegin net6.0 752ns 1.46ns 5.66ns 0.00909 0 0 664 B
#5260 RunOnMethodBegin netcoreapp3.1 968ns 1.45ns 5.41ns 0.00871 0 0 664 B
#5260 RunOnMethodBegin net472 1.05μs 2.39ns 9.25ns 0.0992 0 0 626 B

andrewlock avatar Mar 06 '24 13:03 andrewlock

Benchmarks Report for tracer :snail:

Benchmarks for #5260 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.172
  • 1 benchmarks are slower, with geometric mean 1.121
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed :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 49ns 325ns 0.0176 0.0088 0 7.51 KB
master StartStopWithChild netcoreapp3.1 10.7μs 60.3ns 418ns 0.031 0.0155 0 7.6 KB
master StartStopWithChild net472 16.8μs 61.5ns 238ns 1.32 0.301 0.0835 8.04 KB
#5260 StartStopWithChild net6.0 8.63μs 48.8ns 338ns 0.0216 0.0129 0.00431 7.51 KB
#5260 StartStopWithChild netcoreapp3.1 10.8μs 57.6ns 326ns 0.0321 0.0161 0.00536 7.6 KB
#5260 StartStopWithChild net472 17.1μs 52.2ns 202ns 1.32 0.325 0.0916 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 463μs 196ns 678ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 616μs 161ns 625ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 804μs 274ns 1.06μs 0.401 0 0 3.3 KB
#5260 WriteAndFlushEnrichedTraces net6.0 467μs 644ns 2.5μs 0 0 0 2.7 KB
#5260 WriteAndFlushEnrichedTraces netcoreapp3.1 603μs 199ns 772ns 0 0 0 2.7 KB
#5260 WriteAndFlushEnrichedTraces net472 799μs 334ns 1.29μ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 171μs 154ns 597ns 0.184 0 0 18.33 KB
master SendRequest netcoreapp3.1 193μs 240ns 928ns 0.193 0 0 20.49 KB
master SendRequest net472 0.000852ns 0.000448ns 0.00161ns 0 0 0 0 b
#5260 SendRequest net6.0 170μs 156ns 582ns 0.255 0 0 18.33 KB
#5260 SendRequest netcoreapp3.1 192μs 464ns 1.8μs 0.192 0 0 20.49 KB
#5260 SendRequest net472 0.000821ns 0.000329ns 0.00127ns 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 546μs 983ns 3.81μs 0.561 0 0 41.48 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 665μs 1.34μs 5.2μs 0.329 0 0 41.69 KB
master WriteAndFlushEnrichedTraces net472 870μs 3.69μs 14.3μs 8.13 2.57 0.428 53.25 KB
#5260 WriteAndFlushEnrichedTraces net6.0 543μs 1.16μs 4.51μs 0.553 0 0 41.47 KB
#5260 WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 1.62μs 6.27μs 0.322 0 0 41.76 KB
#5260 WriteAndFlushEnrichedTraces net472 854μs 4.12μs 17.5μ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.17μs 0.623ns 2.41ns 0.0111 0 0 784 B
master ExecuteNonQuery netcoreapp3.1 1.58μs 5.33ns 20.6ns 0.0103 0 0 784 B
master ExecuteNonQuery net472 1.89μs 0.577ns 2.16ns 0.118 0 0 746 B
#5260 ExecuteNonQuery net6.0 1.09μs 0.42ns 1.63ns 0.0106 0 0 784 B
#5260 ExecuteNonQuery netcoreapp3.1 1.53μs 1.43ns 5.35ns 0.0107 0 0 784 B
#5260 ExecuteNonQuery net472 1.81μs 0.6ns 2.16ns 0.118 0 0 746 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.2μs 0.599ns 2.24ns 0.0138 0 0 1.01 KB
master CallElasticsearch netcoreapp3.1 1.62μs 0.769ns 2.98ns 0.0138 0 0 1.01 KB
master CallElasticsearch net472 2.58μs 2.45ns 9.47ns 0.162 0 0 1.02 KB
master CallElasticsearchAsync net6.0 1.47μs 1.39ns 5.19ns 0.0138 0 0 984 B
master CallElasticsearchAsync netcoreapp3.1 1.74μs 0.684ns 2.56ns 0.0138 0 0 1.06 KB
master CallElasticsearchAsync net472 2.56μs 1.96ns 7.59ns 0.17 0 0 1.08 KB
#5260 CallElasticsearch net6.0 1.22μs 0.646ns 2.42ns 0.0141 0 0 1.01 KB
#5260 CallElasticsearch netcoreapp3.1 1.59μs 0.855ns 3.2ns 0.0135 0 0 1.01 KB
#5260 CallElasticsearch net472 2.63μs 1.52ns 5.7ns 0.161 0.00132 0 1.02 KB
#5260 CallElasticsearchAsync net6.0 1.47μs 0.919ns 3.44ns 0.014 0 0 984 B
#5260 CallElasticsearchAsync netcoreapp3.1 1.81μs 1.9ns 7.1ns 0.014 0 0 1.06 KB
#5260 CallElasticsearchAsync net472 2.67μs 2.86ns 11.1ns 0.17 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.26μs 1.21ns 4.51ns 0.0127 0 0 928 B
master ExecuteAsync netcoreapp3.1 1.63μs 0.751ns 2.91ns 0.013 0 0 928 B
master ExecuteAsync net472 1.9μs 0.575ns 2.15ns 0.141 0 0 891 B
#5260 ExecuteAsync net6.0 1.25μs 1.18ns 4.58ns 0.0132 0 0 928 B
#5260 ExecuteAsync netcoreapp3.1 1.69μs 0.766ns 2.87ns 0.013 0 0 928 B
#5260 ExecuteAsync net472 1.84μs 0.857ns 3.32ns 0.141 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.24μs 1.91ns 7.14ns 0.0298 0 0 2.16 KB
master SendAsync netcoreapp3.1 5.06μs 2.59ns 10ns 0.0352 0 0 2.7 KB
master SendAsync net472 7.61μs 4.46ns 16.1ns 0.484 0 0 3.05 KB
#5260 SendAsync net6.0 4.14μs 2.21ns 8.54ns 0.0293 0 0 2.16 KB
#5260 SendAsync netcoreapp3.1 5.03μs 1.76ns 6.58ns 0.0353 0 0 2.7 KB
#5260 SendAsync net472 7.78μs 2.73ns 10.2ns 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.46μs 0.675ns 2.62ns 0.0228 0 0 1.65 KB
master EnrichedLog netcoreapp3.1 2.19μs 0.863ns 3.23ns 0.0227 0 0 1.65 KB
master EnrichedLog net472 2.68μs 2.41ns 9.35ns 0.249 0 0 1.57 KB
#5260 EnrichedLog net6.0 1.46μs 0.852ns 3.19ns 0.0228 0 0 1.65 KB
#5260 EnrichedLog netcoreapp3.1 2.32μs 1.57ns 5.86ns 0.022 0 0 1.65 KB
#5260 EnrichedLog net472 2.65μs 2.04ns 7.91ns 0.249 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 111μs 77.8ns 301ns 0.0556 0 0 4.23 KB
master EnrichedLog netcoreapp3.1 119μs 287ns 1.11μs 0.0591 0 0 4.23 KB
master EnrichedLog net472 148μs 151ns 566ns 0.665 0.222 0 4.41 KB
#5260 EnrichedLog net6.0 114μs 211ns 818ns 0.0569 0 0 4.23 KB
#5260 EnrichedLog netcoreapp3.1 117μs 152ns 589ns 0 0 0 4.23 KB
#5260 EnrichedLog net472 147μs 152ns 567ns 0.662 0.221 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 3.02μs 1.21ns 4.35ns 0.0316 0 0 2.21 KB
master EnrichedLog netcoreapp3.1 4.15μs 2.14ns 8.27ns 0.0288 0 0 2.21 KB
master EnrichedLog net472 4.82μs 3.46ns 13.4ns 0.321 0 0 2.02 KB
#5260 EnrichedLog net6.0 3.03μs 1.19ns 4.45ns 0.0314 0 0 2.21 KB
#5260 EnrichedLog netcoreapp3.1 4.49μs 7.63ns 29.6ns 0.0307 0 0 2.21 KB
#5260 EnrichedLog net472 4.86μs 2.11ns 7.61ns 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.45μs 0.621ns 2.24ns 0.0167 0 0 1.18 KB
master SendReceive netcoreapp3.1 1.79μs 0.434ns 1.56ns 0.016 0 0 1.18 KB
master SendReceive net472 2.18μs 1.17ns 4.55ns 0.187 0 0 1.18 KB
#5260 SendReceive net6.0 1.49μs 2.41ns 9.01ns 0.0163 0 0 1.18 KB
#5260 SendReceive netcoreapp3.1 1.88μs 0.851ns 3.3ns 0.016 0 0 1.18 KB
#5260 SendReceive net472 2.26μs 1.36ns 5.27ns 0.186 0.00112 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.76μs 0.804ns 2.78ns 0.0221 0 0 1.55 KB
master EnrichedLog netcoreapp3.1 3.86μs 2.09ns 8.1ns 0.0214 0 0 1.6 KB
master EnrichedLog net472 4.51μs 3.37ns 13.1ns 0.315 0 0 1.99 KB
#5260 EnrichedLog net6.0 2.77μs 0.98ns 3.79ns 0.0208 0 0 1.55 KB
#5260 EnrichedLog netcoreapp3.1 3.91μs 1.67ns 6.24ns 0.0216 0 0 1.6 KB
#5260 EnrichedLog net472 4.44μs 3.14ns 11.7ns 0.315 0 0 1.99 KB
Benchmarks.Trace.SpanBenchmark - Slower :warning: Same allocations :heavy_check_mark:

Slower :warning: in #5260

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.121 464.02 520.16

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 464ns 0.309ns 1.16ns 0.00761 0 0 552 B
master StartFinishSpan netcoreapp3.1 685ns 0.576ns 2.16ns 0.0072 0 0 552 B
master StartFinishSpan net472 803ns 1.01ns 3.64ns 0.0879 0 0 554 B
master StartFinishScope net6.0 685ns 0.886ns 3.43ns 0.00959 0 0 672 B
master StartFinishScope netcoreapp3.1 872ns 0.722ns 2.8ns 0.00878 0 0 672 B
master StartFinishScope net472 977ns 1.28ns 4.95ns 0.1 0 0 634 B
#5260 StartFinishSpan net6.0 520ns 0.742ns 2.88ns 0.00761 0 0 552 B
#5260 StartFinishSpan netcoreapp3.1 721ns 0.75ns 2.71ns 0.00751 0 0 552 B
#5260 StartFinishSpan net472 770ns 1.12ns 4.32ns 0.0877 0 0 554 B
#5260 StartFinishScope net6.0 647ns 0.864ns 3.23ns 0.00934 0 0 672 B
#5260 StartFinishScope netcoreapp3.1 906ns 0.984ns 3.81ns 0.00876 0 0 672 B
#5260 StartFinishScope net472 920ns 1.18ns 4.58ns 0.101 0 0 634 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #5260

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.172 749.78 639.67

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 750ns 0.672ns 2.6ns 0.00945 0 0 672 B
master RunOnMethodBegin netcoreapp3.1 943ns 0.716ns 2.58ns 0.00918 0 0 672 B
master RunOnMethodBegin net472 1.1μs 1.29ns 4.99ns 0.101 0 0 634 B
#5260 RunOnMethodBegin net6.0 639ns 1.13ns 4.37ns 0.00932 0 0 672 B
#5260 RunOnMethodBegin netcoreapp3.1 970ns 1.45ns 5.62ns 0.00906 0 0 672 B
#5260 RunOnMethodBegin net472 1.17μs 1.13ns 4.37ns 0.1 0 0 634 B

andrewlock avatar Mar 15 '24 14:03 andrewlock

Benchmarks Report for appsec :snail:

Benchmarks for #5260 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.207
  • 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 #5260

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑netcoreapp3.1 1.286 255.94 199.09
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody‑net472 1.133 4,201.90 3,707.17

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 578ns 0.422ns 1.63ns 0.0153 0 0 1.08 KB
master AllCycleSimpleBody netcoreapp3.1 858ns 0.494ns 1.91ns 0.0146 0 0 1.06 KB
master AllCycleSimpleBody net472 690ns 0.214ns 0.802ns 0.174 0.000347 0 1.1 KB
master AllCycleMoreComplexBody net6.0 3.51μs 2.26ns 8.77ns 0.065 0 0 4.58 KB
master AllCycleMoreComplexBody netcoreapp3.1 4.76μs 2.38ns 9.2ns 0.0597 0 0 4.48 KB
master AllCycleMoreComplexBody net472 4.33μs 4.21ns 16.3ns 0.732 0.00864 0 4.61 KB
master ObjectExtractorSimpleBody net6.0 142ns 0.102ns 0.394ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 256ns 0.131ns 0.509ns 0.00371 0 0 272 B
master ObjectExtractorSimpleBody net472 174ns 0.263ns 1.02ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.08μs 1.26ns 4.72ns 0.0526 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.04μs 2.63ns 10.2ns 0.0503 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 4.2μs 2.86ns 10.7ns 0.602 0.00627 0 3.8 KB
#5260 AllCycleSimpleBody net6.0 546ns 0.652ns 2.53ns 0.0154 0 0 1.08 KB
#5260 AllCycleSimpleBody netcoreapp3.1 804ns 0.586ns 2.27ns 0.0145 0 0 1.06 KB
#5260 AllCycleSimpleBody net472 683ns 0.279ns 1.01ns 0.175 0.000345 0 1.1 KB
#5260 AllCycleMoreComplexBody net6.0 3.64μs 1.38ns 4.96ns 0.0636 0 0 4.58 KB
#5260 AllCycleMoreComplexBody netcoreapp3.1 4.67μs 3.58ns 13.9ns 0.0608 0 0 4.48 KB
#5260 AllCycleMoreComplexBody net472 4.35μs 2.37ns 8.85ns 0.732 0.00874 0 4.61 KB
#5260 ObjectExtractorSimpleBody net6.0 140ns 0.153ns 0.591ns 0.00395 0 0 280 B
#5260 ObjectExtractorSimpleBody netcoreapp3.1 199ns 0.083ns 0.311ns 0.00377 0 0 272 B
#5260 ObjectExtractorSimpleBody net472 169ns 0.331ns 1.28ns 0.0446 0 0 281 B
#5260 ObjectExtractorMoreComplexBody net6.0 3.12μs 2.26ns 8.47ns 0.053 0 0 3.78 KB
#5260 ObjectExtractorMoreComplexBody netcoreapp3.1 4.01μs 3.58ns 12.9ns 0.0498 0 0 3.69 KB
#5260 ObjectExtractorMoreComplexBody net472 3.71μs 2.42ns 9.05ns 0.603 0.00555 0 3.8 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 187μs 82.7ns 320ns 0 0 0 6.51 KB
master RunWafRealisticBenchmark netcoreapp3.1 205μs 687ns 2.57μs 0 0 0 6.49 KB
master RunWafRealisticBenchmark net472 222μs 58.4ns 202ns 1.02 0 0 6.59 KB
master RunWafRealisticBenchmarkWithAttack net6.0 125μs 331ns 1.28μs 0 0 0 4.15 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 133μs 144ns 498ns 0 0 0 4.14 KB
master RunWafRealisticBenchmarkWithAttack net472 147μs 125ns 468ns 0.656 0 0 4.19 KB
#5260 RunWafRealisticBenchmark net6.0 191μs 119ns 460ns 0.095 0 0 6.51 KB
#5260 RunWafRealisticBenchmark netcoreapp3.1 203μs 298ns 1.15μs 0 0 0 6.49 KB
#5260 RunWafRealisticBenchmark net472 226μs 130ns 505ns 0.997 0 0 6.59 KB
#5260 RunWafRealisticBenchmarkWithAttack net6.0 127μs 227ns 878ns 0.0625 0 0 4.15 KB
#5260 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 133μs 72.6ns 281ns 0 0 0 4.15 KB
#5260 RunWafRealisticBenchmarkWithAttack net472 145μs 119ns 463ns 0.65 0 0 4.19 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed :heavy_check_mark: More allocations :warning:

More allocations :warning: in #5260

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 202.09 KB 208.47 KB 6.38 KB 3.16%

Fewer allocations :tada: in #5260

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 62.2 KB 59.14 KB -3.06 KB -4.91%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 60.1μs 656ns 6.4μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 61.7μs 894ns 8.76μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.6μs 148ns 553ns 0 0 0 62.2 KB
master StringConcatAspectBenchmark net6.0 298μs 1.65μs 11.5μs 0 0 0 205.27 KB
master StringConcatAspectBenchmark netcoreapp3.1 307μs 1.64μs 8.38μs 0 0 0 202.09 KB
master StringConcatAspectBenchmark net472 263μs 4.63μs 44.9μs 0 0 0 221.18 KB
#5260 StringConcatBenchmark net6.0 53.6μs 280ns 1.31μs 0 0 0 43.44 KB
#5260 StringConcatBenchmark netcoreapp3.1 53.7μs 286ns 1.54μs 0 0 0 42.64 KB
#5260 StringConcatBenchmark net472 38.5μs 179ns 645ns 0 0 0 59.14 KB
#5260 StringConcatAspectBenchmark net6.0 299μs 1.34μs 5.03μs 0 0 0 206.15 KB
#5260 StringConcatAspectBenchmark netcoreapp3.1 289μs 5.78μs 56.4μs 0 0 0 208.47 KB
#5260 StringConcatAspectBenchmark net472 279μs 7.39μs 70.9μs 0 0 0 221.18 KB

andrewlock avatar Mar 15 '24 15:03 andrewlock