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] Remove httpcontext from context store at the end of the request #6151

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

Conversation

anna-git
Copy link
Contributor

Summary of changes

Some logs show that we're accessing HttpContext properties when it has already been disposed. Stacktrace shows that it's at the beginning of running the waf, so this might be a simple fix for now

Reason for change

Implementation details

Test coverage

Other details

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Oct 14, 2024

Datadog Report

Branch report: anna/asm/remove-httpcontext-endrequest
Commit report: 72481ad
Test service: dd-trace-dotnet

✅ 0 Failed, 363574 Passed, 2063 Skipped, 16h 5m 18.15s Total Time
❄️ 1 New Flaky
⌛ 1 Performance Regression

New Flaky Tests (1)

  • CanCreateDogStatsD_UDP_FromTraceAgentSettings - Datadog.Trace.Tests.DogStatsDTests - Last Failure

    Expand for error
     Address in use
    

⌛ Performance Regressions vs Default Branch (1)

  • StringConcatAspectBenchmark - Benchmarks.Trace.Iast.StringAspectsBenchmark 651.47µs (+313.06µs, +93%) - Details

@andrewlock
Copy link
Member

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 (6151) - mean (70ms)  : 67, 74
     .   : milestone, 70,
    master - mean (70ms)  : 67, 72
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (6151) - mean (1,111ms)  : 1091, 1130
     .   : milestone, 1111,
    master - mean (1,107ms)  : 1090, 1125
     .   : milestone, 1107,

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

    section CallTarget+Inlining+NGEN
    This PR (6151) - mean (770ms)  : 757, 783
     .   : milestone, 770,
    master - mean (769ms)  : 752, 786
     .   : milestone, 769,

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

    section CallTarget+Inlining+NGEN
    This PR (6151) - mean (729ms)  : 711, 747
     .   : milestone, 729,
    master - mean (727ms)  : 708, 747
     .   : milestone, 727,

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

    section CallTarget+Inlining+NGEN
    This PR (6151) - mean (1,197ms)  : 1170, 1225
     .   : milestone, 1197,
    master - mean (1,194ms)  : 1168, 1219
     .   : milestone, 1194,

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

    section CallTarget+Inlining+NGEN
    This PR (6151) - mean (939ms)  : 922, 957
     .   : milestone, 939,
    master - mean (942ms)  : 925, 958
     .   : milestone, 942,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6151) - mean (264ms)  : 260, 268
     .   : milestone, 264,
    master - mean (262ms)  : 259, 266
     .   : milestone, 262,

    section CallTarget+Inlining+NGEN
    This PR (6151) - mean (926ms)  : 901, 950
     .   : milestone, 926,
    master - mean (922ms)  : 904, 939
     .   : milestone, 922,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for appsec 🐌

Benchmarks for #6151 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.939
  • 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 - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 72.7μs 129ns 483ns 0.0717 0 0 6.01 KB
master AllCycleSimpleBody netcoreapp3.1 62.6μs 126ns 489ns 0.0936 0 0 6.95 KB
master AllCycleSimpleBody net472 49.3μs 136ns 526ns 1.32 0 0 8.34 KB
master AllCycleMoreComplexBody net6.0 78.4μs 89.9ns 348ns 0.119 0 0 9.51 KB
master AllCycleMoreComplexBody netcoreapp3.1 69.9μs 116ns 436ns 0.106 0 0 10.36 KB
master AllCycleMoreComplexBody net472 55.8μs 58.7ns 227ns 1.86 0.0278 0 11.85 KB
master ObjectExtractorSimpleBody net6.0 143ns 0.256ns 0.992ns 0.00395 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 208ns 0.179ns 0.67ns 0.00365 0 0 272 B
master ObjectExtractorSimpleBody net472 174ns 0.155ns 0.6ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.09μs 1.5ns 5.8ns 0.0541 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.97μs 1.77ns 6.39ns 0.0496 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.82μs 2.62ns 10.2ns 0.602 0.00574 0 3.8 KB
#6151 AllCycleSimpleBody net6.0 73.5μs 227ns 880ns 0.0745 0 0 6.01 KB
#6151 AllCycleSimpleBody netcoreapp3.1 63μs 113ns 437ns 0.0627 0 0 6.95 KB
#6151 AllCycleSimpleBody net472 48.7μs 65.4ns 253ns 1.32 0 0 8.34 KB
#6151 AllCycleMoreComplexBody net6.0 77.8μs 96.1ns 360ns 0.116 0 0 9.51 KB
#6151 AllCycleMoreComplexBody netcoreapp3.1 69.1μs 78.1ns 282ns 0.138 0 0 10.37 KB
#6151 AllCycleMoreComplexBody net472 56.3μs 43ns 161ns 1.88 0.0281 0 11.85 KB
#6151 ObjectExtractorSimpleBody net6.0 143ns 0.123ns 0.477ns 0.00391 0 0 280 B
#6151 ObjectExtractorSimpleBody netcoreapp3.1 208ns 0.112ns 0.417ns 0.00366 0 0 272 B
#6151 ObjectExtractorSimpleBody net472 164ns 0.421ns 1.57ns 0.0446 0 0 281 B
#6151 ObjectExtractorMoreComplexBody net6.0 3.06μs 1.38ns 5.36ns 0.0527 0 0 3.78 KB
#6151 ObjectExtractorMoreComplexBody netcoreapp3.1 4.12μs 2.42ns 9.07ns 0.0498 0 0 3.69 KB
#6151 ObjectExtractorMoreComplexBody net472 3.82μs 3.09ns 11.6ns 0.602 0.0057 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 18.6ns 67.1ns 0.448 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 53.9μs 23.5ns 91.1ns 0.431 0 0 32.4 KB
master EncodeArgs net472 66.6μs 37.9ns 147ns 5.14 0.0668 0 32.5 KB
master EncodeLegacyArgs net6.0 75.4μs 36.5ns 141ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 105μs 500ns 2μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 156μs 85.5ns 331ns 0.311 0 0 2.15 KB
#6151 EncodeArgs net6.0 38μs 21.4ns 83ns 0.452 0 0 32.4 KB
#6151 EncodeArgs netcoreapp3.1 54.4μs 25.8ns 100ns 0.433 0 0 32.4 KB
#6151 EncodeArgs net472 66.5μs 64.8ns 251ns 5.14 0.0664 0 32.5 KB
#6151 EncodeLegacyArgs net6.0 80.6μs 423ns 2.12μs 0 0 0 2.14 KB
#6151 EncodeLegacyArgs netcoreapp3.1 105μs 113ns 439ns 0 0 0 2.14 KB
#6151 EncodeLegacyArgs net472 155μs 35.7ns 138ns 0.313 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 185μs 124ns 480ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 198μs 242ns 936ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 211μs 142ns 550ns 0.318 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 122μs 134ns 519ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 97.8ns 339ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 139μs 65.4ns 253ns 0.208 0 0 1.49 KB
#6151 RunWafRealisticBenchmark net6.0 183μs 105ns 393ns 0 0 0 2.44 KB
#6151 RunWafRealisticBenchmark netcoreapp3.1 198μs 192ns 720ns 0 0 0 2.39 KB
#6151 RunWafRealisticBenchmark net472 209μs 102ns 394ns 0.314 0 0 2.46 KB
#6151 RunWafRealisticBenchmarkWithAttack net6.0 123μs 159ns 615ns 0 0 0 1.47 KB
#6151 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 116ns 434ns 0 0 0 1.46 KB
#6151 RunWafRealisticBenchmarkWithAttack net472 140μs 43.4ns 163ns 0.209 0 0 1.49 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #6151

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 1.939 333,200.00 646,200.00 bimodal

More allocations ⚠️ in #6151

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 252.61 KB 325.43 KB 72.82 KB 28.83%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.06 KB 57.8 KB 736 B 1.29%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 61.4μs 848ns 8.48μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 53.8μs 289ns 1.64μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 38.7μs 212ns 1.14μs 0 0 0 57.06 KB
master StringConcatAspectBenchmark net6.0 312μs 1.45μs 8.19μs 0 0 0 255.47 KB
master StringConcatAspectBenchmark netcoreapp3.1 333μs 2.56μs 24.9μs 0 0 0 252.61 KB
master StringConcatAspectBenchmark net472 275μs 4.88μs 46.6μs 0 0 0 278.53 KB
#6151 StringConcatBenchmark net6.0 61.2μs 816ns 8.12μs 0 0 0 43.44 KB
#6151 StringConcatBenchmark netcoreapp3.1 61μs 752ns 7.45μs 0 0 0 42.64 KB
#6151 StringConcatBenchmark net472 37.6μs 129ns 466ns 0 0 0 57.8 KB
#6151 StringConcatAspectBenchmark net6.0 314μs 1.63μs 8.47μs 0 0 0 254.86 KB
#6151 StringConcatAspectBenchmark netcoreapp3.1 651μs 3.49μs 18.1μs 0 0 0 325.43 KB
#6151 StringConcatAspectBenchmark net472 281μs 5.6μs 54.3μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6151 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.117
  • 1 benchmarks are slower, with geometric mean 1.152
  • 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 7.85μs 43.7ns 290ns 0.0124 0.00415 0 5.43 KB
master StartStopWithChild netcoreapp3.1 10μs 56.2ns 364ns 0.0207 0.0104 0 5.61 KB
master StartStopWithChild net472 16.6μs 38.7ns 150ns 1.03 0.313 0.104 6.08 KB
#6151 StartStopWithChild net6.0 7.75μs 43.5ns 295ns 0.0151 0.00378 0 5.43 KB
#6151 StartStopWithChild netcoreapp3.1 9.94μs 45.9ns 215ns 0.0194 0.0097 0 5.62 KB
#6151 StartStopWithChild net472 17μs 83.2ns 353ns 1.02 0.313 0.0931 6.07 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 478μs 146ns 545ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 634μs 206ns 800ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 844μs 654ns 2.53μs 0.419 0 0 3.3 KB
#6151 WriteAndFlushEnrichedTraces net6.0 485μs 724ns 2.8μs 0 0 0 2.7 KB
#6151 WriteAndFlushEnrichedTraces netcoreapp3.1 646μs 438ns 1.7μs 0 0 0 2.7 KB
#6151 WriteAndFlushEnrichedTraces net472 842μs 522ns 1.95μ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 190μs 1.03μs 6.24μs 0.201 0 0 18.45 KB
master SendRequest netcoreapp3.1 224μs 1.28μs 9.23μs 0.212 0 0 20.61 KB
master SendRequest net472 0.0314ns 0.00646ns 0.025ns 0 0 0 0 b
#6151 SendRequest net6.0 199μs 1.15μs 9.22μs 0.187 0 0 18.45 KB
#6151 SendRequest netcoreapp3.1 224μs 1.22μs 11.1μs 0.21 0 0 20.61 KB
#6151 SendRequest net472 0.000629ns 0.000357ns 0.00138ns 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 559μs 3μs 15.6μs 0.568 0 0 41.63 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 680μs 2.27μs 7.86μs 0.342 0 0 41.72 KB
master WriteAndFlushEnrichedTraces net472 843μs 2.27μs 8.17μs 8.56 2.57 0.428 53.27 KB
#6151 WriteAndFlushEnrichedTraces net6.0 567μs 1.98μs 7.12μs 0.563 0 0 41.5 KB
#6151 WriteAndFlushEnrichedTraces netcoreapp3.1 670μs 3.3μs 14.8μs 0.342 0 0 41.73 KB
#6151 WriteAndFlushEnrichedTraces net472 856μs 4.05μs 15.7μs 8.33 2.5 0.417 53.32 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.27μs 1.55ns 5.8ns 0.0145 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.76μs 2.38ns 8.9ns 0.0131 0 0 1.02 KB
master ExecuteNonQuery net472 2.1μs 1.85ns 6.93ns 0.157 0 0 987 B
#6151 ExecuteNonQuery net6.0 1.28μs 0.549ns 2.05ns 0.0141 0 0 1.02 KB
#6151 ExecuteNonQuery netcoreapp3.1 1.86μs 1.33ns 5.15ns 0.0132 0 0 1.02 KB
#6151 ExecuteNonQuery net472 2.15μs 2.8ns 10.8ns 0.156 0 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6151

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑netcoreapp3.1 1.114 1,629.04 1,462.85

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.09μs 1.22ns 4.72ns 0.0139 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.63μs 0.507ns 1.9ns 0.0129 0 0 976 B
master CallElasticsearch net472 2.55μs 1.26ns 4.89ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.28μs 0.419ns 1.51ns 0.0135 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.63μs 1.55ns 5.81ns 0.0138 0 0 1.02 KB
master CallElasticsearchAsync net472 2.57μs 2.41ns 9.02ns 0.166 0 0 1.05 KB
#6151 CallElasticsearch net6.0 1.21μs 0.842ns 3.26ns 0.0135 0 0 976 B
#6151 CallElasticsearch netcoreapp3.1 1.46μs 0.942ns 3.65ns 0.0133 0 0 976 B
#6151 CallElasticsearch net472 2.59μs 2.01ns 7.8ns 0.157 0 0 995 B
#6151 CallElasticsearchAsync net6.0 1.24μs 3.93ns 15.2ns 0.0134 0 0 952 B
#6151 CallElasticsearchAsync netcoreapp3.1 1.66μs 1.06ns 4.12ns 0.0141 0 0 1.02 KB
#6151 CallElasticsearchAsync net472 2.57μs 1.32ns 5.1ns 0.166 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.29μs 1.12ns 4.32ns 0.0129 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.66μs 3.5ns 13.6ns 0.0125 0 0 952 B
master ExecuteAsync net472 1.72μs 0.571ns 2.21ns 0.145 0 0 915 B
#6151 ExecuteAsync net6.0 1.32μs 1.87ns 6.99ns 0.0131 0 0 952 B
#6151 ExecuteAsync netcoreapp3.1 1.59μs 0.686ns 2.57ns 0.0127 0 0 952 B
#6151 ExecuteAsync net472 1.93μs 5.88ns 22.8ns 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.17μs 2.47ns 9.58ns 0.0311 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.01μs 2.23ns 8.65ns 0.0375 0 0 2.76 KB
master SendAsync net472 7.78μs 4.13ns 14.3ns 0.5 0 0 3.15 KB
#6151 SendAsync net6.0 4.06μs 2.46ns 9.21ns 0.0303 0 0 2.22 KB
#6151 SendAsync netcoreapp3.1 5.03μs 2.29ns 8.87ns 0.0377 0 0 2.76 KB
#6151 SendAsync net472 7.85μs 2.08ns 7.8ns 0.498 0 0 3.15 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.44μs 0.862ns 3.23ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.31μs 1.19ns 4.45ns 0.0219 0 0 1.64 KB
master EnrichedLog net472 2.69μs 0.793ns 2.86ns 0.25 0 0 1.57 KB
#6151 EnrichedLog net6.0 1.56μs 0.972ns 3.76ns 0.0232 0 0 1.64 KB
#6151 EnrichedLog netcoreapp3.1 2.37μs 4.36ns 16.9ns 0.0211 0 0 1.64 KB
#6151 EnrichedLog net472 2.67μs 0.997ns 3.73ns 0.25 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 118μs 134ns 501ns 0.0594 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 123μs 225ns 871ns 0 0 0 4.28 KB
master EnrichedLog net472 151μs 276ns 1.07μs 0.673 0.224 0 4.46 KB
#6151 EnrichedLog net6.0 117μs 205ns 793ns 0.0587 0 0 4.28 KB
#6151 EnrichedLog netcoreapp3.1 121μs 169ns 653ns 0 0 0 4.28 KB
#6151 EnrichedLog net472 149μs 144ns 557ns 0.673 0.224 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 2.91μs 1.11ns 4.29ns 0.0308 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.26μs 1.56ns 6.06ns 0.0299 0 0 2.2 KB
master EnrichedLog net472 4.95μs 3.49ns 13.5ns 0.318 0 0 2.02 KB
#6151 EnrichedLog net6.0 3.09μs 1.23ns 4.78ns 0.0312 0 0 2.2 KB
#6151 EnrichedLog netcoreapp3.1 4.16μs 1.9ns 7.36ns 0.0292 0 0 2.2 KB
#6151 EnrichedLog net472 4.78μs 1.95ns 7.54ns 0.32 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.44μs 0.536ns 2ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.75μs 1.06ns 4.11ns 0.0158 0 0 1.14 KB
master SendReceive net472 2.12μs 1.12ns 4.2ns 0.183 0.00106 0 1.16 KB
#6151 SendReceive net6.0 1.36μs 0.439ns 1.58ns 0.0164 0 0 1.14 KB
#6151 SendReceive netcoreapp3.1 1.91μs 1.08ns 4.19ns 0.0152 0 0 1.14 KB
#6151 SendReceive net472 2.13μs 1.18ns 4.56ns 0.183 0.00106 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.71μs 0.634ns 2.46ns 0.0217 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.97μs 1.38ns 5.18ns 0.0217 0 0 1.65 KB
master EnrichedLog net472 4.54μs 1.32ns 4.94ns 0.322 0 0 2.04 KB
#6151 EnrichedLog net6.0 2.77μs 0.963ns 3.61ns 0.0222 0 0 1.6 KB
#6151 EnrichedLog netcoreapp3.1 3.89μs 4.04ns 15.7ns 0.0212 0 0 1.65 KB
#6151 EnrichedLog net472 4.5μs 3.09ns 11.5ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6151

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.152 400.36 461.20

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 400ns 0.173ns 0.669ns 0.00805 0 0 576 B
master StartFinishSpan netcoreapp3.1 594ns 0.522ns 2.02ns 0.00781 0 0 576 B
master StartFinishSpan net472 720ns 0.394ns 1.53ns 0.0915 0 0 578 B
master StartFinishScope net6.0 483ns 0.242ns 0.939ns 0.0097 0 0 696 B
master StartFinishScope netcoreapp3.1 717ns 0.438ns 1.7ns 0.00935 0 0 696 B
master StartFinishScope net472 932ns 0.652ns 2.52ns 0.105 0 0 658 B
#6151 StartFinishSpan net6.0 461ns 0.168ns 0.651ns 0.00811 0 0 576 B
#6151 StartFinishSpan netcoreapp3.1 546ns 0.253ns 0.979ns 0.00772 0 0 576 B
#6151 StartFinishSpan net472 715ns 0.713ns 2.76ns 0.0917 0 0 578 B
#6151 StartFinishScope net6.0 485ns 0.258ns 0.999ns 0.0098 0 0 696 B
#6151 StartFinishScope netcoreapp3.1 712ns 0.319ns 1.19ns 0.00947 0 0 696 B
#6151 StartFinishScope net472 934ns 1.48ns 5.73ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6151

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.119 734.52 656.13

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 734ns 0.274ns 1.06ns 0.00982 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 916ns 0.21ns 0.758ns 0.00921 0 0 696 B
master RunOnMethodBegin net472 1.12μs 0.475ns 1.71ns 0.104 0 0 658 B
#6151 RunOnMethodBegin net6.0 656ns 0.573ns 2.22ns 0.00986 0 0 696 B
#6151 RunOnMethodBegin netcoreapp3.1 971ns 1.49ns 5.76ns 0.00929 0 0 696 B
#6151 RunOnMethodBegin net472 1.11μs 0.546ns 2.11ns 0.105 0 0 658 B

@andrewlock
Copy link
Member

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 (6151) (11.132M)   : 0, 11132364
    master (11.099M)   : 0, 11098662
    benchmarks/2.9.0 (11.081M)   : 0, 11080577

    section Automatic
    This PR (6151) (7.384M)   : 0, 7383991
    master (7.353M)   : 0, 7353407
    benchmarks/2.9.0 (7.732M)   : 0, 7732233

    section Trace stats
    master (7.604M)   : 0, 7604389

    section Manual
    master (10.912M)   : 0, 10911730

    section Manual + Automatic
    This PR (6151) (6.901M)   : 0, 6900607
    master (6.757M)   : 0, 6756825

    section DD_TRACE_ENABLED=0
    master (10.056M)   : 0, 10055906

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6151) (9.602M)   : 0, 9601550
    master (9.588M)   : 0, 9587958
    benchmarks/2.9.0 (9.798M)   : 0, 9798067

    section Automatic
    This PR (6151) (6.381M)   : 0, 6381148
    master (6.554M)   : 0, 6554472

    section Trace stats
    master (6.811M)   : 0, 6811095

    section Manual
    master (9.622M)   : 0, 9622473

    section Manual + Automatic
    This PR (6151) (5.930M)   : 0, 5929549
    master (5.894M)   : 0, 5893873

    section DD_TRACE_ENABLED=0
    master (8.887M)   : 0, 8886504

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6151) (10.070M)   : 0, 10070017
    master (10.171M)   : 0, 10171179
    benchmarks/2.9.0 (10.067M)   : 0, 10067315

    section Automatic
    This PR (6151) (6.754M)   : 0, 6754164
    master (6.514M)   : 0, 6513949
    benchmarks/2.9.0 (7.552M)   : 0, 7552193

    section Trace stats
    master (7.311M)   : 0, 7310649

    section Manual
    master (10.008M)   : 0, 10007638

    section Manual + Automatic
    This PR (6151) (6.169M)   : 0, 6168951
    master (6.286M)   : 0, 6285745

    section DD_TRACE_ENABLED=0
    master (9.389M)   : 0, 9388827

Loading

Copy link
Contributor

@NachoEchevarria NachoEchevarria left a comment

Choose a reason for hiding this comment

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

Thanks!

@anna-git anna-git marked this pull request as ready for review October 14, 2024 14:00
@anna-git anna-git requested review from a team as code owners October 14, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants