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

Compile native code with C++20 #4054

Merged
merged 9 commits into from
Nov 27, 2023
Merged

Compile native code with C++20 #4054

merged 9 commits into from
Nov 27, 2023

Conversation

gleocadie
Copy link
Collaborator

@gleocadie gleocadie commented Apr 18, 2023

Summary of changes

Compile native code using C++20.

Reason for change

The main reason would be to benefit from the latest features (language and libraries) that come with the C++20:

  • std::span
  • std::format
  • modules
  • concept/contracts (not that much in our code but still :)

This will ease writing C++ code (🤞 )

Implementation details

use std=c++20 in all projects (vcxproj/CMakeLists.txt) and adjust code where it's needed : coreclr headers (to compile on linux), logger

Test coverage

Other details

Fun fact (sad ?): contains member function is part of C++20. So now you can call contains on a list/dictionary... to check if an element is part of that collection instead of using iterators hell....

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@gleocadie gleocadie force-pushed the gleocadie/use-cpp20 branch 3 times, most recently from 8d6d3cf to d692a0e Compare April 19, 2023 10:10
@andrewlock
Copy link
Member

andrewlock commented Apr 19, 2023

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 (4054) - mean (71ms)  : 62, 81
     .   : milestone, 71,
    master - mean (70ms)  : 60, 79
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (4054) - mean (998ms)  : 975, 1021
     .   : milestone, 998,
    master - mean (996ms)  : 972, 1021
     .   : milestone, 996,

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

    section CallTarget+Inlining+NGEN
    This PR (4054) - mean (686ms)  : 665, 707
     .   : milestone, 686,
    master - mean (688ms)  : 669, 706
     .   : milestone, 688,

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

    section CallTarget+Inlining+NGEN
    This PR (4054) - mean (657ms)  : 620, 694
     .   : milestone, 657,
    master - mean (660ms)  : 636, 684
     .   : milestone, 660,

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

    section CallTarget+Inlining+NGEN
    This PR (4054) - mean (1,129ms)  : 1106, 1152
     .   : milestone, 1129,
    master - mean (1,133ms)  : 1114, 1151
     .   : milestone, 1133,

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

    section CallTarget+Inlining+NGEN
    This PR (4054) - mean (1,092ms)  : 1068, 1116
     .   : milestone, 1092,
    master - mean (1,092ms)  : 1062, 1121
     .   : milestone, 1092,

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

    section CallTarget+Inlining+NGEN
    This PR (4054) - mean (1,053ms)  : 1032, 1074
     .   : milestone, 1053,
    master - mean (1,051ms)  : 1030, 1072
     .   : milestone, 1051,

Loading

@andrewlock
Copy link
Member

andrewlock commented Apr 19, 2023

Benchmarks Report 🐌

Benchmarks for #4054 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.290
  • 3 benchmarks are slower, with geometric mean 1.134
  • 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.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.59μs 48.3ns 324ns 0.0217 0.00867 0 7.48 KB
master StartStopWithChild netcoreapp3.1 10.8μs 61.2ns 446ns 0.0267 0.016 0.00534 7.57 KB
master StartStopWithChild net472 17.1μs 40.2ns 156ns 1.35 0.358 0.119 7.96 KB
#4054 StartStopWithChild net6.0 8.91μs 49ns 306ns 0.0358 0.0134 0 7.48 KB
#4054 StartStopWithChild netcoreapp3.1 10.8μs 50.7ns 227ns 0.0288 0.0115 0 7.57 KB
#4054 StartStopWithChild net472 17.1μs 62.1ns 240ns 1.33 0.334 0.103 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 473μs 206ns 797ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 641μs 327ns 1.27μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 779μs 276ns 1.07μs 0.388 0 0 3.3 KB
#4054 WriteAndFlushEnrichedTraces net6.0 463μs 362ns 1.4μs 0 0 0 2.7 KB
#4054 WriteAndFlushEnrichedTraces netcoreapp3.1 633μs 155ns 582ns 0 0 0 2.7 KB
#4054 WriteAndFlushEnrichedTraces net472 777μs 267ns 1.03μs 0.388 0 0 3.3 KB
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 43.9μs 138ns 498ns 0.0219 0 0 1.77 KB
master AllCycleSimpleBody netcoreapp3.1 47μs 63.9ns 248ns 0.0233 0 0 1.74 KB
master AllCycleSimpleBody net472 49.2μs 131ns 492ns 0.274 0 0 1.81 KB
master AllCycleMoreComplexBody net6.0 223μs 1.27μs 9.32μs 0.106 0 0 9.25 KB
master AllCycleMoreComplexBody netcoreapp3.1 225μs 175ns 654ns 0.111 0 0 9.14 KB
master AllCycleMoreComplexBody net472 239μs 102ns 396ns 1.43 0 0 9.32 KB
master ObjectExtractorSimpleBody net6.0 137ns 0.0738ns 0.286ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 177ns 0.0432ns 0.167ns 0.00375 0 0 272 B
master ObjectExtractorSimpleBody net472 151ns 0.0632ns 0.245ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.74μs 0.915ns 3.54ns 0.0535 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.68μs 1.49ns 5.57ns 0.049 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.53μs 2.4ns 8.98ns 0.602 0.0053 0 3.8 KB
#4054 AllCycleSimpleBody net6.0 43.5μs 13.4ns 51.8ns 0.0219 0 0 1.77 KB
#4054 AllCycleSimpleBody netcoreapp3.1 47.7μs 242ns 1.08μs 0 0 0 1.74 KB
#4054 AllCycleSimpleBody net472 48.8μs 22.8ns 82.1ns 0.287 0 0 1.81 KB
#4054 AllCycleMoreComplexBody net6.0 214μs 169ns 654ns 0.106 0 0 9.25 KB
#4054 AllCycleMoreComplexBody netcoreapp3.1 225μs 192ns 744ns 0.112 0 0 9.14 KB
#4054 AllCycleMoreComplexBody net472 237μs 88.8ns 344ns 1.42 0 0 9.32 KB
#4054 ObjectExtractorSimpleBody net6.0 137ns 0.0329ns 0.123ns 0.00393 0 0 280 B
#4054 ObjectExtractorSimpleBody netcoreapp3.1 183ns 0.122ns 0.471ns 0.00377 0 0 272 B
#4054 ObjectExtractorSimpleBody net472 155ns 0.127ns 0.493ns 0.0446 0 0 281 B
#4054 ObjectExtractorMoreComplexBody net6.0 2.78μs 2.04ns 7.63ns 0.0533 0 0 3.78 KB
#4054 ObjectExtractorMoreComplexBody netcoreapp3.1 3.66μs 1.05ns 3.77ns 0.0515 0 0 3.69 KB
#4054 ObjectExtractorMoreComplexBody net472 3.51μs 1.75ns 6.55ns 0.602 0.00527 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 50.3μs 15.9ns 57.4ns 0.219 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) netcoreapp3.1 69.4μs 49.7ns 186ns 0.182 0 0 16.06 KB
master RunWaf(args=NestedMap (10)) net472 93.8μs 46ns 159ns 2.53 0.0938 0 16.14 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 119μs 55.4ns 215ns 0.297 0 0 22.41 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 138μs 84.4ns 316ns 0.281 0 0 22.36 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 171μs 820ns 3.28μs 3.57 0.166 0 22.7 KB
master RunWaf(args=NestedMap (100)) net6.0 97.4μs 446ns 1.73μs 0.454 0 0 32.76 KB
master RunWaf(args=NestedMap (100)) netcoreapp3.1 128μs 269ns 970ns 0.446 0 0 33.33 KB
master RunWaf(args=NestedMap (100)) net472 185μs 862ns 3.34μs 5.28 0.364 0 33.67 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 176μs 123ns 475ns 0.524 0 0 39.1 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 209μs 373ns 1.45μs 0.502 0 0 39.63 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net472 263μs 94.2ns 365ns 6.34 0.396 0 40.23 KB
master RunWaf(args=NestedMap (20)) net6.0 101μs 127ns 439ns 0.425 0 0 32.18 KB
master RunWaf(args=NestedMap (20)) netcoreapp3.1 133μs 710ns 3.82μs 0.381 0 0 32.3 KB
master RunWaf(args=NestedMap (20)) net472 182μs 84.8ns 328ns 5.19 0.364 0 32.63 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 165μs 64.5ns 281ns 0.533 0 0 38.53 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 205μs 1.02μs 4.56μs 0.523 0 0 38.6 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 267μs 1.2μs 4.64μs 6.21 0.518 0 39.2 KB
#4054 RunWaf(args=NestedMap (10)) net6.0 54.6μs 312ns 2.48μs 0.221 0 0 16.06 KB
#4054 RunWaf(args=NestedMap (10)) netcoreapp3.1 68.4μs 335ns 1.34μs 0.195 0 0 16.06 KB
#4054 RunWaf(args=NestedMap (10)) net472 94.1μs 38.1ns 137ns 2.54 0.0942 0 16.14 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 113μs 42.3ns 152ns 0.285 0 0 22.41 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 137μs 737ns 4.04μs 0.282 0 0 22.36 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [22]) net472 166μs 777ns 3.29μs 3.55 0.165 0 22.7 KB
#4054 RunWaf(args=NestedMap (100)) net6.0 99.5μs 271ns 1.05μs 0.452 0 0 32.76 KB
#4054 RunWaf(args=NestedMap (100)) netcoreapp3.1 131μs 637ns 2.77μs 0.435 0 0 33.33 KB
#4054 RunWaf(args=NestedMap (100)) net472 182μs 129ns 498ns 5.31 0.366 0 33.67 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 172μs 900ns 4.5μs 0.583 0 0 39.1 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 211μs 1.07μs 4.52μs 0.519 0 0 39.63 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [23]) net472 262μs 293ns 1.1μs 6.35 0.519 0 40.23 KB
#4054 RunWaf(args=NestedMap (20)) net6.0 103μs 578ns 3.66μs 0.423 0 0 32.18 KB
#4054 RunWaf(args=NestedMap (20)) netcoreapp3.1 134μs 494ns 1.91μs 0.394 0 0 32.3 KB
#4054 RunWaf(args=NestedMap (20)) net472 188μs 746ns 2.89μs 5.17 0.369 0 32.63 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 163μs 86.4ns 345ns 0.489 0 0 38.53 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 205μs 663ns 2.48μs 0.502 0 0 38.6 KB
#4054 RunWafWithAttack(args=Neste(...)tack) [22]) net472 257μs 159ns 618ns 6.12 0.51 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 124ns 446ns 0.258 0 0 18.24 KB
master SendRequest netcoreapp3.1 193μs 275ns 1.06μs 0.194 0 0 20.4 KB
master SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#4054 SendRequest net6.0 170μs 133ns 514ns 0.17 0 0 18.24 KB
#4054 SendRequest netcoreapp3.1 190μs 329ns 1.28μs 0.19 0 0 20.4 KB
#4054 SendRequest net472 0.000931ns 0.000415ns 0.00161ns 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 557μs 1.46μs 5.67μs 0.561 0 0 41.75 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 668μs 1.08μs 4.2μs 0.34 0 0 41.81 KB
master WriteAndFlushEnrichedTraces net472 817μs 3.6μs 13.9μs 8.06 2.42 0.403 53.23 KB
#4054 WriteAndFlushEnrichedTraces net6.0 542μs 243ns 875ns 0.543 0 0 41.58 KB
#4054 WriteAndFlushEnrichedTraces netcoreapp3.1 662μs 779ns 2.91μs 0.324 0 0 41.86 KB
#4054 WriteAndFlushEnrichedTraces net472 812μs 2.9μs 11.2μs 8.39 2.52 0.419 53.21 KB
Benchmarks.Trace.DbCommandBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4054

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 1.125 1,065.45 1,198.19

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.07μs 0.455ns 1.7ns 0.0108 0 0 768 B
master ExecuteNonQuery netcoreapp3.1 1.47μs 1.31ns 5.07ns 0.0101 0 0 768 B
master ExecuteNonQuery net472 1.7μs 0.684ns 2.47ns 0.116 0.000846 0 730 B
#4054 ExecuteNonQuery net6.0 1.2μs 1.09ns 4.21ns 0.0108 0 0 768 B
#4054 ExecuteNonQuery netcoreapp3.1 1.48μs 1.63ns 6.11ns 0.0103 0 0 768 B
#4054 ExecuteNonQuery net472 1.7μs 1.09ns 4.21ns 0.115 0 0 730 B
Benchmarks.Trace.ElasticsearchBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4054

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 1.116 1,127.66 1,258.10

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.13μs 2.79ns 10ns 0.013 0 0 936 B
master CallElasticsearch netcoreapp3.1 1.55μs 0.945ns 3.66ns 0.0124 0 0 936 B
master CallElasticsearch net472 2.43μs 0.838ns 3.13ns 0.151 0 0 955 B
master CallElasticsearchAsync net6.0 1.34μs 0.807ns 3.02ns 0.0128 0 0 912 B
master CallElasticsearchAsync netcoreapp3.1 1.61μs 0.982ns 3.67ns 0.0136 0 0 984 B
master CallElasticsearchAsync net472 2.75μs 0.5ns 1.87ns 0.159 0 0 1.01 KB
#4054 CallElasticsearch net6.0 1.26μs 0.565ns 2.11ns 0.0128 0 0 936 B
#4054 CallElasticsearch netcoreapp3.1 1.55μs 0.851ns 3.18ns 0.0124 0 0 936 B
#4054 CallElasticsearch net472 2.34μs 0.416ns 1.5ns 0.152 0 0 955 B
#4054 CallElasticsearchAsync net6.0 1.23μs 0.368ns 1.43ns 0.0124 0 0 912 B
#4054 CallElasticsearchAsync netcoreapp3.1 1.57μs 0.591ns 2.21ns 0.0134 0 0 984 B
#4054 CallElasticsearchAsync net472 2.67μs 0.543ns 1.96ns 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.32μs 0.758ns 2.94ns 0.0126 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.57μs 0.769ns 2.88ns 0.0119 0 0 912 B
master ExecuteAsync net472 1.81μs 0.444ns 1.72ns 0.139 0 0 875 B
#4054 ExecuteAsync net6.0 1.31μs 0.718ns 2.69ns 0.0124 0 0 912 B
#4054 ExecuteAsync netcoreapp3.1 1.57μs 0.931ns 3.48ns 0.0124 0 0 912 B
#4054 ExecuteAsync net472 1.94μs 0.95ns 3.56ns 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 3.99μs 2.59ns 9.7ns 0.0278 0 0 2.1 KB
master SendAsync netcoreapp3.1 4.95μs 1.66ns 6.41ns 0.0347 0 0 2.63 KB
master SendAsync net472 7.67μs 2.07ns 8.01ns 0.523 0 0 3.31 KB
#4054 SendAsync net6.0 4.06μs 1.36ns 5.26ns 0.0284 0 0 2.1 KB
#4054 SendAsync netcoreapp3.1 4.94μs 6.35ns 23.8ns 0.0343 0 0 2.63 KB
#4054 SendAsync net472 7.93μs 4.93ns 19.1ns 0.522 0 0 3.31 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #4054

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 1.319 62,400.00 47,300.00

More allocations ⚠️ in #4054

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 58.52 KB 59.7 KB 1.18 KB 2.01%

Fewer allocations 🎉 in #4054

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark(parameters: System.Collections.Generic.List`1[System.String])‑net472 73.73 KB 57.34 KB -16.38 KB -22.22%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 62μs 880ns 8.57μs 0 0 0 43.44 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 55.8μs 422ns 4.09μs 0 0 0 42.64 KB
master StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 38μs 173ns 648ns 0 0 0 58.52 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 91.2μs 3.1μs 31μs 0 0 0 43.29 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 71.7μs 375ns 1.87μs 0 0 0 42.64 KB
master StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 59.6μs 683ns 6.37μs 0 0 0 73.73 KB
#4054 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net6.0 51.3μs 214ns 771ns 0 0 0 43.44 KB
#4054 StringConcatBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 61.9μs 791ns 7.75μs 0 0 0 42.64 KB
#4054 StringConcatBenchmark(parameters=Syste(...)ring] [48]) net472 37.9μs 88.8ns 320ns 0 0 0 59.7 KB
#4054 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net6.0 104μs 2.51μs 25.1μs 0 0 0 43.29 KB
#4054 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) netcoreapp3.1 105μs 3.83μs 38.1μs 0 0 0 42.64 KB
#4054 StringConcatAspectBenchmark(parameters=Syste(...)ring] [48]) net472 47.3μs 119ns 429ns 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.44μs 0.519ns 1.94ns 0.0224 0 0 1.57 KB
master EnrichedLog netcoreapp3.1 2.17μs 0.494ns 1.78ns 0.0206 0 0 1.57 KB
master EnrichedLog net472 2.59μs 2.1ns 7.85ns 0.238 0 0 1.5 KB
#4054 EnrichedLog net6.0 1.47μs 0.766ns 2.87ns 0.0221 0 0 1.57 KB
#4054 EnrichedLog netcoreapp3.1 2.15μs 5.45ns 20.4ns 0.0214 0 0 1.57 KB
#4054 EnrichedLog net472 2.52μs 1.56ns 5.85ns 0.238 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 112μs 220ns 854ns 0.0555 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 118μs 283ns 1.1μs 0 0 0 4.21 KB
master EnrichedLog net472 148μs 193ns 746ns 0.662 0.221 0 4.39 KB
#4054 EnrichedLog net6.0 114μs 120ns 448ns 0.0569 0 0 4.21 KB
#4054 EnrichedLog netcoreapp3.1 118μs 136ns 509ns 0.0586 0 0 4.21 KB
#4054 EnrichedLog net472 149μs 134ns 503ns 0.671 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.91μs 1.12ns 4.17ns 0.0306 0 0 2.13 KB
master EnrichedLog netcoreapp3.1 4.18μs 1.29ns 4.99ns 0.0274 0 0 2.13 KB
master EnrichedLog net472 4.86μs 1.55ns 5.8ns 0.309 0 0 1.95 KB
#4054 EnrichedLog net6.0 3.09μs 1.36ns 5.26ns 0.0293 0 0 2.13 KB
#4054 EnrichedLog netcoreapp3.1 4.1μs 1.46ns 5.66ns 0.029 0 0 2.13 KB
#4054 EnrichedLog net472 4.92μs 2.84ns 10.6ns 0.309 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.33μs 1.75ns 6.79ns 0.0153 0 0 1.1 KB
master SendReceive netcoreapp3.1 1.7μs 4.22ns 16.3ns 0.0151 0 0 1.1 KB
master SendReceive net472 2.25μs 1.57ns 5.68ns 0.176 0 0 1.12 KB
#4054 SendReceive net6.0 1.39μs 0.89ns 3.33ns 0.0152 0 0 1.1 KB
#4054 SendReceive netcoreapp3.1 1.79μs 1.06ns 4.12ns 0.0143 0 0 1.1 KB
#4054 SendReceive net472 2.23μs 1.59ns 5.96ns 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.75μs 1.86ns 6.94ns 0.0206 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.96μs 1.11ns 4.29ns 0.0198 0 0 1.58 KB
master EnrichedLog net472 4.15μs 1.26ns 4.9ns 0.31 0 0 1.97 KB
#4054 EnrichedLog net6.0 2.6μs 0.889ns 3.44ns 0.0208 0 0 1.53 KB
#4054 EnrichedLog netcoreapp3.1 3.88μs 1.99ns 7.73ns 0.0214 0 0 1.58 KB
#4054 EnrichedLog net472 4.24μs 1.37ns 5.31ns 0.312 0 0 1.97 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4054

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 1.164 616.66 717.64

Faster 🎉 in #4054

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.262 548.86 435.00

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 548ns 0.574ns 2.22ns 0.00749 0 0 536 B
master StartFinishSpan netcoreapp3.1 617ns 0.197ns 0.761ns 0.00733 0 0 536 B
master StartFinishSpan net472 812ns 1.85ns 7.15ns 0.085 0 0 538 B
master StartFinishScope net6.0 576ns 0.217ns 0.842ns 0.00908 0 0 656 B
master StartFinishScope netcoreapp3.1 846ns 0.512ns 1.98ns 0.00878 0 0 656 B
master StartFinishScope net472 1.03μs 0.239ns 0.895ns 0.0981 0 0 618 B
#4054 StartFinishSpan net6.0 435ns 0.0615ns 0.23ns 0.00757 0 0 536 B
#4054 StartFinishSpan netcoreapp3.1 717ns 0.473ns 1.83ns 0.00734 0 0 536 B
#4054 StartFinishSpan net472 742ns 0.41ns 1.59ns 0.0852 0 0 538 B
#4054 StartFinishScope net6.0 525ns 1.52ns 5.89ns 0.00921 0 0 656 B
#4054 StartFinishScope netcoreapp3.1 823ns 0.171ns 0.641ns 0.00867 0 0 656 B
#4054 StartFinishScope net472 961ns 0.817ns 3.16ns 0.0978 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 605ns 0.385ns 1.49ns 0.0091 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 1.01μs 0.367ns 1.32ns 0.00907 0 0 656 B
master RunOnMethodBegin net472 1.13μs 0.841ns 3.26ns 0.0979 0 0 618 B
#4054 RunOnMethodBegin net6.0 656ns 0.465ns 1.8ns 0.00928 0 0 656 B
#4054 RunOnMethodBegin netcoreapp3.1 979ns 0.433ns 1.68ns 0.00865 0 0 656 B
#4054 RunOnMethodBegin net472 1.14μs 0.399ns 1.54ns 0.0976 0 0 618 B

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 13, 2023

Datadog Report

Branch report: gleocadie/use-cpp20
Commit report: 4e250f9

dd-trace-dotnet: 0 Failed, 0 New Flaky, 43 Passed, 0 Skipped, 3m 6.8s Wall Time

@gleocadie gleocadie force-pushed the gleocadie/use-cpp20 branch 5 times, most recently from ec889f0 to 7f66a79 Compare November 16, 2023 14:03
@andrewlock
Copy link
Member

andrewlock commented Nov 16, 2023

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 (4054) (11.788M)   : 0, 11787691
    master (12.163M)   : 0, 12163481
    benchmarks/2.9.0 (11.363M)   : 0, 11362982

    section Automatic
    This PR (4054) (7.969M)   : crit ,0, 7969166
    master (8.409M)   : 0, 8408597
    benchmarks/2.9.0 (8.259M)   : 0, 8258618

    section Trace stats
    This PR (4054) (8.370M)   : 0, 8370219
    master (8.729M)   : 0, 8729003

    section Manual
    This PR (4054) (10.297M)   : 0, 10297274
    master (10.542M)   : 0, 10542248

    section Manual + Automatic
    This PR (4054) (7.629M)   : 0, 7629034
    master (7.889M)   : 0, 7888611

    section Version Conflict
    This PR (4054) (6.844M)   : 0, 6844063
    master (6.884M)   : 0, 6883896

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4054) (9.364M)   : 0, 9363510
    master (9.616M)   : 0, 9616497
    benchmarks/2.9.0 (9.602M)   : 0, 9602224

    section Automatic
    This PR (4054) (6.613M)   : 0, 6612879
    master (6.596M)   : 0, 6595639

    section Trace stats
    This PR (4054) (6.931M)   : 0, 6930785
    master (6.989M)   : 0, 6989476

    section Manual
    This PR (4054) (8.272M)   : 0, 8271989
    master (8.274M)   : 0, 8273669

    section Manual + Automatic
    This PR (4054) (6.230M)   : 0, 6230041
    master (6.107M)   : 0, 6106598

    section Version Conflict
    This PR (4054) (5.807M)   : 0, 5806577
    master (5.766M)   : 0, 5766465

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4054) (9.879M)   : 0, 9878999
    master (10.057M)   : 0, 10057176
    benchmarks/2.9.0 (10.259M)   : 0, 10259311

    section Automatic
    This PR (4054) (7.073M)   : 0, 7073491
    master (7.125M)   : 0, 7124880
    benchmarks/2.9.0 (7.710M)   : 0, 7709529

    section Trace stats
    This PR (4054) (7.435M)   : 0, 7435341
    master (7.492M)   : 0, 7491605

    section Manual
    This PR (4054) (8.626M)   : 0, 8626334
    master (8.808M)   : 0, 8808366

    section Manual + Automatic
    This PR (4054) (6.782M)   : 0, 6781828
    master (7.062M)   : 0, 7061869

    section Version Conflict
    This PR (4054) (6.187M)   : 0, 6187318
    master (6.180M)   : 0, 6179663

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4054) (7.465M)   : 0, 7465212
    master (7.348M)   : 0, 7347529
    benchmarks/2.9.0 (7.830M)   : 0, 7830154

    section No attack
    This PR (4054) (1.954M)   : 0, 1953668
    master (1.981M)   : 0, 1980603
    benchmarks/2.9.0 (3.253M)   : 0, 3253296

    section Attack
    This PR (4054) (1.557M)   : 0, 1556912
    master (1.573M)   : 0, 1572752
    benchmarks/2.9.0 (2.541M)   : 0, 2540898

    section Blocking
    This PR (4054) (3.293M)   : 0, 3292893
    master (3.225M)   : 0, 3225450

    section IAST default
    This PR (4054) (6.567M)   : 0, 6567410
    master (6.454M)   : 0, 6453817

    section IAST full
    This PR (4054) (5.881M)   : 0, 5881045
    master (5.787M)   : 0, 5787025

    section Base vuln
    This PR (4054) (0.942M)   : 0, 941800
    master (0.964M)   : 0, 963553

    section IAST vuln
    This PR (4054) (0.864M)   : 0, 864271
    master (0.878M)   : 0, 877696

Loading

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 20, 2023

Datadog Report

Branch report: gleocadie/use-cpp20
Commit report: c3f16bc

dd-trace-dotnet: 0 Failed, 0 New Flaky, 306743 Passed, 1653 Skipped, 42m 20.4s Wall Time

@gleocadie gleocadie force-pushed the gleocadie/use-cpp20 branch 9 times, most recently from 65ab20c to 0dd3d62 Compare November 22, 2023 13:36
@gleocadie gleocadie requested review from a team as code owners November 22, 2023 15:04
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@GreenMatan GreenMatan left a comment

Choose a reason for hiding this comment

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

LGTM. Great job!

Copy link
Contributor

@chrisnas chrisnas left a comment

Choose a reason for hiding this comment

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

LGTM

@datadog-ddstaging
Copy link

Datadog Report

Branch report: gleocadie/use-cpp20
Commit report: c3f16bc

dd-trace-dotnet: 0 Failed, 0 New Flaky, 306745 Passed, 1653 Skipped, 42m 20.4s Wall Time

add_compile_options(-Wno-invalid-noreturn -Wno-macro-redefined -Wc++17-extensions -DDD_TEST)
add_compile_options(-Wno-invalid-noreturn -Wno-macro-redefined -Wc++20-extensions -DDD_TEST)

if (IS_ALPINE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious what was this change needed for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I took the opportunity to fix profiler flaky unit test :)

@gleocadie gleocadie merged commit c21b400 into master Nov 27, 2023
62 of 65 checks passed
@gleocadie gleocadie deleted the gleocadie/use-cpp20 branch November 27, 2023 17:12
@github-actions github-actions bot added this to the vNext milestone Nov 27, 2023
@andrewlock andrewlock added the area:builds project files, build scripts, pipelines, versioning, releases, packages label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:builds project files, build scripts, pipelines, versioning, releases, packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants