Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nullable annotations to the datadog logging files #4994

Merged
merged 4 commits into from
Dec 27, 2023

Conversation

andrewlock
Copy link
Member

Summary of changes

  • Add #nullable enable to all the internal logging files that are missing them
  • Update the analyzer packages to support c#12
  • Update the log analyzer to support the new APIs

Reason for change

Request in PR review in #4987

Implementation details

Mostly obvious. The only controversial part is that I used c#12 collection literals in some places, as they're basically recommended as the way to do things now, as they give the chance for the compiler to (potentially) do some magic to speed things up.

Unfortunately, stylecop doesn't like them yet (though it's already fixed in an unreleased version) so added a pragma for now. I can revert to the normal/old style if people prefer, otherwise will remove the pragma once it does.

Unfortunately, when I tested these changes, it broke all the log analyzers we use, so had to update them. While I was at it, I updated the code analysis packages to the latest to support c#12 etc

Test coverage

Added another test for collection initializers, but otherwise updated the existing tests

Other details

Will likely stack the tracer flare PRs on top of this

@andrewlock andrewlock added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:cleanup Minor code clean up labels Dec 20, 2023
@andrewlock andrewlock requested a review from a team as a code owner December 20, 2023 13:38
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Dec 20, 2023

Datadog Report

Branch report: andrew/tracer_flare/add_nrt_to_logging
Commit report: d6aaead

dd-trace-dotnet: 0 Failed, 0 New Flaky, 302511 Passed, 990 Skipped, 30m 26.23s Wall Time

@andrewlock
Copy link
Member Author

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4994) - mean (71ms)  : 63, 80
     .   : milestone, 71,
    master - mean (71ms)  : 64, 79
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (4994) - mean (1,024ms)  : 1002, 1047
     .   : milestone, 1024,
    master - mean (1,028ms)  : 1002, 1054
     .   : milestone, 1028,

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

    section CallTarget+Inlining+NGEN
    This PR (4994) - mean (728ms)  : 709, 748
     .   : milestone, 728,
    master - mean (732ms)  : 714, 750
     .   : milestone, 732,

gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4994) - mean (90ms)  : 87, 94
     .   : milestone, 90,
    master - mean (90ms)  : 86, 95
     .   : milestone, 90,

    section CallTarget+Inlining+NGEN
    This PR (4994) - mean (692ms)  : 667, 717
     .   : milestone, 692,
    master - mean (690ms)  : 672, 709
     .   : milestone, 690,

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

    section CallTarget+Inlining+NGEN
    This PR (4994) - mean (1,127ms)  : 1106, 1149
     .   : milestone, 1127,
    master - mean (1,120ms)  : 1096, 1144
     .   : milestone, 1120,

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

    section CallTarget+Inlining+NGEN
    This PR (4994) - mean (1,085ms)  : 1060, 1110
     .   : milestone, 1085,
    master - mean (1,077ms)  : 1047, 1106
     .   : milestone, 1077,

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

    section CallTarget+Inlining+NGEN
    This PR (4994) - mean (1,042ms)  : 1016, 1068
     .   : milestone, 1042,
    master - mean (1,041ms)  : 1013, 1069
     .   : milestone, 1041,

@andrewlock
Copy link
Member Author

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 (4994) (11.146M)   : 0, 11146271
    master (11.354M)   : 0, 11353768
    benchmarks/2.9.0 (11.360M)   : 0, 11360428

    section Automatic
    This PR (4994) (7.497M)   : 0, 7497411
    master (7.741M)   : 0, 7741493
    benchmarks/2.9.0 (8.355M)   : 0, 8354926

    section Trace stats
    This PR (4994) (7.751M)   : 0, 7751328
    master (7.842M)   : 0, 7841714

    section Manual
    This PR (4994) (9.456M)   : 0, 9455637
    master (9.416M)   : 0, 9416035

    section Manual + Automatic
    This PR (4994) (7.391M)   : 0, 7391384
    master (7.026M)   : 0, 7025673

    section Version Conflict
    This PR (4994) (6.671M)   : 0, 6670967
    master (6.289M)   : 0, 6289205

gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4994) (9.526M)   : 0, 9526462
    master (9.840M)   : 0, 9839946
    benchmarks/2.9.0 (9.457M)   : 0, 9456541

    section Automatic
    This PR (4994) (6.631M)   : 0, 6631314
    master (6.619M)   : 0, 6618751

    section Trace stats
    This PR (4994) (6.936M)   : 0, 6936190
    master (7.056M)   : 0, 7055903

    section Manual
    This PR (4994) (8.204M)   : 0, 8204435
    master (7.949M)   : 0, 7948925

    section Manual + Automatic
    This PR (4994) (6.184M)   : 0, 6184492
    master (6.161M)   : 0, 6160877

    section Version Conflict
    This PR (4994) (5.735M)   : 0, 5734859
    master (5.711M)   : 0, 5711044

gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4994) (10.456M)   : 0, 10455670
    master (10.209M)   : 0, 10209058
    benchmarks/2.9.0 (10.342M)   : 0, 10341934

    section Automatic
    This PR (4994) (7.353M)   : 0, 7352865
    master (7.550M)   : 0, 7549722
    benchmarks/2.9.0 (7.636M)   : 0, 7636137

    section Trace stats
    This PR (4994) (7.791M)   : 0, 7791073
    master (7.725M)   : 0, 7725382

    section Manual
    This PR (4994) (9.065M)   : 0, 9064806
    master (9.162M)   : 0, 9162432

    section Manual + Automatic
    This PR (4994) (6.945M)   : 0, 6944763
    master (7.261M)   : 0, 7261466

    section Version Conflict
    This PR (4994) (6.326M)   : crit ,0, 6325886
    master (6.710M)   : 0, 6710004

gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    master (7.351M)   : 0, 7351334
    benchmarks/2.9.0 (7.675M)   : 0, 7675468

    section No attack
    master (1.994M)   : 0, 1994109
    benchmarks/2.9.0 (3.152M)   : 0, 3151744

    section Attack
    master (1.571M)   : 0, 1571157
    benchmarks/2.9.0 (2.514M)   : 0, 2513990

    section Blocking
    master (3.289M)   : 0, 3289021

    section IAST default
    master (6.435M)   : 0, 6434844

    section IAST full
    master (5.774M)   : 0, 5773825

    section Base vuln
    master (0.941M)   : 0, 941308

    section IAST vuln
    master (0.873M)   : 0, 873056

@andrewlock
Copy link
Member Author

Benchmarks Report 🐌

Benchmarks for #4994 compared to master:

  • 3 benchmarks are faster, with geometric mean 1.187
  • 2 benchmarks are slower, with geometric mean 1.277
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

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

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 8.36μs 43.9ns 228ns 0.0255 0.0127 0 7.48 KB
master StartStopWithChild netcoreapp3.1 10.5μs 45.3ns 169ns 0.0259 0.0103 0 7.58 KB
master StartStopWithChild net472 17.2μs 57ns 221ns 1.33 0.353 0.12 7.95 KB
#4994 StartStopWithChild net6.0 8.19μs 45.1ns 259ns 0.0334 0.0125 0 7.48 KB
#4994 StartStopWithChild netcoreapp3.1 10.7μs 56.1ns 275ns 0.0347 0.0149 0 7.57 KB
#4994 StartStopWithChild net472 16.9μs 46.9ns 182ns 1.32 0.325 0.0942 7.94 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 463μs 441ns 1.65μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 634μs 247ns 957ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 789μs 172ns 595ns 0.393 0 0 3.3 KB
#4994 WriteAndFlushEnrichedTraces net6.0 461μs 263ns 1.02μs 0 0 0 2.7 KB
#4994 WriteAndFlushEnrichedTraces netcoreapp3.1 635μs 152ns 549ns 0 0 0 2.7 KB
#4994 WriteAndFlushEnrichedTraces net472 776μs 187ns 675ns 0.388 0 0 3.3 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4994

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑netcoreapp3.1 1.288 186.36 239.96

Faster 🎉 in #4994

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 1.142 179.54 157.18

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 43.3μs 63.4ns 246ns 0.0215 0 0 1.77 KB
master AllCycleSimpleBody netcoreapp3.1 46.9μs 95.7ns 371ns 0 0 0 1.74 KB
master AllCycleSimpleBody net472 49.3μs 97.3ns 377ns 0.271 0 0 1.81 KB
master AllCycleMoreComplexBody net6.0 215μs 112ns 433ns 0.107 0 0 9.25 KB
master AllCycleMoreComplexBody netcoreapp3.1 226μs 272ns 1.05μs 0.113 0 0 9.14 KB
master AllCycleMoreComplexBody net472 240μs 118ns 457ns 1.43 0 0 9.32 KB
master ObjectExtractorSimpleBody net6.0 131ns 0.0784ns 0.293ns 0.00396 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 186ns 0.0723ns 0.28ns 0.0037 0 0 272 B
master ObjectExtractorSimpleBody net472 180ns 0.0767ns 0.297ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.82μs 1.07ns 4.15ns 0.0529 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.63μs 0.983ns 3.68ns 0.0492 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.46μs 1.86ns 6.95ns 0.603 0.00517 0 3.8 KB
#4994 AllCycleSimpleBody net6.0 44.3μs 19.4ns 72.7ns 0.0222 0 0 1.77 KB
#4994 AllCycleSimpleBody netcoreapp3.1 45.9μs 81.4ns 315ns 0 0 0 1.74 KB
#4994 AllCycleSimpleBody net472 49.4μs 40ns 155ns 0.272 0 0 1.81 KB
#4994 AllCycleMoreComplexBody net6.0 216μs 98.6ns 382ns 0.107 0 0 9.25 KB
#4994 AllCycleMoreComplexBody netcoreapp3.1 226μs 232ns 838ns 0.113 0 0 9.14 KB
#4994 AllCycleMoreComplexBody net472 241μs 54.8ns 212ns 1.43 0 0 9.32 KB
#4994 ObjectExtractorSimpleBody net6.0 127ns 0.0632ns 0.219ns 0.00391 0 0 280 B
#4994 ObjectExtractorSimpleBody netcoreapp3.1 240ns 0.0746ns 0.289ns 0.00364 0 0 272 B
#4994 ObjectExtractorSimpleBody net472 157ns 0.0857ns 0.332ns 0.0446 0 0 281 B
#4994 ObjectExtractorMoreComplexBody net6.0 2.82μs 1.12ns 4.04ns 0.0536 0 0 3.78 KB
#4994 ObjectExtractorMoreComplexBody netcoreapp3.1 3.67μs 1.41ns 5.45ns 0.0494 0 0 3.69 KB
#4994 ObjectExtractorMoreComplexBody net472 3.52μs 1.88ns 7.28ns 0.602 0.00528 0 3.8 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWaf(args=NestedMap (10)) net6.0 49.7μs 20.1ns 78ns 0.209 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) netcoreapp3.1 66.3μs 212ns 735ns 0.2 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) net472 97.5μs 468ns 1.93μs 2.55 0.0944 0 16.14 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 123μs 287ns 1.11μs 0.301 0 0 22.41 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 143μs 743ns 3.57μs 0.277 0 0 22.36 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 174μs 736ns 2.85μs 3.59 0.171 0 22.7 KB
master RunWaf(args=NestedMap (100)) net6.0 101μs 550ns 3.3μs 0.439 0 0 32.76 KB
master RunWaf(args=NestedMap (100)) netcoreapp3.1 134μs 720ns 5.2μs 0.439 0 0 33.33 KB
master RunWaf(args=NestedMap (100)) net472 191μs 114ns 440ns 5.32 0.367 0 33.67 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 169μs 878ns 4.39μs 0.52 0 0 39.1 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 214μs 1.21μs 8.65μs 0.523 0 0 39.63 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net472 267μs 918ns 3.55μs 6.36 0.53 0 40.23 KB
master RunWaf(args=NestedMap (20)) net6.0 104μs 75.3ns 292ns 0.432 0 0 32.18 KB
master RunWaf(args=NestedMap (20)) netcoreapp3.1 135μs 689ns 3.16μs 0.38 0 0 32.3 KB
master RunWaf(args=NestedMap (20)) net472 190μs 412ns 1.59μs 5.16 0.369 0 32.63 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 171μs 942ns 5.88μs 0.49 0 0 38.53 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 212μs 560ns 2.17μs 0.517 0 0 38.6 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 263μs 229ns 856ns 6.15 0.392 0 39.2 KB
#4994 RunWaf(args=NestedMap (10)) net6.0 50μs 27.7ns 95.9ns 0.227 0 0 16.06 KB
#4994 RunWaf(args=NestedMap (10)) netcoreapp3.1 69.5μs 336ns 1.38μs 0.211 0 0 16.06 KB
#4994 RunWaf(args=NestedMap (10)) net472 98.6μs 37ns 143ns 2.53 0.0954 0 16.14 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 115μs 78.2ns 313ns 0.303 0 0 22.41 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 136μs 709ns 3.69μs 0.273 0 0 22.36 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [22]) net472 174μs 61.3ns 229ns 3.6 0.167 0 22.7 KB
#4994 RunWaf(args=NestedMap (100)) net6.0 95.4μs 34.2ns 132ns 0.447 0 0 32.76 KB
#4994 RunWaf(args=NestedMap (100)) netcoreapp3.1 129μs 646ns 2.81μs 0.438 0 0 33.33 KB
#4994 RunWaf(args=NestedMap (100)) net472 189μs 910ns 3.53μs 5.31 0.366 0 33.67 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 169μs 465ns 1.8μs 0.533 0 0 39.1 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 199μs 675ns 2.34μs 0.492 0 0 39.63 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [23]) net472 272μs 329ns 1.27μs 6.38 0.521 0 40.23 KB
#4994 RunWaf(args=NestedMap (20)) net6.0 102μs 59.7ns 231ns 0.409 0 0 32.18 KB
#4994 RunWaf(args=NestedMap (20)) netcoreapp3.1 131μs 714ns 3.91μs 0.402 0 0 32.3 KB
#4994 RunWaf(args=NestedMap (20)) net472 190μs 98ns 367ns 5.13 0.367 0 32.63 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 169μs 952ns 6.17μs 0.486 0 0 38.53 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 205μs 954ns 3.93μs 0.51 0 0 38.6 KB
#4994 RunWafWithAttack(args=Neste(...)tack) [22]) net472 270μs 220ns 852ns 6.13 0.522 0 39.2 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 173μs 245ns 950ns 0.172 0 0 18.25 KB
master SendRequest netcoreapp3.1 192μs 353ns 1.32μs 0.191 0 0 20.41 KB
master SendRequest net472 0.000859ns 0.000408ns 0.00158ns 0 0 0 0 b
#4994 SendRequest net6.0 170μs 219ns 848ns 0.171 0 0 18.25 KB
#4994 SendRequest netcoreapp3.1 192μs 216ns 837ns 0.19 0 0 20.41 KB
#4994 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 564μs 2.68μs 10.4μs 0.558 0 0 41.56 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 655μs 392ns 1.47μs 0.331 0 0 41.72 KB
master WriteAndFlushEnrichedTraces net472 824μs 2.23μs 8.33μs 8.28 2.48 0.414 53.22 KB
#4994 WriteAndFlushEnrichedTraces net6.0 543μs 1.55μs 5.99μs 0.568 0 0 41.47 KB
#4994 WriteAndFlushEnrichedTraces netcoreapp3.1 658μs 1.85μs 7.16μs 0.327 0 0 41.75 KB
#4994 WriteAndFlushEnrichedTraces net472 803μs 2.25μs 8.12μs 8.06 2.42 0.403 53.25 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.04μs 0.571ns 2.21ns 0.0104 0 0 768 B
master ExecuteNonQuery netcoreapp3.1 1.47μs 0.91ns 3.41ns 0.0103 0 0 768 B
master ExecuteNonQuery net472 1.75μs 4.16ns 16.1ns 0.116 0 0 730 B
#4994 ExecuteNonQuery net6.0 1.07μs 0.949ns 3.68ns 0.0107 0 0 768 B
#4994 ExecuteNonQuery netcoreapp3.1 1.48μs 1.34ns 5.18ns 0.0105 0 0 768 B
#4994 ExecuteNonQuery net472 1.79μs 0.773ns 2.99ns 0.115 0 0 730 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.24μs 0.486ns 1.88ns 0.013 0 0 936 B
master CallElasticsearch netcoreapp3.1 1.52μs 0.613ns 2.29ns 0.0129 0 0 936 B
master CallElasticsearch net472 2.61μs 0.481ns 1.8ns 0.151 0 0 955 B
master CallElasticsearchAsync net6.0 1.24μs 0.88ns 3.17ns 0.0128 0 0 912 B
master CallElasticsearchAsync netcoreapp3.1 1.64μs 1.55ns 5.81ns 0.0129 0 0 984 B
master CallElasticsearchAsync net472 2.75μs 1.41ns 5.46ns 0.16 0 0 1.01 KB
#4994 CallElasticsearch net6.0 1.16μs 0.767ns 2.87ns 0.0127 0 0 936 B
#4994 CallElasticsearch netcoreapp3.1 1.56μs 2.28ns 8.81ns 0.0123 0 0 936 B
#4994 CallElasticsearch net472 2.5μs 0.982ns 3.8ns 0.152 0 0 955 B
#4994 CallElasticsearchAsync net6.0 1.2μs 0.407ns 1.58ns 0.0127 0 0 912 B
#4994 CallElasticsearchAsync netcoreapp3.1 1.57μs 0.526ns 2.04ns 0.0133 0 0 984 B
#4994 CallElasticsearchAsync net472 2.76μs 1.47ns 5.7ns 0.16 0 0 1.01 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.35μs 1.44ns 5.38ns 0.0128 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.65μs 0.857ns 3.32ns 0.0116 0 0 912 B
master ExecuteAsync net472 1.86μs 1.16ns 4.5ns 0.139 0 0 875 B
#4994 ExecuteAsync net6.0 1.32μs 0.953ns 3.57ns 0.0128 0 0 912 B
#4994 ExecuteAsync netcoreapp3.1 1.62μs 0.606ns 2.35ns 0.0122 0 0 912 B
#4994 ExecuteAsync net472 1.88μs 1.5ns 5.79ns 0.139 0 0 875 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.09μs 1.6ns 6.2ns 0.0286 0 0 2.1 KB
master SendAsync netcoreapp3.1 4.93μs 1.35ns 5.24ns 0.0345 0 0 2.63 KB
master SendAsync net472 7.64μs 1.47ns 5.7ns 0.523 0 0 3.31 KB
#4994 SendAsync net6.0 4.08μs 1.84ns 7.12ns 0.0286 0 0 2.1 KB
#4994 SendAsync netcoreapp3.1 4.81μs 1.8ns 6.96ns 0.0338 0 0 2.63 KB
#4994 SendAsync net472 7.75μs 4.55ns 17.6ns 0.523 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4994

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net6.0 1.267 97,350.00 123,300.00 bimodal

Faster 🎉 in #4994

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑netcoreapp3.1 1.271 67,100.00 52,800.00 several?

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 61.2μs 755ns 7.52μs 0 0 0 43.44 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 67.2μs 709ns 6.8μs 0 0 0 42.64 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 38μs 165ns 597ns 0 0 0 59.98 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 93.7μs 2.74μs 27.4μs 0 0 0 43.29 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 117μs 2.32μs 23.2μs 0 0 0 42.64 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 64.7μs 338ns 2.06μs 0 0 0 57.34 KB
#4994 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 57.3μs 387ns 3.7μs 0 0 0 43.44 KB
#4994 StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 52.9μs 222ns 799ns 0 0 0 42.64 KB
#4994 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 38.5μs 158ns 613ns 0 0 0 59.77 KB
#4994 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 122μs 3.45μs 34.5μs 0 0 0 43.29 KB
#4994 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 111μs 2.82μs 28.2μs 0 0 0 42.64 KB
#4994 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 65μs 314ns 1.72μs 0 0 0 57.34 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.48μs 0.815ns 3.05ns 0.0221 0 0 1.57 KB
master EnrichedLog netcoreapp3.1 2.31μs 0.806ns 3.02ns 0.0206 0 0 1.57 KB
master EnrichedLog net472 2.52μs 3.34ns 12.5ns 0.237 0 0 1.5 KB
#4994 EnrichedLog net6.0 1.46μs 0.637ns 2.38ns 0.0221 0 0 1.57 KB
#4994 EnrichedLog netcoreapp3.1 2.11μs 0.749ns 2.59ns 0.021 0 0 1.57 KB
#4994 EnrichedLog net472 2.61μs 1.78ns 6.65ns 0.237 0 0 1.5 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 114μs 162ns 605ns 0.0559 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 121μs 382ns 1.48μs 0.0589 0 0 4.21 KB
master EnrichedLog net472 147μs 108ns 419ns 0.661 0.22 0 4.39 KB
#4994 EnrichedLog net6.0 114μs 160ns 621ns 0.0568 0 0 4.21 KB
#4994 EnrichedLog netcoreapp3.1 118μs 92.7ns 359ns 0.0593 0 0 4.21 KB
#4994 EnrichedLog net472 150μs 61.8ns 223ns 0.673 0.224 0 4.39 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.97μs 0.932ns 3.61ns 0.0305 0 0 2.13 KB
master EnrichedLog netcoreapp3.1 4.2μs 3.72ns 14.4ns 0.0291 0 0 2.13 KB
master EnrichedLog net472 4.91μs 1.48ns 5.73ns 0.309 0 0 1.95 KB
#4994 EnrichedLog net6.0 2.98μs 1.13ns 4.22ns 0.0295 0 0 2.13 KB
#4994 EnrichedLog netcoreapp3.1 4.25μs 9ns 33.7ns 0.0287 0 0 2.13 KB
#4994 EnrichedLog net472 5μs 1.21ns 4.2ns 0.307 0 0 1.95 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.46μs 1.32ns 4.92ns 0.0152 0 0 1.1 KB
master SendReceive netcoreapp3.1 1.68μs 0.675ns 2.61ns 0.015 0 0 1.1 KB
master SendReceive net472 2.03μs 1.8ns 6.72ns 0.176 0 0 1.12 KB
#4994 SendReceive net6.0 1.39μs 0.807ns 3.12ns 0.0152 0 0 1.1 KB
#4994 SendReceive netcoreapp3.1 1.8μs 0.601ns 2.25ns 0.0144 0 0 1.1 KB
#4994 SendReceive net472 2.09μs 1.14ns 4.25ns 0.177 0 0 1.12 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.72μs 1.06ns 3.96ns 0.0204 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.84μs 2.85ns 10.7ns 0.021 0 0 1.58 KB
master EnrichedLog net472 4.31μs 1.33ns 4.97ns 0.311 0 0 1.97 KB
#4994 EnrichedLog net6.0 2.8μs 1.57ns 5.87ns 0.021 0 0 1.53 KB
#4994 EnrichedLog netcoreapp3.1 3.95μs 1.77ns 6.36ns 0.0219 0 0 1.58 KB
#4994 EnrichedLog net472 4.37μs 1.86ns 7.2ns 0.312 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #4994

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.154 525.79 455.82

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 526ns 0.165ns 0.616ns 0.00743 0 0 536 B
master StartFinishSpan netcoreapp3.1 714ns 0.408ns 1.58ns 0.00715 0 0 536 B
master StartFinishSpan net472 789ns 0.21ns 0.814ns 0.0851 0 0 538 B
master StartFinishScope net6.0 517ns 0.156ns 0.604ns 0.00912 0 0 656 B
master StartFinishScope netcoreapp3.1 834ns 0.406ns 1.57ns 0.00893 0 0 656 B
master StartFinishScope net472 990ns 0.848ns 3.29ns 0.098 0 0 618 B
#4994 StartFinishSpan net6.0 456ns 0.142ns 0.549ns 0.00751 0 0 536 B
#4994 StartFinishSpan netcoreapp3.1 692ns 0.181ns 0.654ns 0.00701 0 0 536 B
#4994 StartFinishSpan net472 711ns 0.266ns 1.03ns 0.0853 0 0 538 B
#4994 StartFinishScope net6.0 534ns 0.159ns 0.616ns 0.00909 0 0 656 B
#4994 StartFinishScope netcoreapp3.1 881ns 0.255ns 0.885ns 0.00895 0 0 656 B
#4994 StartFinishScope net472 1.05μs 2.08ns 8.07ns 0.0981 0 0 618 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 662ns 0.388ns 1.5ns 0.00906 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 873ns 0.268ns 1.04ns 0.00876 0 0 656 B
master RunOnMethodBegin net472 1.08μs 0.493ns 1.91ns 0.098 0 0 618 B
#4994 RunOnMethodBegin net6.0 648ns 0.255ns 0.988ns 0.00912 0 0 656 B
#4994 RunOnMethodBegin netcoreapp3.1 964ns 3.49ns 13.5ns 0.0087 0 0 656 B
#4994 RunOnMethodBegin net472 1.14μs 0.297ns 1.15ns 0.098 0 0 618 B

Copy link
Contributor

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

Looks good to me

@andrewlock andrewlock merged commit c0e34dc into master Dec 27, 2023
55 checks passed
@andrewlock andrewlock deleted the andrew/tracer_flare/add_nrt_to_logging branch December 27, 2023 10:50
@github-actions github-actions bot added this to the vNext milestone Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:cleanup Minor code clean up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants