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] Dont store additive context in httpcontext #6609

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anna-git
Copy link
Contributor

@anna-git anna-git commented Jan 30, 2025

Summary of changes

First part of https://datadoghq.atlassian.net/jira/software/c/projects/APPSEC/boards/2876/backlog?selectedIssue=APPSEC-55247

Reason for change

Implementation details

Test coverage

Other details

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 30, 2025

Datadog Report

Branch report: asm/additive-context-intracecontext
Commit report: ae8c6f4
Test service: dd-trace-dotnet

✅ 0 Failed, 551180 Passed, 4421 Skipped, 32h 59m 35.22s Total Time

@andrewlock
Copy link
Member

andrewlock commented Jan 30, 2025

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 (6609) - mean (70ms)  : 65, 75
     .   : milestone, 70,
    master - mean (69ms)  : 67, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6609) - mean (991ms)  : 970, 1012
     .   : milestone, 991,
    master - mean (994ms)  : 975, 1013
     .   : milestone, 994,

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

    section CallTarget+Inlining+NGEN
    This PR (6609) - mean (676ms)  : 663, 689
     .   : milestone, 676,
    master - mean (677ms)  : 662, 692
     .   : milestone, 677,

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

    section CallTarget+Inlining+NGEN
    This PR (6609) - mean (629ms)  : 609, 650
     .   : milestone, 629,
    master - mean (635ms)  : 618, 651
     .   : milestone, 635,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6609) - mean (191ms)  : 183, 200
     .   : milestone, 191,
    master - mean (191ms)  : 187, 195
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6609) - mean (1,121ms)  : 1079, 1163
     .   : milestone, 1121,
    master - mean (1,110ms)  : 1062, 1158
     .   : milestone, 1110,

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

    section CallTarget+Inlining+NGEN
    This PR (6609) - mean (868ms)  : 834, 901
     .   : milestone, 868,
    master - mean (875ms)  : 806, 944
     .   : milestone, 875,

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

    section CallTarget+Inlining+NGEN
    This PR (6609) - mean (847ms)  : 812, 881
     .   : milestone, 847,
    master - mean (846ms)  : 808, 884
     .   : milestone, 846,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jan 30, 2025

Benchmarks Report for appsec 🐌

Benchmarks for #6609 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.184
  • 1 benchmarks are slower, with geometric mean 1.204
  • 2 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 - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6609

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑netcoreapp3.1 1.204 208.99 251.65

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 202μs 167ns 623ns 2.65 0 0 188.88 KB
master AllCycleSimpleBody netcoreapp3.1 295μs 138ns 534ns 2.65 0 0 196.21 KB
master AllCycleSimpleBody net472 270μs 314ns 1.22μs 35.9 2.04 0 226.09 KB
master AllCycleMoreComplexBody net6.0 212μs 146ns 566ns 2.72 0 0 192.38 KB
master AllCycleMoreComplexBody netcoreapp3.1 315μs 77.3ns 289ns 2.67 0 0 199.62 KB
master AllCycleMoreComplexBody net472 275μs 154ns 575ns 36.4 1.97 0 229.6 KB
master ObjectExtractorSimpleBody net6.0 143ns 0.172ns 0.666ns 0.00395 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 209ns 0.186ns 0.697ns 0.00375 0 0 272 B
master ObjectExtractorSimpleBody net472 166ns 0.27ns 0.973ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.92μs 1.84ns 6.89ns 0.0537 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.04μs 2.21ns 8.57ns 0.0504 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.68μs 8.72ns 33.8ns 0.603 0.00548 0 3.8 KB
#6609 AllCycleSimpleBody net6.0 204μs 118ns 426ns 2.65 0 0 188.99 KB
#6609 AllCycleSimpleBody netcoreapp3.1 308μs 158ns 612ns 2.61 0 0 196.32 KB
#6609 AllCycleSimpleBody net472 271μs 173ns 671ns 35.8 2.02 0 226.21 KB
#6609 AllCycleMoreComplexBody net6.0 207μs 87.3ns 338ns 2.71 0 0 192.5 KB
#6609 AllCycleMoreComplexBody netcoreapp3.1 304μs 127ns 475ns 2.72 0 0 199.74 KB
#6609 AllCycleMoreComplexBody net472 276μs 230ns 860ns 36.4 2.06 0 229.72 KB
#6609 ObjectExtractorSimpleBody net6.0 139ns 0.0686ns 0.257ns 0.00395 0 0 280 B
#6609 ObjectExtractorSimpleBody netcoreapp3.1 252ns 0.14ns 0.522ns 0.00367 0 0 272 B
#6609 ObjectExtractorSimpleBody net472 165ns 0.197ns 0.737ns 0.0446 0 0 281 B
#6609 ObjectExtractorMoreComplexBody net6.0 2.91μs 1.62ns 6.07ns 0.0526 0 0 3.78 KB
#6609 ObjectExtractorMoreComplexBody netcoreapp3.1 3.87μs 1.4ns 5.06ns 0.0502 0 0 3.69 KB
#6609 ObjectExtractorMoreComplexBody net472 3.75μs 7.54ns 29.2ns 0.603 0.00558 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.8μs 22.5ns 87.3ns 0.456 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 53.9μs 15.7ns 58.8ns 0.43 0 0 32.4 KB
master EncodeArgs net472 66.7μs 28.9ns 108ns 5.13 0.0671 0 32.5 KB
master EncodeLegacyArgs net6.0 82.1μs 28.4ns 110ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 107μs 43ns 161ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 155μs 100ns 388ns 0.311 0 0 2.15 KB
#6609 EncodeArgs net6.0 37.4μs 30.6ns 119ns 0.452 0 0 32.4 KB
#6609 EncodeArgs netcoreapp3.1 54.3μs 20.8ns 77.7ns 0.433 0 0 32.4 KB
#6609 EncodeArgs net472 65.9μs 20.2ns 73ns 5.14 0.0659 0 32.5 KB
#6609 EncodeLegacyArgs net6.0 76.4μs 419ns 2.58μs 0.0362 0 0 2.14 KB
#6609 EncodeLegacyArgs netcoreapp3.1 108μs 60.3ns 234ns 0 0 0 2.14 KB
#6609 EncodeLegacyArgs net472 152μs 143ns 554ns 0.302 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 173μs 120ns 464ns 0 0 0 2.54 KB
master RunWafRealisticBenchmark netcoreapp3.1 187μs 304ns 1.18μs 0 0 0 2.49 KB
master RunWafRealisticBenchmark net472 203μs 108ns 418ns 0.401 0 0 2.55 KB
master RunWafRealisticBenchmarkWithAttack net6.0 116μs 51.9ns 180ns 0 0 0 1.57 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 149ns 517ns 0 0 0 1.55 KB
master RunWafRealisticBenchmarkWithAttack net472 134μs 108ns 419ns 0.199 0 0 1.58 KB
#6609 RunWafRealisticBenchmark net6.0 174μs 130ns 504ns 0 0 0 2.54 KB
#6609 RunWafRealisticBenchmark netcoreapp3.1 188μs 366ns 1.42μs 0 0 0 2.49 KB
#6609 RunWafRealisticBenchmark net472 200μs 71.8ns 259ns 0.397 0 0 2.55 KB
#6609 RunWafRealisticBenchmarkWithAttack net6.0 116μs 46.6ns 181ns 0 0 0 1.57 KB
#6609 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 77ns 298ns 0 0 0 1.55 KB
#6609 RunWafRealisticBenchmarkWithAttack net472 132μs 35.9ns 139ns 0.198 0 0 1.58 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Faster 🎉 More allocations ⚠️

Faster 🎉 in #6609

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 1.184 64,150.00 54,200.00 bimodal

More allocations ⚠️ in #6609

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 255.38 KB 265.85 KB 10.46 KB 4.10%

Fewer allocations 🎉 in #6609

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 60.76 KB 59.76 KB -1 KB -1.65%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 262.15 KB 253.41 KB -8.74 KB -3.34%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 52.6μs 261ns 1.11μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 64.8μs 878ns 8.78μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 36.8μs 79.6ns 287ns 0 0 0 60.76 KB
master StringConcatAspectBenchmark net6.0 300μs 4.4μs 42.7μs 0 0 0 255.38 KB
master StringConcatAspectBenchmark netcoreapp3.1 327μs 2.63μs 25.8μs 0 0 0 262.15 KB
master StringConcatAspectBenchmark net472 296μs 7.05μs 69.1μs 0 0 0 278.53 KB
#6609 StringConcatBenchmark net6.0 59.9μs 743ns 7.4μs 0 0 0 43.44 KB
#6609 StringConcatBenchmark netcoreapp3.1 54μs 227ns 819ns 0 0 0 42.64 KB
#6609 StringConcatBenchmark net472 37.4μs 72.8ns 272ns 0 0 0 59.76 KB
#6609 StringConcatAspectBenchmark net6.0 305μs 6.56μs 64.2μs 0 0 0 265.85 KB
#6609 StringConcatAspectBenchmark netcoreapp3.1 336μs 1.19μs 4.63μs 0 0 0 253.41 KB
#6609 StringConcatAspectBenchmark net472 298μs 7.24μs 71.3μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

andrewlock commented Jan 30, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6609 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.163
  • 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.29μs 61.3ns 584ns 0.0163 0.00816 0 5.61 KB
master StartStopWithChild netcoreapp3.1 9.91μs 55.4ns 342ns 0.0149 0.00498 0 5.8 KB
master StartStopWithChild net472 16.2μs 41.6ns 161ns 1.03 0.287 0.0877 6.21 KB
#6609 StartStopWithChild net6.0 7.93μs 44.4ns 295ns 0.0155 0.00773 0 5.62 KB
#6609 StartStopWithChild netcoreapp3.1 9.93μs 51.4ns 247ns 0.0197 0.00987 0 5.8 KB
#6609 StartStopWithChild net472 16.1μs 31.2ns 117ns 1.04 0.3 0.0973 6.2 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 484μs 157ns 587ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 672μs 333ns 1.29μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 859μs 629ns 2.27μs 0.425 0 0 3.3 KB
#6609 WriteAndFlushEnrichedTraces net6.0 485μs 422ns 1.64μs 0 0 0 2.7 KB
#6609 WriteAndFlushEnrichedTraces netcoreapp3.1 638μs 249ns 897ns 0 0 0 2.7 KB
#6609 WriteAndFlushEnrichedTraces net472 862μs 608ns 2.35μs 0.428 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 127μs 551ns 2.14μs 0.193 0 0 14.47 KB
master SendRequest netcoreapp3.1 145μs 308ns 1.19μs 0.147 0 0 17.27 KB
master SendRequest net472 0.0107ns 0.0026ns 0.0101ns 0 0 0 0 b
#6609 SendRequest net6.0 128μs 452ns 1.75μs 0.19 0 0 14.47 KB
#6609 SendRequest netcoreapp3.1 140μs 459ns 1.78μs 0.209 0 0 17.27 KB
#6609 SendRequest net472 0.0142ns 0.00273ns 0.0106ns 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 554μs 1.99μs 7.72μs 0.548 0 0 41.48 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 652μs 2.77μs 10.4μs 0.319 0 0 41.65 KB
master WriteAndFlushEnrichedTraces net472 873μs 2.61μs 9.78μs 8.13 2.57 0.428 53.31 KB
#6609 WriteAndFlushEnrichedTraces net6.0 563μs 2.99μs 15.2μs 0.536 0 0 41.53 KB
#6609 WriteAndFlushEnrichedTraces netcoreapp3.1 708μs 3.98μs 25.8μs 0.353 0 0 41.47 KB
#6609 WriteAndFlushEnrichedTraces net472 836μs 3.49μs 13μs 8.28 2.48 0.414 53.3 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.26μs 1.16ns 4.51ns 0.0144 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.73μs 1.02ns 3.82ns 0.013 0 0 1.02 KB
master ExecuteNonQuery net472 2.14μs 1.62ns 6.06ns 0.156 0.00106 0 987 B
#6609 ExecuteNonQuery net6.0 1.37μs 0.85ns 3.29ns 0.0144 0 0 1.02 KB
#6609 ExecuteNonQuery netcoreapp3.1 1.79μs 2.71ns 10.5ns 0.0135 0 0 1.02 KB
#6609 ExecuteNonQuery net472 2.08μs 2.68ns 10ns 0.157 0.00104 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.2μs 0.506ns 1.83ns 0.0139 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.49μs 1.32ns 5.12ns 0.0133 0 0 976 B
master CallElasticsearch net472 2.57μs 2.55ns 9.87ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.31μs 0.731ns 2.83ns 0.0131 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.66μs 0.653ns 2.44ns 0.0139 0 0 1.02 KB
master CallElasticsearchAsync net472 2.7μs 1.36ns 5.26ns 0.167 0 0 1.05 KB
#6609 CallElasticsearch net6.0 1.26μs 0.41ns 1.53ns 0.0134 0 0 976 B
#6609 CallElasticsearch netcoreapp3.1 1.62μs 1.56ns 5.85ns 0.013 0 0 976 B
#6609 CallElasticsearch net472 2.53μs 1.58ns 6.11ns 0.157 0 0 995 B
#6609 CallElasticsearchAsync net6.0 1.28μs 0.35ns 1.26ns 0.0135 0 0 952 B
#6609 CallElasticsearchAsync netcoreapp3.1 1.66μs 0.415ns 1.55ns 0.0133 0 0 1.02 KB
#6609 CallElasticsearchAsync net472 2.83μs 3.23ns 12.5ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6609

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.163 1,190.80 1,385.28

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.19μs 0.34ns 1.27ns 0.013 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.58μs 0.64ns 2.48ns 0.0125 0 0 952 B
master ExecuteAsync net472 1.85μs 0.43ns 1.61ns 0.145 0 0 915 B
#6609 ExecuteAsync net6.0 1.39μs 0.804ns 3.01ns 0.0131 0 0 952 B
#6609 ExecuteAsync netcoreapp3.1 1.63μs 0.983ns 3.68ns 0.013 0 0 952 B
#6609 ExecuteAsync net472 1.9μs 0.57ns 2.13ns 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.26μs 0.821ns 2.84ns 0.032 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.32μs 5.84ns 22.6ns 0.0373 0 0 2.85 KB
master SendAsync net472 7.46μs 1.53ns 5.94ns 0.496 0 0 3.12 KB
#6609 SendAsync net6.0 4.44μs 1.97ns 7.37ns 0.031 0 0 2.31 KB
#6609 SendAsync netcoreapp3.1 5.29μs 6.28ns 24.3ns 0.0381 0 0 2.85 KB
#6609 SendAsync net472 7.42μs 2.43ns 9.41ns 0.493 0 0 3.12 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.54μs 0.769ns 2.98ns 0.0232 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.07μs 1.52ns 5.89ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.42μs 0.75ns 2.81ns 0.249 0 0 1.57 KB
#6609 EnrichedLog net6.0 1.58μs 1.37ns 5.11ns 0.0231 0 0 1.64 KB
#6609 EnrichedLog netcoreapp3.1 2.2μs 1.1ns 4.1ns 0.0221 0 0 1.64 KB
#6609 EnrichedLog net472 2.68μs 0.567ns 2.12ns 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 49.4ns 178ns 0.0566 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 116μs 143ns 553ns 0 0 0 4.28 KB
master EnrichedLog net472 150μs 159ns 616ns 0.672 0.224 0 4.46 KB
#6609 EnrichedLog net6.0 113μs 139ns 539ns 0.0563 0 0 4.28 KB
#6609 EnrichedLog netcoreapp3.1 117μs 145ns 560ns 0.0584 0 0 4.28 KB
#6609 EnrichedLog net472 150μs 197ns 763ns 0.675 0.225 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.05μs 1.02ns 3.93ns 0.0304 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.23μs 1.11ns 4.29ns 0.0296 0 0 2.2 KB
master EnrichedLog net472 5.04μs 2.04ns 7.9ns 0.32 0 0 2.02 KB
#6609 EnrichedLog net6.0 3μs 0.946ns 3.54ns 0.03 0 0 2.2 KB
#6609 EnrichedLog netcoreapp3.1 4.12μs 1.53ns 5.72ns 0.029 0 0 2.2 KB
#6609 EnrichedLog net472 4.94μs 1.6ns 6.2ns 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.31μs 0.493ns 1.91ns 0.0157 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.76μs 0.966ns 3.74ns 0.015 0 0 1.14 KB
master SendReceive net472 2.13μs 2.1ns 7.88ns 0.183 0 0 1.16 KB
#6609 SendReceive net6.0 1.36μs 0.996ns 3.86ns 0.0163 0 0 1.14 KB
#6609 SendReceive netcoreapp3.1 1.82μs 1.37ns 5.31ns 0.0147 0 0 1.14 KB
#6609 SendReceive net472 2.05μs 1.79ns 6.94ns 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.86μs 0.867ns 3.36ns 0.0228 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.93μs 2.27ns 8.81ns 0.0215 0 0 1.65 KB
master EnrichedLog net472 4.35μs 3.72ns 14.4ns 0.322 0 0 2.04 KB
#6609 EnrichedLog net6.0 2.9μs 1.15ns 4.32ns 0.0218 0 0 1.6 KB
#6609 EnrichedLog netcoreapp3.1 3.88μs 2.43ns 8.75ns 0.0211 0 0 1.65 KB
#6609 EnrichedLog net472 4.41μs 2.57ns 9.97ns 0.323 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 393ns 0.822ns 3.18ns 0.00811 0 0 576 B
master StartFinishSpan netcoreapp3.1 557ns 0.987ns 3.82ns 0.00778 0 0 576 B
master StartFinishSpan net472 596ns 1.03ns 3.99ns 0.0916 0 0 578 B
master StartFinishScope net6.0 488ns 0.575ns 2.23ns 0.00984 0 0 696 B
master StartFinishScope netcoreapp3.1 712ns 1.03ns 4ns 0.00958 0 0 696 B
master StartFinishScope net472 864ns 2.22ns 8.59ns 0.104 0 0 658 B
#6609 StartFinishSpan net6.0 403ns 0.526ns 2.04ns 0.00815 0 0 576 B
#6609 StartFinishSpan netcoreapp3.1 557ns 0.679ns 2.63ns 0.00775 0 0 576 B
#6609 StartFinishSpan net472 610ns 1.2ns 4.64ns 0.0916 0 0 578 B
#6609 StartFinishScope net6.0 539ns 0.668ns 2.59ns 0.00983 0 0 696 B
#6609 StartFinishScope netcoreapp3.1 693ns 1.18ns 4.56ns 0.00944 0 0 696 B
#6609 StartFinishScope net472 837ns 1.37ns 5.32ns 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 649ns 0.948ns 3.67ns 0.00979 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 926ns 1.74ns 6.76ns 0.00968 0 0 696 B
master RunOnMethodBegin net472 1.06μs 2.02ns 7.83ns 0.104 0 0 658 B
#6609 RunOnMethodBegin net6.0 655ns 1.02ns 3.97ns 0.00967 0 0 696 B
#6609 RunOnMethodBegin netcoreapp3.1 961ns 1.09ns 4.22ns 0.00927 0 0 696 B
#6609 RunOnMethodBegin net472 1.1μs 1.64ns 6.35ns 0.104 0 0 658 B

@anna-git anna-git force-pushed the asm/additive-context-intracecontext branch from 89586c2 to ae8c6f4 Compare February 3, 2025 11:12
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.

2 participants