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

[ASM] Fixes for DefaultInterpolatedStringHandler flakiness #6375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

e-n-0
Copy link
Member

@e-n-0 e-n-0 commented Nov 29, 2024

Summary of changes

  • Add Pop() method to the tainted objects map: to remove the tainted object from the map after we know that the stack pointer of the DefaultInterpolatedStringHandler will be invalid
  • Remove useless unsafe keyword
  • Add Conv_U() to the IL

Reason for change

Flaky tests for Implicit interpolated Iast strings tainting.

Test coverage

Added new unit tests for the new Pop() method (checking for its integrity and good returned results).

@github-actions github-actions bot added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:asm labels Nov 29, 2024
@e-n-0 e-n-0 force-pushed the flavien/iast/interpolatedstring-tests branch from 6a1c526 to 458dbd5 Compare November 29, 2024 12:35
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 29, 2024

Datadog Report

Branch report: flavien/iast/interpolatedstring-tests
Commit report: a1f55fb
Test service: dd-trace-dotnet

❌ 19 Failed (0 Known Flaky), 381630 Passed, 2313 Skipped, 19h 29m 34.37s Total Time

❌ Failed Tests (19)

This report shows up to 5 failed tests.

  • TestIastSqliInterpolatedString - Datadog.Trace.Security.IntegrationTests.Iast.AspNetCore5IastTestsFullSamplingIastEnabled - Details

    Expand for error
     
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
         Resource: GET /iast/interpolatedsqlstring,
         Service: Samples.Security.AspNetCore5,
         Type: web,
         Tags: {
     ...
    
  • TestIastSqliInterpolatedString - Datadog.Trace.Security.IntegrationTests.Iast.AspNetCore5IastTestsFullSamplingIastEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Iast.SqliInterpolatedString.AspNetCore5.IastEnabled.received.txt
     Verified: Iast.SqliInterpolatedString.AspNetCore5.IastEnabled.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    
  • TestIastSqliInterpolatedString - Datadog.Trace.Security.IntegrationTests.Iast.AspNetCore5IastTestsFullSamplingIastEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Iast.SqliInterpolatedString.AspNetCore5.IastEnabled.received.txt
     Verified: Iast.SqliInterpolatedString.AspNetCore5.IastEnabled.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    
  • TestIastSqliInterpolatedString - Datadog.Trace.Security.IntegrationTests.Iast.AspNetCore5IastTestsFullSamplingIastEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Iast.SqliInterpolatedString.AspNetCore5.IastEnabled.received.txt
     Verified: Iast.SqliInterpolatedString.AspNetCore5.IastEnabled.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    
  • TestIastSqliInterpolatedString - Datadog.Trace.Security.IntegrationTests.Iast.AspNetCore5IastTestsFullSamplingIastEnabled - Details

    Expand for error
     Results do not match.
     Differences:
     Received: Iast.SqliInterpolatedString.AspNetCore5.IastEnabled.received.txt
     Verified: Iast.SqliInterpolatedString.AspNetCore5.IastEnabled.verified.txt
     Received Content:
     [
       {
         TraceId: Id_1,
         SpanId: Id_2,
         Name: aspnet_core.request,
     ...
    

@andrewlock
Copy link
Member

andrewlock commented Nov 29, 2024

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 (6375) - mean (69ms)  : 65, 74
     .   : milestone, 69,
    master - mean (69ms)  : 66, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6375) - mean (982ms)  : 950, 1013
     .   : milestone, 982,
    master - mean (983ms)  : 961, 1006
     .   : milestone, 983,

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

    section CallTarget+Inlining+NGEN
    This PR (6375) - mean (677ms)  : 661, 692
     .   : milestone, 677,
    master - mean (681ms)  : 663, 699
     .   : milestone, 681,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6375) - mean (91ms)  : 89, 93
     .   : milestone, 91,
    master - mean (91ms)  : 88, 93
     .   : milestone, 91,

    section CallTarget+Inlining+NGEN
    This PR (6375) - mean (630ms)  : 617, 643
     .   : milestone, 630,
    master - mean (632ms)  : 619, 645
     .   : milestone, 632,

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

    section CallTarget+Inlining+NGEN
    This PR (6375) - mean (1,094ms)  : 1060, 1128
     .   : milestone, 1094,
    master - mean (1,090ms)  : 1058, 1122
     .   : milestone, 1090,

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

    section CallTarget+Inlining+NGEN
    This PR (6375) - mean (871ms)  : 845, 897
     .   : milestone, 871,
    master - mean (869ms)  : 844, 894
     .   : milestone, 869,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6375) - mean (266ms)  : 262, 270
     .   : milestone, 266,
    master - mean (265ms)  : 261, 269
     .   : milestone, 265,

    section CallTarget+Inlining+NGEN
    This PR (6375) - mean (844ms)  : 812, 876
     .   : milestone, 844,
    master - mean (847ms)  : 817, 878
     .   : milestone, 847,

Loading

@andrewlock
Copy link
Member

andrewlock commented Nov 29, 2024

Benchmarks Report for appsec 🐌

Benchmarks for #6375 compared to master:

  • 3 benchmarks are slower, with geometric mean 1.117
  • 1 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.Asm.AppSecBodyBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6375

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑netcoreapp3.1 1.120 300,918.78 337,122.76
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net6.0 1.118 202,312.67 226,095.98
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net6.0 1.114 195,465.04 217,781.33

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 196μs 108ns 403ns 2.43 0.0972 0 176.97 KB
master AllCycleSimpleBody netcoreapp3.1 299μs 126ns 473ns 2.55 0 0 184.41 KB
master AllCycleSimpleBody net472 261μs 323ns 1.25μs 33.3 2.53 0 210.2 KB
master AllCycleMoreComplexBody net6.0 202μs 120ns 464ns 2.52 0.101 0 180.47 KB
master AllCycleMoreComplexBody netcoreapp3.1 301μs 129ns 499ns 2.59 0 0 187.82 KB
master AllCycleMoreComplexBody net472 274μs 250ns 968ns 33.9 2.46 0 213.72 KB
master ObjectExtractorSimpleBody net6.0 139ns 0.154ns 0.576ns 0.00391 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 202ns 0.176ns 0.68ns 0.00374 0 0 272 B
master ObjectExtractorSimpleBody net472 211ns 0.15ns 0.561ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.99μs 5.62ns 21.8ns 0.0525 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.05μs 2.92ns 11.3ns 0.0505 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 4.44μs 4.07ns 14.1ns 0.601 0.00668 0 3.8 KB
#6375 AllCycleSimpleBody net6.0 218μs 81.2ns 304ns 2.5 0 0 176.82 KB
#6375 AllCycleSimpleBody netcoreapp3.1 315μs 116ns 449ns 2.55 0 0 184.27 KB
#6375 AllCycleSimpleBody net472 280μs 328ns 1.27μs 33.3 2.51 0 210.04 KB
#6375 AllCycleMoreComplexBody net6.0 226μs 157ns 588ns 2.49 0 0 180.33 KB
#6375 AllCycleMoreComplexBody netcoreapp3.1 337μs 312ns 1.17μs 2.52 0 0 187.68 KB
#6375 AllCycleMoreComplexBody net472 304μs 159ns 594ns 33.9 2.6 0 213.56 KB
#6375 ObjectExtractorSimpleBody net6.0 143ns 0.118ns 0.442ns 0.00398 0 0 280 B
#6375 ObjectExtractorSimpleBody netcoreapp3.1 210ns 0.149ns 0.578ns 0.00372 0 0 272 B
#6375 ObjectExtractorSimpleBody net472 212ns 0.109ns 0.422ns 0.0446 0 0 281 B
#6375 ObjectExtractorMoreComplexBody net6.0 2.97μs 1.66ns 6.21ns 0.0536 0 0 3.78 KB
#6375 ObjectExtractorMoreComplexBody netcoreapp3.1 3.96μs 1.91ns 7.16ns 0.05 0 0 3.69 KB
#6375 ObjectExtractorMoreComplexBody net472 4.54μs 14.4ns 55.6ns 0.602 0.00458 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 37.6μs 16.7ns 60.3ns 0.452 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.3μs 26.5ns 103ns 0.433 0 0 32.4 KB
master EncodeArgs net472 66.5μs 34ns 127ns 5.14 0.0676 0 32.5 KB
master EncodeLegacyArgs net6.0 76.9μs 24.6ns 88.8ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 106μs 416ns 1.61μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 157μs 140ns 543ns 0.315 0 0 2.15 KB
#6375 EncodeArgs net6.0 39.7μs 15.2ns 59ns 0.454 0 0 32.4 KB
#6375 EncodeArgs netcoreapp3.1 54μs 20.1ns 75.2ns 0.428 0 0 32.4 KB
#6375 EncodeArgs net472 67.5μs 31.6ns 122ns 5.14 0.0681 0 32.5 KB
#6375 EncodeLegacyArgs net6.0 75.3μs 30.4ns 118ns 0.0383 0 0 2.14 KB
#6375 EncodeLegacyArgs netcoreapp3.1 105μs 345ns 1.34μs 0 0 0 2.14 KB
#6375 EncodeLegacyArgs net472 155μs 77.1ns 299ns 0.311 0 0 2.15 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 181μs 43.6ns 169ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 195μs 387ns 1.5μs 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 209μs 89.6ns 335ns 0.314 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 121μs 34.7ns 135ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 222ns 833ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 139μs 56.6ns 212ns 0.209 0 0 1.49 KB
#6375 RunWafRealisticBenchmark net6.0 187μs 476ns 1.84μs 0 0 0 2.44 KB
#6375 RunWafRealisticBenchmark netcoreapp3.1 197μs 459ns 1.78μs 0 0 0 2.39 KB
#6375 RunWafRealisticBenchmark net472 210μs 87.8ns 340ns 0.314 0 0 2.46 KB
#6375 RunWafRealisticBenchmarkWithAttack net6.0 122μs 75.2ns 271ns 0 0 0 1.47 KB
#6375 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 131μs 54.8ns 212ns 0 0 0 1.46 KB
#6375 RunWafRealisticBenchmarkWithAttack net472 140μs 60ns 225ns 0.209 0 0 1.49 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6375

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 252.77 KB 265.65 KB 12.88 KB 5.10%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.39 KB 61 KB 1.61 KB 2.71%

Fewer allocations 🎉 in #6375

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 255.15 KB 253.19 KB -1.96 KB -0.77%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 59.8μs 774ns 7.67μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 60.8μs 675ns 6.65μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.4μs 91.1ns 316ns 0 0 0 59.39 KB
master StringConcatAspectBenchmark net6.0 312μs 1.8μs 13.7μs 0 0 0 255.15 KB
master StringConcatAspectBenchmark netcoreapp3.1 308μs 5.92μs 57.3μs 0 0 0 252.77 KB
master StringConcatAspectBenchmark net472 292μs 6.82μs 65.4μs 0 0 0 278.53 KB
#6375 StringConcatBenchmark net6.0 52.6μs 261ns 1.07μs 0 0 0 43.44 KB
#6375 StringConcatBenchmark netcoreapp3.1 53.7μs 185ns 690ns 0 0 0 42.64 KB
#6375 StringConcatBenchmark net472 38.1μs 89ns 321ns 0 0 0 61 KB
#6375 StringConcatAspectBenchmark net6.0 310μs 1.76μs 12.3μs 0 0 0 253.19 KB
#6375 StringConcatAspectBenchmark netcoreapp3.1 325μs 5.95μs 57.6μs 0 0 0 265.65 KB
#6375 StringConcatAspectBenchmark net472 300μs 6.91μs 67.7μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

andrewlock commented Nov 29, 2024

Throughput/Crank Report ⚡

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 (6375) (11.137M)   : 0, 11137062
    master (10.950M)   : 0, 10950268
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6375) (7.275M)   : 0, 7275394
    master (7.144M)   : 0, 7144062
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.592M)   : 0, 7592116

    section Manual
    master (11.151M)   : 0, 11151368

    section Manual + Automatic
    This PR (6375) (6.687M)   : 0, 6687101
    master (6.721M)   : 0, 6721227

    section DD_TRACE_ENABLED=0
    master (10.133M)   : 0, 10132646

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6375) (9.528M)   : 0, 9528259
    master (9.581M)   : 0, 9581060
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6375) (6.387M)   : 0, 6386609
    master (6.411M)   : 0, 6411077

    section Trace stats
    master (6.557M)   : 0, 6557433

    section Manual
    master (9.539M)   : 0, 9539314

    section Manual + Automatic
    This PR (6375) (5.724M)   : 0, 5724016
    master (5.854M)   : 0, 5854294

    section DD_TRACE_ENABLED=0
    master (8.891M)   : 0, 8890821

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6375) (9.752M)   : 0, 9751582
    master (10.194M)   : 0, 10193580
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6375) (6.327M)   : crit ,0, 6326664
    master (6.769M)   : 0, 6768819
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (7.357M)   : 0, 7356753

    section Manual
    master (10.447M)   : 0, 10447376

    section Manual + Automatic
    This PR (6375) (6.021M)   : 0, 6020608
    master (5.985M)   : 0, 5985300

    section DD_TRACE_ENABLED=0
    master (9.475M)   : 0, 9475300

Loading

@e-n-0 e-n-0 force-pushed the flavien/iast/interpolatedstring-tests branch from 458dbd5 to a1f55fb Compare November 29, 2024 17:31
@e-n-0 e-n-0 marked this pull request as ready for review November 29, 2024 17:34
@e-n-0 e-n-0 requested a review from a team as a code owner November 29, 2024 17:34
@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6375 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.137
  • 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.09μs 45ns 298ns 0.0167 0.00835 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.2μs 53.7ns 274ns 0.0147 0.00491 0 5.81 KB
master StartStopWithChild net472 16μs 27.1ns 105ns 1.06 0.326 0.103 6.22 KB
#6375 StartStopWithChild net6.0 7.88μs 45.1ns 352ns 0.015 0.00376 0 5.61 KB
#6375 StartStopWithChild netcoreapp3.1 10.1μs 48.1ns 192ns 0.0243 0.00974 0 5.8 KB
#6375 StartStopWithChild net472 16.4μs 49.9ns 193ns 1.04 0.31 0.0978 6.22 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 477μs 140ns 487ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 655μs 533ns 1.99μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 857μs 280ns 1.05μs 0.425 0 0 3.3 KB
#6375 WriteAndFlushEnrichedTraces net6.0 502μs 303ns 1.17μs 0 0 0 2.7 KB
#6375 WriteAndFlushEnrichedTraces netcoreapp3.1 669μs 328ns 1.23μs 0 0 0 2.7 KB
#6375 WriteAndFlushEnrichedTraces net472 839μs 318ns 1.23μs 0.419 0 0 3.3 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 147μs 856ns 7.7μs 0.152 0 0 14.47 KB
master SendRequest netcoreapp3.1 168μs 976ns 8.4μs 0.169 0 0 17.27 KB
master SendRequest net472 0.00207ns 0.000644ns 0.00249ns 0 0 0 0 b
#6375 SendRequest net6.0 150μs 859ns 6.31μs 0.14 0 0 14.47 KB
#6375 SendRequest netcoreapp3.1 172μs 975ns 7.49μs 0.167 0 0 17.27 KB
#6375 SendRequest net472 0.00435ns 0.00151ns 0.00584ns 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 574μs 3.15μs 20.7μs 0.598 0 0 41.78 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 684μs 3.23μs 13.7μs 0.349 0 0 41.89 KB
master WriteAndFlushEnrichedTraces net472 871μs 4.13μs 17μs 8.25 2.6 0.434 53.31 KB
#6375 WriteAndFlushEnrichedTraces net6.0 571μs 2.17μs 8.13μs 0.548 0 0 41.64 KB
#6375 WriteAndFlushEnrichedTraces netcoreapp3.1 685μs 3.25μs 12.6μs 0.34 0 0 41.7 KB
#6375 WriteAndFlushEnrichedTraces net472 868μs 3.95μs 15.3μs 8.3 2.62 0.437 53.26 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.24μs 0.89ns 3.45ns 0.0144 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.82μs 1.21ns 4.54ns 0.0137 0 0 1.02 KB
master ExecuteNonQuery net472 2.04μs 1.74ns 6.75ns 0.157 0.00103 0 987 B
#6375 ExecuteNonQuery net6.0 1.34μs 0.959ns 3.59ns 0.0142 0 0 1.02 KB
#6375 ExecuteNonQuery netcoreapp3.1 1.72μs 3.59ns 13.9ns 0.0138 0 0 1.02 KB
#6375 ExecuteNonQuery net472 2.15μs 1.66ns 6.41ns 0.157 0.00107 0 987 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.19μs 3.02ns 11.7ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.58μs 0.67ns 2.51ns 0.0126 0 0 976 B
master CallElasticsearch net472 2.66μs 3.01ns 11.6ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.38μs 0.634ns 2.37ns 0.0133 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.57μs 1.02ns 3.83ns 0.0142 0 0 1.02 KB
master CallElasticsearchAsync net472 2.64μs 1.13ns 4.39ns 0.166 0 0 1.05 KB
#6375 CallElasticsearch net6.0 1.2μs 0.664ns 2.48ns 0.0139 0 0 976 B
#6375 CallElasticsearch netcoreapp3.1 1.62μs 1.7ns 6.57ns 0.013 0 0 976 B
#6375 CallElasticsearch net472 2.5μs 0.78ns 2.92ns 0.157 0 0 995 B
#6375 CallElasticsearchAsync net6.0 1.25μs 0.674ns 2.61ns 0.0132 0 0 952 B
#6375 CallElasticsearchAsync netcoreapp3.1 1.6μs 3.25ns 12.6ns 0.0136 0 0 1.02 KB
#6375 CallElasticsearchAsync net472 2.67μs 0.905ns 3.39ns 0.167 0 0 1.05 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.37μs 0.709ns 2.75ns 0.0131 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.61μs 0.833ns 3.12ns 0.0129 0 0 952 B
master ExecuteAsync net472 1.83μs 0.843ns 3.16ns 0.145 0 0 915 B
#6375 ExecuteAsync net6.0 1.26μs 0.565ns 2.11ns 0.0135 0 0 952 B
#6375 ExecuteAsync netcoreapp3.1 1.67μs 0.733ns 2.74ns 0.0126 0 0 952 B
#6375 ExecuteAsync net472 1.8μs 0.476ns 1.78ns 0.145 0 0 915 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.45μs 4.68ns 18.1ns 0.0311 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.32μs 4.34ns 16.8ns 0.0369 0 0 2.85 KB
master SendAsync net472 7.35μs 3ns 11.6ns 0.493 0 0 3.12 KB
#6375 SendAsync net6.0 4.42μs 1.93ns 7.47ns 0.033 0 0 2.31 KB
#6375 SendAsync netcoreapp3.1 5.41μs 1.5ns 5.8ns 0.0377 0 0 2.85 KB
#6375 SendAsync net472 7.37μs 1.12ns 4.21ns 0.495 0 0 3.12 KB
Benchmarks.Trace.ILoggerBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6375

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.137 1,628.44 1,432.35

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.63μs 0.737ns 2.66ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.32μs 4.1ns 15.9ns 0.0219 0 0 1.64 KB
master EnrichedLog net472 2.61μs 1.97ns 7.37ns 0.249 0 0 1.57 KB
#6375 EnrichedLog net6.0 1.43μs 0.689ns 2.58ns 0.0229 0 0 1.64 KB
#6375 EnrichedLog netcoreapp3.1 2.33μs 3.22ns 12.5ns 0.0221 0 0 1.64 KB
#6375 EnrichedLog net472 2.51μs 0.977ns 3.66ns 0.249 0 0 1.57 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 119μs 73.5ns 265ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 125μs 148ns 573ns 0 0 0 4.28 KB
master EnrichedLog net472 153μs 104ns 401ns 0.687 0.229 0 4.46 KB
#6375 EnrichedLog net6.0 118μs 119ns 461ns 0.06 0 0 4.28 KB
#6375 EnrichedLog netcoreapp3.1 123μs 147ns 570ns 0.0622 0 0 4.28 KB
#6375 EnrichedLog net472 152μs 154ns 597ns 0.687 0.229 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 3.07μs 1.91ns 7.39ns 0.0308 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.16μs 3.72ns 14.4ns 0.0292 0 0 2.2 KB
master EnrichedLog net472 4.93μs 1.72ns 6.42ns 0.321 0 0 2.02 KB
#6375 EnrichedLog net6.0 3.02μs 0.947ns 3.67ns 0.0304 0 0 2.2 KB
#6375 EnrichedLog netcoreapp3.1 4.1μs 1.69ns 6.33ns 0.0288 0 0 2.2 KB
#6375 EnrichedLog net472 4.78μs 1.96ns 7.6ns 0.319 0 0 2.02 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.34μs 0.734ns 2.84ns 0.0161 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.78μs 0.893ns 3.46ns 0.0151 0 0 1.14 KB
master SendReceive net472 2.09μs 1.32ns 5.12ns 0.184 0 0 1.16 KB
#6375 SendReceive net6.0 1.32μs 0.525ns 2.03ns 0.0159 0 0 1.14 KB
#6375 SendReceive netcoreapp3.1 1.8μs 1.2ns 4.48ns 0.0152 0 0 1.14 KB
#6375 SendReceive net472 2.12μs 1.65ns 6.39ns 0.183 0 0 1.16 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.6μs 2.99ns 11.6ns 0.0223 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.88μs 3.83ns 14.3ns 0.0214 0 0 1.65 KB
master EnrichedLog net472 4.43μs 1.31ns 5.09ns 0.322 0 0 2.04 KB
#6375 EnrichedLog net6.0 2.78μs 1.04ns 4.03ns 0.0222 0 0 1.6 KB
#6375 EnrichedLog netcoreapp3.1 4.03μs 1.54ns 5.78ns 0.022 0 0 1.65 KB
#6375 EnrichedLog net472 4.44μs 1.15ns 4.29ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 402ns 0.756ns 2.93ns 0.00813 0 0 576 B
master StartFinishSpan netcoreapp3.1 552ns 0.799ns 3.1ns 0.00773 0 0 576 B
master StartFinishSpan net472 603ns 1.43ns 5.53ns 0.0917 0 0 578 B
master StartFinishScope net6.0 538ns 1.08ns 4.17ns 0.00966 0 0 696 B
master StartFinishScope netcoreapp3.1 690ns 1.15ns 4.45ns 0.00942 0 0 696 B
master StartFinishScope net472 855ns 1.8ns 6.98ns 0.104 0 0 658 B
#6375 StartFinishSpan net6.0 396ns 1.54ns 5.97ns 0.00799 0 0 576 B
#6375 StartFinishSpan netcoreapp3.1 613ns 0.783ns 3.03ns 0.008 0 0 576 B
#6375 StartFinishSpan net472 661ns 1.32ns 5.11ns 0.0915 0 0 578 B
#6375 StartFinishScope net6.0 486ns 0.888ns 3.44ns 0.00989 0 0 696 B
#6375 StartFinishScope netcoreapp3.1 686ns 3.12ns 12.1ns 0.00934 0 0 696 B
#6375 StartFinishScope net472 849ns 2.3ns 8.9ns 0.104 0 0 658 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 600ns 0.881ns 3.41ns 0.00974 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 903ns 1.62ns 6.26ns 0.0095 0 0 696 B
master RunOnMethodBegin net472 1.08μs 1.23ns 4.6ns 0.104 0 0 658 B
#6375 RunOnMethodBegin net6.0 582ns 0.874ns 3.39ns 0.00969 0 0 696 B
#6375 RunOnMethodBegin netcoreapp3.1 894ns 2.08ns 8.07ns 0.00941 0 0 696 B
#6375 RunOnMethodBegin net472 1.09μs 2.18ns 8.43ns 0.104 0 0 658 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants