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

[CIVisibility] Tag profiles created by BenchmarkDotnet integration and add the IgnoreProfileAttribute #5568

Conversation

tonyredondo
Copy link
Member

Summary of changes

This PR tags Datadog profiles created by the BenchmarkDotnet integration with the CIVisibility origin and also adds a new IgnoreProfilerAttribute attribute to skip individual benchmark case or classes from the Datadog Profiler.

Also enables dogfooding of the integration.

Reason for change

  • We need to tag the profiles generated by the BenchmarkDotnet integration for billing purposes.
  • In the dogfooding we discover some conflict with the BenchmarkDotnet integration due the CIVisibility mode environment variable changing the Tracer behaviour (this only happens because we are dogfooding). With the IgnoreProfileAttribute we are able to just switch off the integration on all these problematic benchmark tests.

@tonyredondo tonyredondo self-assigned this May 16, 2024
@tonyredondo tonyredondo requested review from a team as code owners May 16, 2024 08:55
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented May 16, 2024

Datadog Report

Branch report: tony/civisibility-benchmark-profiler-ignorebenchmarkattribute
Commit report: 8b44141
Test service: dd-trace-dotnet

✅ 0 Failed, 334261 Passed, 1551 Skipped, 14h 10m 35.07s Total Time

@andrewlock
Copy link
Member

andrewlock commented May 16, 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 (5568) - mean (73ms)  : 64, 83
     .   : milestone, 73,
    master - mean (75ms)  : 67, 83
     .   : milestone, 75,

    section CallTarget+Inlining+NGEN
    This PR (5568) - mean (1,007ms)  : 981, 1033
     .   : milestone, 1007,
    master - mean (1,013ms)  : 987, 1039
     .   : milestone, 1013,

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

    section CallTarget+Inlining+NGEN
    This PR (5568) - mean (727ms)  : 701, 753
     .   : milestone, 727,
    master - mean (729ms)  : 708, 750
     .   : milestone, 729,

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

    section CallTarget+Inlining+NGEN
    This PR (5568) - mean (685ms)  : 665, 704
     .   : milestone, 685,
    master - mean (679ms)  : 655, 703
     .   : milestone, 679,

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

    section CallTarget+Inlining+NGEN
    This PR (5568) - mean (1,111ms)  : 1090, 1133
     .   : milestone, 1111,
    master - mean (1,115ms)  : 1091, 1139
     .   : milestone, 1115,

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

    section CallTarget+Inlining+NGEN
    This PR (5568) - mean (909ms)  : 890, 928
     .   : milestone, 909,
    master - mean (913ms)  : 891, 935
     .   : milestone, 913,

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

    section CallTarget+Inlining+NGEN
    This PR (5568) - mean (893ms)  : 869, 917
     .   : milestone, 893,
    master - mean (895ms)  : 873, 917
     .   : milestone, 895,

Loading

@andrewlock
Copy link
Member

andrewlock commented May 16, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5568 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.168
  • 18 benchmarks have fewer allocations
  • 1 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

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

Allocation changes below 0.5% are ignored.

Benchmark details

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

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 8.8μs 48.6ns 315ns 0.0218 0.00873 0 7.56 KB
master StartStopWithChild netcoreapp3.1 10.6μs 49.8ns 193ns 0.0215 0.0107 0 7.66 KB
master StartStopWithChild net472 17.1μs 56.2ns 218ns 1.33 0.342 0.102 8.06 KB
#5568 StartStopWithChild net6.0 8.79μs 47.2ns 259ns 0.0396 0.0176 0 7.56 KB
#5568 StartStopWithChild netcoreapp3.1 11μs 56.9ns 273ns 0.0224 0.0112 0 7.65 KB
#5568 StartStopWithChild net472 17.3μs 68.8ns 266ns 1.34 0.345 0.0925 8.05 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 507μs 168ns 629ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 622μs 459ns 1.78μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 823μs 404ns 1.51μs 0.411 0 0 3.3 KB
#5568 WriteAndFlushEnrichedTraces net6.0 463μs 111ns 429ns 0 0 0 2.7 KB
#5568 WriteAndFlushEnrichedTraces netcoreapp3.1 628μs 202ns 729ns 0 0 0 2.7 KB
#5568 WriteAndFlushEnrichedTraces net472 824μs 238ns 889ns 0.408 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 170μs 95ns 355ns 0.169 0 0 18.49 KB
master SendRequest netcoreapp3.1 192μs 270ns 1.05μs 0.192 0 0 20.65 KB
master SendRequest net472 0.000792ns 0.00041ns 0.00153ns 0 0 0 0 b
#5568 SendRequest net6.0 174μs 165ns 639ns 0.171 0 0 18.44 KB
#5568 SendRequest netcoreapp3.1 194μs 238ns 922ns 0.193 0 0 20.6 KB
#5568 SendRequest net472 0.149ns 0.000864ns 0.00335ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #5568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.69 KB 41.92 KB 230 B 0.55%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 547μs 301ns 1.17μs 0.548 0 0 41.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 650μs 2.49μs 9.66μs 0.324 0 0 41.69 KB
master WriteAndFlushEnrichedTraces net472 818μs 3.69μs 14.3μs 8.22 2.47 0.411 53.24 KB
#5568 WriteAndFlushEnrichedTraces net6.0 561μs 559ns 2.17μs 0.543 0 0 41.75 KB
#5568 WriteAndFlushEnrichedTraces netcoreapp3.1 655μs 1.69μs 6.56μs 0.326 0 0 41.92 KB
#5568 WriteAndFlushEnrichedTraces net472 844μs 4.41μs 21.2μs 8.22 2.47 0.411 53.27 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.09μs 0.739ns 2.86ns 0.0114 0 0 808 B
master ExecuteNonQuery netcoreapp3.1 1.5μs 0.948ns 3.67ns 0.0111 0 0 808 B
master ExecuteNonQuery net472 1.77μs 0.424ns 1.47ns 0.122 0 0 770 B
#5568 ExecuteNonQuery net6.0 1.15μs 0.897ns 3.48ns 0.0117 0 0 808 B
#5568 ExecuteNonQuery netcoreapp3.1 1.52μs 0.966ns 3.74ns 0.0111 0 0 808 B
#5568 ExecuteNonQuery net472 1.68μs 0.535ns 2ns 0.122 0 0 770 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #5568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net472 1.1 KB 1.05 KB -48 B -4.37%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net472 1.04 KB 995 B -48 B -4.60%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1 1.08 KB 1.02 KB -56 B -5.19%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 1.03 KB 976 B -56 B -5.43%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑netcoreapp3.1 1.03 KB 976 B -56 B -5.43%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 1.01 KB 952 B -56 B -5.56%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.25μs 0.668ns 2.59ns 0.0143 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 1.65μs 1.63ns 6.31ns 0.0141 0 0 1.03 KB
master CallElasticsearch net472 2.62μs 0.951ns 3.68ns 0.166 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.28μs 0.6ns 2.32ns 0.0141 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 1.7μs 1.31ns 5.06ns 0.0145 0 0 1.08 KB
master CallElasticsearchAsync net472 2.55μs 0.849ns 3.29ns 0.175 0 0 1.1 KB
#5568 CallElasticsearch net6.0 1.2μs 1.63ns 6.32ns 0.0138 0 0 976 B
#5568 CallElasticsearch netcoreapp3.1 1.51μs 0.703ns 2.63ns 0.0135 0 0 976 B
#5568 CallElasticsearch net472 2.64μs 2.65ns 10.3ns 0.157 0 0 995 B
#5568 CallElasticsearchAsync net6.0 1.35μs 1.71ns 6.4ns 0.0132 0 0 952 B
#5568 CallElasticsearchAsync netcoreapp3.1 1.65μs 1.27ns 4.9ns 0.014 0 0 1.02 KB
#5568 CallElasticsearchAsync net472 2.51μs 1.48ns 5.74ns 0.167 0.00125 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.28μs 0.925ns 3.46ns 0.0134 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.64μs 0.676ns 2.62ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.77μs 0.66ns 2.56ns 0.145 0.000883 0 915 B
#5568 ExecuteAsync net6.0 1.23μs 1.16ns 4.48ns 0.013 0 0 952 B
#5568 ExecuteAsync netcoreapp3.1 1.61μs 1.07ns 3.85ns 0.0128 0 0 952 B
#5568 ExecuteAsync net472 1.81μs 1.02ns 3.96ns 0.145 0.000897 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #5568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.HttpClientBenchmark.SendAsync‑netcoreapp3.1 2.81 KB 2.76 KB -48 B -1.71%
Benchmarks.Trace.HttpClientBenchmark.SendAsync‑net472 3.18 KB 3.12 KB -56 B -1.76%
Benchmarks.Trace.HttpClientBenchmark.SendAsync‑net6.0 2.27 KB 2.22 KB -48 B -2.11%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.11μs 1.74ns 6.75ns 0.0307 0 0 2.27 KB
master SendAsync netcoreapp3.1 5.08μs 3.47ns 12.5ns 0.0381 0 0 2.81 KB
master SendAsync net472 7.64μs 2.72ns 10.5ns 0.503 0 0 3.18 KB
#5568 SendAsync net6.0 4.14μs 2.27ns 8.49ns 0.0309 0 0 2.22 KB
#5568 SendAsync netcoreapp3.1 5.03μs 2.03ns 7.59ns 0.0373 0 0 2.76 KB
#5568 SendAsync net472 7.57μs 3.5ns 13.5ns 0.492 0 0 3.12 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #5568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.7 KB 1.64 KB -53 B -3.13%
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑netcoreapp3.1 1.7 KB 1.64 KB -53 B -3.13%
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net472 1.62 KB 1.57 KB -51 B -3.14%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.58μs 1.08ns 4.03ns 0.0238 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 2.23μs 1.18ns 4.41ns 0.0235 0 0 1.7 KB
master EnrichedLog net472 2.69μs 1.62ns 6.26ns 0.257 0 0 1.62 KB
#5568 EnrichedLog net6.0 1.44μs 0.604ns 2.26ns 0.0231 0 0 1.64 KB
#5568 EnrichedLog netcoreapp3.1 2.32μs 1.05ns 4.05ns 0.0219 0 0 1.64 KB
#5568 EnrichedLog net472 2.58μs 0.938ns 3.38ns 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 113μs 86.4ns 323ns 0.0562 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 117μs 119ns 459ns 0.0586 0 0 4.28 KB
master EnrichedLog net472 147μs 50.9ns 190ns 0.659 0.22 0 4.46 KB
#5568 EnrichedLog net6.0 114μs 198ns 765ns 0.0573 0 0 4.28 KB
#5568 EnrichedLog netcoreapp3.1 117μs 97.2ns 376ns 0.059 0 0 4.28 KB
#5568 EnrichedLog net472 148μs 45.4ns 164ns 0.662 0.221 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #5568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net6.0 2.25 KB 2.2 KB -53 B -2.35%
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑netcoreapp3.1 2.25 KB 2.2 KB -53 B -2.35%
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net472 2.07 KB 2.02 KB -50 B -2.42%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.88μs 0.727ns 2.72ns 0.0306 0 0 2.25 KB
master EnrichedLog netcoreapp3.1 4.25μs 1.88ns 7.04ns 0.0299 0 0 2.25 KB
master EnrichedLog net472 4.88μs 1.54ns 5.78ns 0.328 0 0 2.07 KB
#5568 EnrichedLog net6.0 3.03μs 1.35ns 5.22ns 0.0305 0 0 2.2 KB
#5568 EnrichedLog netcoreapp3.1 4.17μs 1.63ns 6.33ns 0.0291 0 0 2.2 KB
#5568 EnrichedLog net472 4.79μs 3.03ns 11.7ns 0.319 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #5568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.RedisBenchmark.SendReceive‑net472 1.2 KB 1.16 KB -49 B -4.07%
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 1.2 KB 1.14 KB -56 B -4.67%
Benchmarks.Trace.RedisBenchmark.SendReceive‑netcoreapp3.1 1.2 KB 1.14 KB -56 B -4.67%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.35μs 0.964ns 3.61ns 0.0168 0 0 1.2 KB
master SendReceive netcoreapp3.1 1.82μs 3.32ns 12.4ns 0.0163 0 0 1.2 KB
master SendReceive net472 2.25μs 1.42ns 5.33ns 0.19 0.00113 0 1.2 KB
#5568 SendReceive net6.0 1.27μs 0.556ns 2.08ns 0.0158 0 0 1.14 KB
#5568 SendReceive netcoreapp3.1 1.75μs 0.623ns 2.41ns 0.0158 0 0 1.14 KB
#5568 SendReceive net472 2.15μs 1.21ns 4.68ns 0.184 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.88μs 3.25ns 12.2ns 0.0216 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 4.18μs 4.84ns 18.8ns 0.0223 0 0 1.65 KB
master EnrichedLog net472 4.44μs 1.57ns 6.09ns 0.322 0 0 2.04 KB
#5568 EnrichedLog net6.0 2.73μs 1ns 3.61ns 0.0219 0 0 1.6 KB
#5568 EnrichedLog netcoreapp3.1 3.85μs 1.12ns 4.33ns 0.0229 0 0 1.65 KB
#5568 EnrichedLog net472 4.37μs 4.61ns 17.9ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5568

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.137 626.31 712.01

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 465ns 0.144ns 0.558ns 0.00814 0 0 576 B
master StartFinishSpan netcoreapp3.1 736ns 2.96ns 11.5ns 0.00758 0 0 576 B
master StartFinishSpan net472 892ns 0.204ns 0.764ns 0.0914 0 0 578 B
master StartFinishScope net6.0 626ns 0.293ns 1.1ns 0.0098 0 0 696 B
master StartFinishScope netcoreapp3.1 906ns 1.76ns 6.8ns 0.00952 0 0 696 B
master StartFinishScope net472 1.07μs 0.694ns 2.69ns 0.104 0 0 658 B
#5568 StartFinishSpan net6.0 510ns 0.138ns 0.534ns 0.00804 0 0 576 B
#5568 StartFinishSpan netcoreapp3.1 730ns 0.469ns 1.82ns 0.008 0 0 576 B
#5568 StartFinishSpan net472 831ns 0.705ns 2.73ns 0.0917 0 0 578 B
#5568 StartFinishScope net6.0 712ns 0.287ns 1.11ns 0.00987 0 0 696 B
#5568 StartFinishScope netcoreapp3.1 914ns 0.358ns 1.39ns 0.00957 0 0 696 B
#5568 StartFinishScope net472 1.04μs 1.15ns 4.44ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5568

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.201 606.79 728.51

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 607ns 0.185ns 0.715ns 0.00994 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 931ns 1.33ns 5.14ns 0.00914 0 0 696 B
master RunOnMethodBegin net472 1.13μs 0.343ns 1.33ns 0.104 0 0 658 B
#5568 RunOnMethodBegin net6.0 728ns 0.342ns 1.33ns 0.00984 0 0 696 B
#5568 RunOnMethodBegin netcoreapp3.1 965ns 0.268ns 0.967ns 0.00918 0 0 696 B
#5568 RunOnMethodBegin net472 1.14μs 0.542ns 2.1ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

andrewlock commented May 16, 2024

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 (5568) (12.001M)   : 0, 12001437
    master (11.879M)   : 0, 11879110
    benchmarks/2.9.0 (11.983M)   : 0, 11982622

    section Automatic
    This PR (5568) (8.124M)   : 0, 8123838
    master (8.054M)   : 0, 8053530
    benchmarks/2.9.0 (8.324M)   : 0, 8324349

    section Trace stats
    master (8.362M)   : 0, 8361687

    section Manual
    This PR (5568) (10.314M)   : 0, 10314058
    master (10.229M)   : 0, 10229080

    section Manual + Automatic
    This PR (5568) (7.559M)   : 0, 7558836
    master (7.641M)   : 0, 7641349

    section Version Conflict
    master (6.825M)   : 0, 6824800

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5568) (9.636M)   : 0, 9635866
    master (9.599M)   : 0, 9598656
    benchmarks/2.9.0 (9.587M)   : 0, 9587201

    section Automatic
    This PR (5568) (6.651M)   : 0, 6651151
    master (6.588M)   : 0, 6588326

    section Trace stats
    master (6.893M)   : 0, 6892670

    section Manual
    This PR (5568) (8.292M)   : 0, 8292417
    master (8.131M)   : 0, 8130516

    section Manual + Automatic
    This PR (5568) (6.234M)   : 0, 6233960
    master (6.167M)   : 0, 6167127

    section Version Conflict
    master (5.576M)   : 0, 5575919

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5568) (9.782M)   : 0, 9782191
    master (9.987M)   : 0, 9986822
    benchmarks/2.9.0 (9.913M)   : 0, 9912627

    section Automatic
    This PR (5568) (7.090M)   : 0, 7089826
    master (6.986M)   : 0, 6985911
    benchmarks/2.9.0 (7.312M)   : 0, 7312269

    section Trace stats
    master (7.286M)   : 0, 7285868

    section Manual
    This PR (5568) (8.672M)   : 0, 8671993
    master (8.789M)   : 0, 8788786

    section Manual + Automatic
    This PR (5568) (6.697M)   : 0, 6696966
    master (6.745M)   : 0, 6745109

    section Version Conflict
    master (6.204M)   : 0, 6204499

Loading

@andrewlock
Copy link
Member

andrewlock commented May 16, 2024

Benchmarks Report for appsec 🐌

Benchmarks for #5568 compared to master:

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

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 71.5μs 72.7ns 281ns 0.0713 0 0 6 KB
master AllCycleSimpleBody netcoreapp3.1 62.4μs 87.5ns 339ns 0.0931 0 0 6.94 KB
master AllCycleSimpleBody net472 47μs 59.8ns 207ns 1.31 0 0 8.33 KB
master AllCycleMoreComplexBody net6.0 77.5μs 79.7ns 298ns 0.116 0 0 9.5 KB
master AllCycleMoreComplexBody netcoreapp3.1 69.8μs 102ns 396ns 0.14 0 0 10.36 KB
master AllCycleMoreComplexBody net472 54.3μs 80.3ns 311ns 1.88 0.0272 0 11.84 KB
master ObjectExtractorSimpleBody net6.0 142ns 0.174ns 0.628ns 0.00398 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 205ns 1.03ns 4.61ns 0.00362 0 0 272 B
master ObjectExtractorSimpleBody net472 171ns 0.166ns 0.644ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.98μs 1.36ns 4.89ns 0.0536 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.03μs 1.32ns 4.93ns 0.0505 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.78μs 2.29ns 8.86ns 0.601 0.00569 0 3.8 KB
#5568 AllCycleSimpleBody net6.0 71.9μs 65.3ns 244ns 0.0721 0 0 6 KB
#5568 AllCycleSimpleBody netcoreapp3.1 62.1μs 95.8ns 371ns 0.0923 0 0 6.94 KB
#5568 AllCycleSimpleBody net472 48μs 71.2ns 276ns 1.32 0 0 8.33 KB
#5568 AllCycleMoreComplexBody net6.0 76.5μs 145ns 560ns 0.115 0 0 9.5 KB
#5568 AllCycleMoreComplexBody netcoreapp3.1 68.7μs 112ns 434ns 0.136 0 0 10.36 KB
#5568 AllCycleMoreComplexBody net472 56μs 61.6ns 231ns 1.86 0.0281 0 11.84 KB
#5568 ObjectExtractorSimpleBody net6.0 141ns 0.192ns 0.742ns 0.00394 0 0 280 B
#5568 ObjectExtractorSimpleBody netcoreapp3.1 201ns 0.135ns 0.524ns 0.00364 0 0 272 B
#5568 ObjectExtractorSimpleBody net472 174ns 0.148ns 0.575ns 0.0446 0 0 281 B
#5568 ObjectExtractorMoreComplexBody net6.0 3.02μs 2.68ns 10ns 0.0525 0 0 3.78 KB
#5568 ObjectExtractorMoreComplexBody netcoreapp3.1 3.96μs 2.11ns 7.9ns 0.0512 0 0 3.69 KB
#5568 ObjectExtractorMoreComplexBody net472 3.82μs 2.28ns 8.84ns 0.602 0.00572 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 40.5μs 25ns 93.5ns 0.467 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.7μs 21.7ns 83.9ns 0.437 0 0 32.4 KB
master EncodeArgs net472 68.3μs 55.9ns 216ns 5.15 0.0682 0 32.5 KB
master EncodeLegacyArgs net6.0 76.1μs 413ns 2.37μs 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 104μs 107ns 415ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 156μs 105ns 380ns 0.309 0 0 2.15 KB
#5568 EncodeArgs net6.0 39.9μs 21.9ns 84.7ns 0.457 0 0 32.4 KB
#5568 EncodeArgs netcoreapp3.1 55.2μs 20.9ns 80.8ns 0.437 0 0 32.4 KB
#5568 EncodeArgs net472 68.9μs 36.7ns 142ns 5.15 0.0687 0 32.5 KB
#5568 EncodeLegacyArgs net6.0 72μs 52.2ns 202ns 0 0 0 2.14 KB
#5568 EncodeLegacyArgs netcoreapp3.1 105μs 457ns 1.77μs 0 0 0 2.14 KB
#5568 EncodeLegacyArgs net472 154μs 88ns 341ns 0.307 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 182μs 62.7ns 243ns 0 0 0 2.34 KB
master RunWafRealisticBenchmark netcoreapp3.1 197μs 197ns 761ns 0 0 0 2.3 KB
master RunWafRealisticBenchmark net472 217μs 69ns 267ns 0.323 0 0 2.36 KB
master RunWafRealisticBenchmarkWithAttack net6.0 123μs 166ns 644ns 0 0 0 1.44 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 323ns 1.21μs 0 0 0 1.42 KB
master RunWafRealisticBenchmarkWithAttack net472 142μs 22.9ns 88.7ns 0.213 0 0 1.45 KB
#5568 RunWafRealisticBenchmark net6.0 182μs 82.8ns 310ns 0 0 0 2.34 KB
#5568 RunWafRealisticBenchmark netcoreapp3.1 199μs 128ns 496ns 0 0 0 2.3 KB
#5568 RunWafRealisticBenchmark net472 216μs 112ns 435ns 0.324 0 0 2.36 KB
#5568 RunWafRealisticBenchmarkWithAttack net6.0 121μs 40.2ns 156ns 0 0 0 1.44 KB
#5568 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 131μs 126ns 488ns 0 0 0 1.43 KB
#5568 RunWafRealisticBenchmarkWithAttack net472 142μs 67ns 251ns 0.213 0 0 1.45 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #5568

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 1.183 51,600.00 61,050.00 multimodal

Faster 🎉 in #5568

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 1.176 61,950.00 52,700.00 bimodal

More allocations ⚠️ in #5568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.07 KB 60.46 KB 1.39 KB 2.36%

Fewer allocations 🎉 in #5568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 268.81 KB 204.92 KB -63.89 KB -23.77%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 51.5μs 209ns 754ns 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 62.9μs 823ns 8.07μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 38.4μs 55.7ns 193ns 0 0 0 59.07 KB
master StringConcatAspectBenchmark net6.0 287μs 5.51μs 54.6μs 0 0 0 268.81 KB
master StringConcatAspectBenchmark netcoreapp3.1 303μs 1.58μs 10.7μs 0 0 0 201.81 KB
master StringConcatAspectBenchmark net472 240μs 1.3μs 7.55μs 0 0 0 229.38 KB
#5568 StringConcatBenchmark net6.0 61.5μs 849ns 8.49μs 0 0 0 43.44 KB
#5568 StringConcatBenchmark netcoreapp3.1 52.6μs 181ns 678ns 0 0 0 42.64 KB
#5568 StringConcatBenchmark net472 37.7μs 79.6ns 287ns 0 0 0 60.46 KB
#5568 StringConcatAspectBenchmark net6.0 295μs 1.08μs 3.73μs 0 0 0 204.92 KB
#5568 StringConcatAspectBenchmark netcoreapp3.1 305μs 1.55μs 8.5μs 0 0 0 201.69 KB
#5568 StringConcatAspectBenchmark net472 238μs 1.24μs 5.81μs 0 0 0 229.27 KB

@tonyredondo tonyredondo merged commit 353fb5e into master May 16, 2024
58 checks passed
@tonyredondo tonyredondo deleted the tony/civisibility-benchmark-profiler-ignorebenchmarkattribute branch May 16, 2024 16:36
@github-actions github-actions bot added this to the vNext-v2 milestone May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants