Skip to content

Add proper error checking around GetModuleMetadata (#5985 => v2)#5992

Merged
andrewlock merged 1 commit into
release/2.xfrom
kevin/table_flip_v2
Sep 6, 2024
Merged

Add proper error checking around GetModuleMetadata (#5985 => v2)#5992
andrewlock merged 1 commit into
release/2.xfrom
kevin/table_flip_v2

Conversation

@kevingosse

Copy link
Copy Markdown
Contributor

Summary of changes

Explicitly check for S_OK when calling GetModuleMetadata.

Reason for change

GetModuleMetadata can return S_FALSE (one known case is if the module is a resource, but there might be other). We've been using the SUCCEEDED/FAILED macros to check the error code, but S_FALSE is not considered as an error so we would mistakenly assume that the call succeeded.

Implementation details

Note that I only updated the error checks. There are a couple of places where we call GetModuleMetadata without checking the error code, I haven't touched those.

For GetModuleInterfaces in IAST, I also moved the call to Release to only do it if the call succeeded.

@kevingosse
kevingosse requested review from a team as code owners September 5, 2024 15:33
@kevingosse
kevingosse changed the base branch from master to release/2.x September 5, 2024 15:33
@andrewlock

Copy link
Copy Markdown
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 (5992) - mean (74ms)  : 65, 83
     .   : milestone, 74,
    master - mean (69ms)  : 67, 71
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (5992) - mean (1,039ms)  : 1017, 1061
     .   : milestone, 1039,
    master - mean (1,077ms)  : 1053, 1101
     .   : milestone, 1077,

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

    section CallTarget+Inlining+NGEN
    This PR (5992) - mean (727ms)  : 704, 749
     .   : milestone, 727,
    master - mean (758ms)  : 739, 778
     .   : milestone, 758,

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

    section CallTarget+Inlining+NGEN
    This PR (5992) - mean (678ms)  : 654, 703
     .   : milestone, 678,
    master - mean (710ms)  : 697, 724
     .   : milestone, 710,

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

    section CallTarget+Inlining+NGEN
    This PR (5992) - mean (1,115ms)  : 1096, 1135
     .   : milestone, 1115,
    master - mean (1,160ms)  : 1137, 1184
     .   : milestone, 1160,

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

    section CallTarget+Inlining+NGEN
    This PR (5992) - mean (882ms)  : 857, 907
     .   : milestone, 882,
    master - mean (922ms)  : 902, 942
     .   : milestone, 922,

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

    section CallTarget+Inlining+NGEN
    This PR (5992) - mean (865ms)  : 845, 885
     .   : milestone, 865,
    master - mean (902ms)  : 883, 922
     .   : milestone, 902,

Loading

@andrewlock

Copy link
Copy Markdown
Member

Benchmarks Report for appsec 🐌

Benchmarks for #5992 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.176
  • 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 #5992

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody‑netcoreapp3.1 1.176 3,955.87 4,651.39

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 72.4μs 81.3ns 304ns 0.0723 0 0 6 KB
master AllCycleSimpleBody netcoreapp3.1 62.9μs 113ns 438ns 0.094 0 0 6.95 KB
master AllCycleSimpleBody net472 49.6μs 30.6ns 115ns 1.31 0 0 8.34 KB
master AllCycleMoreComplexBody net6.0 78.5μs 50.2ns 188ns 0.118 0 0 9.51 KB
master AllCycleMoreComplexBody netcoreapp3.1 69μs 86.1ns 322ns 0.138 0 0 10.37 KB
master AllCycleMoreComplexBody net472 55.4μs 41ns 159ns 1.88 0.0277 0 11.85 KB
master ObjectExtractorSimpleBody net6.0 140ns 0.125ns 0.435ns 0.00397 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 199ns 0.131ns 0.473ns 0.00371 0 0 272 B
master ObjectExtractorSimpleBody net472 171ns 0.158ns 0.59ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.04μs 3.38ns 12.6ns 0.0533 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.96μs 3.18ns 11.9ns 0.0494 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.81μs 1.98ns 7.67ns 0.603 0.00572 0 3.8 KB
#5992 AllCycleSimpleBody net6.0 73.4μs 242ns 937ns 0.0719 0 0 6.01 KB
#5992 AllCycleSimpleBody netcoreapp3.1 62.9μs 57.5ns 223ns 0.0624 0 0 6.95 KB
#5992 AllCycleSimpleBody net472 49.1μs 39.5ns 153ns 1.32 0 0 8.34 KB
#5992 AllCycleMoreComplexBody net6.0 78.5μs 45ns 162ns 0.119 0 0 9.51 KB
#5992 AllCycleMoreComplexBody netcoreapp3.1 68.9μs 76.4ns 286ns 0.138 0 0 10.37 KB
#5992 AllCycleMoreComplexBody net472 56.3μs 60.1ns 233ns 1.87 0.028 0 11.85 KB
#5992 ObjectExtractorSimpleBody net6.0 147ns 0.661ns 2.65ns 0.00396 0 0 280 B
#5992 ObjectExtractorSimpleBody netcoreapp3.1 207ns 0.704ns 2.73ns 0.00375 0 0 272 B
#5992 ObjectExtractorSimpleBody net472 165ns 0.191ns 0.738ns 0.0446 0 0 281 B
#5992 ObjectExtractorMoreComplexBody net6.0 3.08μs 9.91ns 38.4ns 0.0533 0 0 3.78 KB
#5992 ObjectExtractorMoreComplexBody netcoreapp3.1 4.65μs 3.85ns 14.9ns 0.0493 0 0 3.69 KB
#5992 ObjectExtractorMoreComplexBody net472 3.9μs 3.09ns 11.6ns 0.602 0.00585 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 36.7μs 17ns 65.9ns 0.446 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.1μs 27ns 101ns 0.433 0 0 32.4 KB
master EncodeArgs net472 66μs 26.8ns 104ns 5.15 0.0661 0 32.5 KB
master EncodeLegacyArgs net6.0 72.8μs 106ns 412ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 106μs 383ns 1.48μs 0 0 0 2.15 KB
master EncodeLegacyArgs net472 151μs 128ns 495ns 0.304 0 0 2.15 KB
#5992 EncodeArgs net6.0 40.3μs 64.9ns 252ns 0.459 0 0 32.4 KB
#5992 EncodeArgs netcoreapp3.1 54.3μs 55.7ns 208ns 0.432 0 0 32.4 KB
#5992 EncodeArgs net472 67.6μs 78.6ns 294ns 5.15 0.0673 0 32.5 KB
#5992 EncodeLegacyArgs net6.0 76.3μs 402ns 2.13μs 0.0393 0 0 2.14 KB
#5992 EncodeLegacyArgs netcoreapp3.1 103μs 117ns 452ns 0 0 0 2.14 KB
#5992 EncodeLegacyArgs net472 152μs 84.6ns 317ns 0.305 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 184μs 63.1ns 244ns 0 0 0 2.42 KB
master RunWafRealisticBenchmark netcoreapp3.1 194μs 255ns 986ns 0 0 0 2.37 KB
master RunWafRealisticBenchmark net472 209μs 137ns 532ns 0.314 0 0 2.43 KB
master RunWafRealisticBenchmarkWithAttack net6.0 122μs 74.3ns 288ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 193ns 747ns 0 0 0 1.45 KB
master RunWafRealisticBenchmarkWithAttack net472 139μs 209ns 783ns 0.208 0 0 1.48 KB
#5992 RunWafRealisticBenchmark net6.0 184μs 517ns 2μs 0 0 0 2.42 KB
#5992 RunWafRealisticBenchmark netcoreapp3.1 193μs 315ns 1.22μs 0 0 0 2.37 KB
#5992 RunWafRealisticBenchmark net472 207μs 57.4ns 222ns 0.309 0 0 2.43 KB
#5992 RunWafRealisticBenchmarkWithAttack net6.0 122μs 61.6ns 238ns 0 0 0 1.46 KB
#5992 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 129μs 136ns 510ns 0 0 0 1.45 KB
#5992 RunWafRealisticBenchmarkWithAttack net472 138μs 45.7ns 171ns 0.208 0 0 1.48 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #5992

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 278.53 KB 286.54 KB 8.01 KB 2.88%

Fewer allocations 🎉 in #5992

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 255.52 KB 253.41 KB -2.11 KB -0.83%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 62.13 KB 59.02 KB -3.1 KB -5.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 60.8μs 838ns 8.29μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 53.1μs 219ns 930ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.3μs 96.2ns 360ns 0 0 0 62.13 KB
master StringConcatAspectBenchmark net6.0 323μs 1.83μs 12.5μs 0 0 0 255.88 KB
master StringConcatAspectBenchmark netcoreapp3.1 345μs 2μs 16.5μs 0 0 0 255.52 KB
master StringConcatAspectBenchmark net472 266μs 4.34μs 42.3μs 0 0 0 278.53 KB
#5992 StringConcatBenchmark net6.0 57μs 651ns 6.45μs 0 0 0 43.44 KB
#5992 StringConcatBenchmark netcoreapp3.1 56.7μs 600ns 5.69μs 0 0 0 42.64 KB
#5992 StringConcatBenchmark net472 37.3μs 178ns 690ns 0 0 0 59.02 KB
#5992 StringConcatAspectBenchmark net6.0 311μs 1.64μs 12.2μs 0 0 0 255.01 KB
#5992 StringConcatAspectBenchmark netcoreapp3.1 299μs 5.33μs 52.5μs 0 0 0 253.41 KB
#5992 StringConcatAspectBenchmark net472 245μs 1.21μs 6.4μs 0 0 0 286.54 KB

@andrewlock

Copy link
Copy Markdown
Member

Benchmarks Report for tracer 🐌

Benchmarks for #5992 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.141
  • 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.81μs 43.8ns 291ns 0.0151 0.00753 0 5.42 KB
master StartStopWithChild netcoreapp3.1 10.2μs 53.7ns 263ns 0.0201 0.0101 0 5.62 KB
master StartStopWithChild net472 16.4μs 69.4ns 269ns 1.01 0.291 0.097 6.06 KB
#5992 StartStopWithChild net6.0 7.68μs 36.9ns 148ns 0.0145 0.00725 0 5.42 KB
#5992 StartStopWithChild netcoreapp3.1 9.89μs 56ns 384ns 0.0194 0.00971 0 5.62 KB
#5992 StartStopWithChild net472 16.4μs 73.4ns 284ns 1.02 0.307 0.0889 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 459μs 336ns 1.3μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 623μs 513ns 1.99μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 833μs 533ns 2.07μs 0.411 0 0 3.3 KB
#5992 WriteAndFlushEnrichedTraces net6.0 492μs 464ns 1.74μs 0 0 0 2.7 KB
#5992 WriteAndFlushEnrichedTraces netcoreapp3.1 646μs 612ns 2.29μs 0 0 0 2.7 KB
#5992 WriteAndFlushEnrichedTraces net472 842μs 464ns 1.67μ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 206μs 1.2μs 10.8μs 0.201 0 0 18.45 KB
master SendRequest netcoreapp3.1 228μs 1.31μs 10.5μs 0.214 0 0 20.61 KB
master SendRequest net472 0.00371ns 0.00125ns 0.00483ns 0 0 0 0 b
#5992 SendRequest net6.0 220μs 1.56μs 15.6μs 0.201 0 0 18.45 KB
#5992 SendRequest netcoreapp3.1 242μs 1.75μs 17.5μs 0.248 0 0 20.61 KB
#5992 SendRequest net472 0ns 0ns 0ns 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 585μs 3.29μs 21.6μs 0.598 0 0 41.65 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 686μs 3.75μs 21.2μs 0.326 0 0 41.64 KB
master WriteAndFlushEnrichedTraces net472 887μs 4.29μs 18.2μs 8.13 2.57 0.428 53.31 KB
#5992 WriteAndFlushEnrichedTraces net6.0 601μs 3.44μs 26.2μs 0.613 0 0 41.74 KB
#5992 WriteAndFlushEnrichedTraces netcoreapp3.1 719μs 3.92μs 30.1μs 0.357 0 0 41.8 KB
#5992 WriteAndFlushEnrichedTraces net472 868μs 3.87μs 15μs 8.62 2.59 0.431 53.31 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.34μs 2.17ns 8.42ns 0.0147 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.73μs 1.41ns 5.09ns 0.0139 0 0 1.02 KB
master ExecuteNonQuery net472 2.04μs 2.09ns 8.11ns 0.156 0 0 987 B
#5992 ExecuteNonQuery net6.0 1.26μs 0.642ns 2.49ns 0.0138 0 0 1.02 KB
#5992 ExecuteNonQuery netcoreapp3.1 1.73μs 1.25ns 4.52ns 0.0138 0 0 1.02 KB
#5992 ExecuteNonQuery net472 2.03μs 1.79ns 6.68ns 0.156 0 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.14μs 1.16ns 4.33ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.54μs 0.544ns 1.96ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.5μs 1.54ns 5.77ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.24μs 1.16ns 4.48ns 0.013 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.71μs 0.784ns 2.93ns 0.0138 0 0 1.02 KB
master CallElasticsearchAsync net472 2.55μs 1.12ns 4.18ns 0.166 0 0 1.05 KB
#5992 CallElasticsearch net6.0 1.16μs 0.944ns 3.66ns 0.0134 0 0 976 B
#5992 CallElasticsearch netcoreapp3.1 1.5μs 0.532ns 1.99ns 0.0129 0 0 976 B
#5992 CallElasticsearch net472 2.48μs 2.8ns 10.8ns 0.158 0 0 995 B
#5992 CallElasticsearchAsync net6.0 1.33μs 2.88ns 11.2ns 0.0133 0 0 952 B
#5992 CallElasticsearchAsync netcoreapp3.1 1.64μs 0.693ns 2.5ns 0.0139 0 0 1.02 KB
#5992 CallElasticsearchAsync net472 2.57μs 6.15ns 23.8ns 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.3μs 0.772ns 2.99ns 0.0131 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.71μs 0.564ns 2.11ns 0.0128 0 0 952 B
master ExecuteAsync net472 1.72μs 1.62ns 6.27ns 0.145 0 0 915 B
#5992 ExecuteAsync net6.0 1.23μs 0.639ns 2.39ns 0.013 0 0 952 B
#5992 ExecuteAsync netcoreapp3.1 1.58μs 4.08ns 15.3ns 0.0124 0 0 952 B
#5992 ExecuteAsync net472 1.78μs 0.953ns 3.69ns 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.2μs 1.06ns 3.97ns 0.0315 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.11μs 2.11ns 7.9ns 0.0384 0 0 2.76 KB
master SendAsync net472 7.74μs 3.5ns 12.1ns 0.497 0 0 3.15 KB
#5992 SendAsync net6.0 4.25μs 0.994ns 3.72ns 0.0299 0 0 2.22 KB
#5992 SendAsync netcoreapp3.1 5.16μs 1.76ns 6.57ns 0.036 0 0 2.76 KB
#5992 SendAsync net472 7.76μs 2.5ns 9.67ns 0.496 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.56μs 0.729ns 2.82ns 0.0227 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.18μs 1.06ns 3.97ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.7μs 2.47ns 8.91ns 0.249 0 0 1.57 KB
#5992 EnrichedLog net6.0 1.47μs 0.514ns 1.92ns 0.0228 0 0 1.64 KB
#5992 EnrichedLog netcoreapp3.1 2.18μs 1.15ns 4.45ns 0.0219 0 0 1.64 KB
#5992 EnrichedLog net472 2.65μs 3.04ns 11.8ns 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 120μs 270ns 1.04μs 0.057 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 119μs 283ns 1.1μs 0.0597 0 0 4.28 KB
master EnrichedLog net472 147μs 130ns 503ns 0.656 0.219 0 4.46 KB
#5992 EnrichedLog net6.0 115μs 112ns 435ns 0.057 0 0 4.28 KB
#5992 EnrichedLog netcoreapp3.1 120μs 303ns 1.17μs 0 0 0 4.28 KB
#5992 EnrichedLog net472 146μs 323ns 1.25μs 0.661 0.22 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.99μs 1.1ns 4.11ns 0.03 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.13μs 2.4ns 9.29ns 0.029 0 0 2.2 KB
master EnrichedLog net472 4.95μs 1.36ns 5.27ns 0.319 0 0 2.02 KB
#5992 EnrichedLog net6.0 3μs 2.16ns 8.36ns 0.0316 0 0 2.2 KB
#5992 EnrichedLog netcoreapp3.1 4.07μs 1.54ns 5.97ns 0.0285 0 0 2.2 KB
#5992 EnrichedLog net472 4.89μs 1.09ns 4.21ns 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.45μs 0.807ns 3.13ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.85μs 5.26ns 20.4ns 0.0157 0 0 1.14 KB
master SendReceive net472 2.22μs 1.59ns 6.16ns 0.183 0.00111 0 1.16 KB
#5992 SendReceive net6.0 1.37μs 2.34ns 8.76ns 0.0162 0 0 1.14 KB
#5992 SendReceive netcoreapp3.1 1.74μs 3.26ns 12.6ns 0.015 0 0 1.14 KB
#5992 SendReceive net472 2.09μs 1.57ns 6.08ns 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.81μs 0.923ns 3.58ns 0.0225 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.82μs 1.68ns 6.49ns 0.021 0 0 1.65 KB
master EnrichedLog net472 4.4μs 1.84ns 7.11ns 0.323 0 0 2.04 KB
#5992 EnrichedLog net6.0 2.74μs 0.73ns 2.83ns 0.0233 0 0 1.6 KB
#5992 EnrichedLog netcoreapp3.1 3.91μs 0.973ns 3.64ns 0.0216 0 0 1.65 KB
#5992 EnrichedLog net472 4.38μs 1.9ns 7.37ns 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 430ns 0.391ns 1.46ns 0.00794 0 0 576 B
master StartFinishSpan netcoreapp3.1 557ns 0.261ns 1.01ns 0.00779 0 0 576 B
master StartFinishSpan net472 621ns 0.2ns 0.749ns 0.0916 0 0 578 B
master StartFinishScope net6.0 532ns 0.322ns 1.25ns 0.00984 0 0 696 B
master StartFinishScope netcoreapp3.1 660ns 1.3ns 5.05ns 0.00948 0 0 696 B
master StartFinishScope net472 850ns 0.909ns 3.52ns 0.104 0 0 658 B
#5992 StartFinishSpan net6.0 403ns 0.204ns 0.788ns 0.00806 0 0 576 B
#5992 StartFinishSpan netcoreapp3.1 558ns 1.08ns 4.04ns 0.00766 0 0 576 B
#5992 StartFinishSpan net472 686ns 0.505ns 1.96ns 0.0916 0 0 578 B
#5992 StartFinishScope net6.0 496ns 0.592ns 2.29ns 0.00981 0 0 696 B
#5992 StartFinishScope netcoreapp3.1 687ns 0.252ns 0.977ns 0.00938 0 0 696 B
#5992 StartFinishScope net472 834ns 0.637ns 2.47ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5992

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.141 601.97 686.65

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 602ns 0.275ns 1.07ns 0.00972 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 898ns 0.268ns 1ns 0.00945 0 0 696 B
master RunOnMethodBegin net472 1.06μs 0.522ns 2.02ns 0.104 0 0 658 B
#5992 RunOnMethodBegin net6.0 687ns 0.315ns 1.18ns 0.00968 0 0 696 B
#5992 RunOnMethodBegin netcoreapp3.1 932ns 0.505ns 1.95ns 0.00936 0 0 696 B
#5992 RunOnMethodBegin net472 1.04μs 0.517ns 1.93ns 0.104 0 0 658 B

@dromanol dromanol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TY

@andrewlock
andrewlock merged commit ff4bb6d into release/2.x Sep 6, 2024
@andrewlock
andrewlock deleted the kevin/table_flip_v2 branch September 6, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants