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] Add a lock to handle WAF active addresses #6566

Merged
merged 4 commits into from
Jan 17, 2025

Conversation

NachoEchevarria
Copy link
Contributor

@NachoEchevarria NachoEchevarria commented Jan 16, 2025

Summary of changes

The field _activeAddresses should be thread safe to avoid concurrency issues.

Reason for change

Implementation details

Test coverage

Other details

@NachoEchevarria NachoEchevarria changed the title [ASM] Add a lock to handle _activeAddresses [ASM] Add a lock to handle WAF active addresses Jan 16, 2025
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jan 16, 2025

Datadog Report

Branch report: nacho/LockForActiveAddresses
Commit report: 576aca6
Test service: dd-trace-dotnet

✅ 0 Failed, 245671 Passed, 1969 Skipped, 19h 30m 39.06s Total Time
⌛ 1 Performance Regression

⌛ Performance Regressions vs Default Branch (1)

  • ObjectExtractorSimpleBody - Benchmarks.Trace.Asm.AppSecBodyBenchmark 191ns (+25ns, +16%) - Details

@andrewlock
Copy link
Member

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6566) - mean (69ms)  : 65, 74
     .   : milestone, 69,
    master - mean (69ms)  : 64, 75
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6566) - mean (983ms)  : 963, 1003
     .   : milestone, 983,
    master - mean (978ms)  : 954, 1001
     .   : milestone, 978,

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

    section CallTarget+Inlining+NGEN
    This PR (6566) - mean (684ms)  : 662, 705
     .   : milestone, 684,
    master - mean (681ms)  : 667, 695
     .   : milestone, 681,

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

    section CallTarget+Inlining+NGEN
    This PR (6566) - mean (636ms)  : 622, 651
     .   : milestone, 636,
    master - mean (632ms)  : 615, 650
     .   : milestone, 632,

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

    section CallTarget+Inlining+NGEN
    This PR (6566) - mean (1,095ms)  : 1065, 1124
     .   : milestone, 1095,
    master - mean (1,094ms)  : 1058, 1130
     .   : milestone, 1094,

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

    section CallTarget+Inlining+NGEN
    This PR (6566) - mean (870ms)  : 842, 898
     .   : milestone, 870,
    master - mean (872ms)  : 844, 900
     .   : milestone, 872,

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

    section CallTarget+Inlining+NGEN
    This PR (6566) - mean (850ms)  : 815, 885
     .   : milestone, 850,
    master - mean (849ms)  : 811, 886
     .   : milestone, 849,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for appsec 🐌

Benchmarks for #6566 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.168
  • 2 benchmarks have fewer 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 #6566

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 1.168 164.01 191.55

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 203μs 88.6ns 332ns 2.62 0 0 188.76 KB
master AllCycleSimpleBody netcoreapp3.1 300μs 97.6ns 378ns 2.69 0 0 196.09 KB
master AllCycleSimpleBody net472 270μs 239ns 893ns 35.8 2.02 0 225.78 KB
master AllCycleMoreComplexBody net6.0 211μs 108ns 418ns 2.73 0 0 192.26 KB
master AllCycleMoreComplexBody netcoreapp3.1 327μs 179ns 669ns 2.61 0 0 199.5 KB
master AllCycleMoreComplexBody net472 277μs 155ns 558ns 36.4 2.07 0 229.3 KB
master ObjectExtractorSimpleBody net6.0 139ns 0.0962ns 0.36ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 202ns 1.01ns 4.4ns 0.00366 0 0 272 B
master ObjectExtractorSimpleBody net472 164ns 0.14ns 0.541ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.96μs 2.48ns 8.95ns 0.0533 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.82μs 2.41ns 9.35ns 0.0496 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.69μs 5.19ns 19.4ns 0.603 0.00551 0 3.8 KB
#6566 AllCycleSimpleBody net6.0 207μs 121ns 454ns 2.68 0 0 188.69 KB
#6566 AllCycleSimpleBody netcoreapp3.1 293μs 128ns 479ns 2.63 0 0 196.02 KB
#6566 AllCycleSimpleBody net472 274μs 383ns 1.43μs 35.9 2.04 0 225.75 KB
#6566 AllCycleMoreComplexBody net6.0 212μs 193ns 749ns 2.65 0 0 192.19 KB
#6566 AllCycleMoreComplexBody netcoreapp3.1 317μs 181ns 677ns 2.7 0 0 199.43 KB
#6566 AllCycleMoreComplexBody net472 278μs 297ns 1.11μs 36.4 2.11 0 229.27 KB
#6566 ObjectExtractorSimpleBody net6.0 140ns 0.0875ns 0.327ns 0.00395 0 0 280 B
#6566 ObjectExtractorSimpleBody netcoreapp3.1 195ns 0.142ns 0.531ns 0.00374 0 0 272 B
#6566 ObjectExtractorSimpleBody net472 191ns 0.232ns 0.897ns 0.0446 0 0 281 B
#6566 ObjectExtractorMoreComplexBody net6.0 2.97μs 1.29ns 4.84ns 0.0535 0 0 3.78 KB
#6566 ObjectExtractorMoreComplexBody netcoreapp3.1 3.87μs 3.51ns 12.6ns 0.0504 0 0 3.69 KB
#6566 ObjectExtractorMoreComplexBody net472 3.7μs 4.59ns 17.8ns 0.602 0.00557 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 38.6μs 14.8ns 57.3ns 0.444 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.1μs 28.5ns 110ns 0.431 0 0 32.4 KB
master EncodeArgs net472 67.2μs 208ns 807ns 5.16 0.0661 0 32.5 KB
master EncodeLegacyArgs net6.0 80.2μs 167ns 645ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 108μs 147ns 552ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 154μs 106ns 409ns 0.308 0 0 2.15 KB
#6566 EncodeArgs net6.0 38.1μs 28.4ns 106ns 0.455 0 0 32.4 KB
#6566 EncodeArgs netcoreapp3.1 54.6μs 31.9ns 123ns 0.436 0 0 32.4 KB
#6566 EncodeArgs net472 66.4μs 75.3ns 282ns 5.16 0.0666 0 32.5 KB
#6566 EncodeLegacyArgs net6.0 77.3μs 403ns 2.02μs 0 0 0 2.14 KB
#6566 EncodeLegacyArgs netcoreapp3.1 107μs 511ns 1.98μs 0 0 0 2.14 KB
#6566 EncodeLegacyArgs net472 154μs 94.5ns 366ns 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 175μs 67.6ns 253ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 186μs 241ns 935ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 201μs 157ns 609ns 0.302 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 116μs 82.5ns 320ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 101ns 349ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 133μs 83.6ns 324ns 0.199 0 0 1.48 KB
#6566 RunWafRealisticBenchmark net6.0 174μs 243ns 942ns 0 0 0 2.44 KB
#6566 RunWafRealisticBenchmark netcoreapp3.1 187μs 250ns 967ns 0 0 0 2.39 KB
#6566 RunWafRealisticBenchmark net472 203μs 157ns 607ns 0.301 0 0 2.46 KB
#6566 RunWafRealisticBenchmarkWithAttack net6.0 116μs 54.5ns 211ns 0 0 0 1.47 KB
#6566 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 123μs 97.8ns 379ns 0 0 0 1.46 KB
#6566 RunWafRealisticBenchmarkWithAttack net472 132μs 66.3ns 248ns 0.199 0 0 1.48 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6566

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 264.31 KB 256.54 KB -7.77 KB -2.94%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 61.98 KB 59.04 KB -2.94 KB -4.75%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 54.2μs 498ns 4.88μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 53.9μs 280ns 1.37μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 36.9μs 93.2ns 323ns 0 0 0 61.98 KB
master StringConcatAspectBenchmark net6.0 319μs 1.58μs 10.1μs 0 0 0 264.31 KB
master StringConcatAspectBenchmark netcoreapp3.1 336μs 1.85μs 10.7μs 0 0 0 252.53 KB
master StringConcatAspectBenchmark net472 269μs 4.94μs 47.7μs 0 0 0 278.53 KB
#6566 StringConcatBenchmark net6.0 58.4μs 635ns 6.09μs 0 0 0 43.44 KB
#6566 StringConcatBenchmark netcoreapp3.1 54.1μs 177ns 661ns 0 0 0 42.64 KB
#6566 StringConcatBenchmark net472 37.8μs 101ns 379ns 0 0 0 59.04 KB
#6566 StringConcatAspectBenchmark net6.0 321μs 1.54μs 10.7μs 0 0 0 256.54 KB
#6566 StringConcatAspectBenchmark netcoreapp3.1 312μs 4.88μs 48.6μs 0 0 0 253.63 KB
#6566 StringConcatAspectBenchmark net472 287μs 6.38μs 62.2μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6566 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.136
  • 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.09μs 45.7ns 303ns 0.016 0.004 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.1μs 55.4ns 332ns 0.0192 0.00479 0 5.8 KB
master StartStopWithChild net472 16.4μs 58.6ns 211ns 1.04 0.297 0.0989 6.21 KB
#6566 StartStopWithChild net6.0 8.08μs 46.3ns 361ns 0.0153 0.00765 0 5.61 KB
#6566 StartStopWithChild netcoreapp3.1 10μs 52.9ns 259ns 0.0155 0.00518 0 5.81 KB
#6566 StartStopWithChild net472 16.2μs 61.1ns 237ns 1.04 0.299 0.105 6.21 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 486μs 383ns 1.48μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 663μs 498ns 1.93μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 853μs 391ns 1.51μs 0.425 0 0 3.3 KB
#6566 WriteAndFlushEnrichedTraces net6.0 493μs 421ns 1.63μs 0 0 0 2.7 KB
#6566 WriteAndFlushEnrichedTraces netcoreapp3.1 651μs 385ns 1.44μs 0 0 0 2.7 KB
#6566 WriteAndFlushEnrichedTraces net472 857μs 498ns 1.8μs 0.425 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 153μs 923ns 9μs 0.159 0 0 14.47 KB
master SendRequest netcoreapp3.1 170μs 986ns 8.13μs 0.133 0 0 17.27 KB
master SendRequest net472 0.000249ns 0.000222ns 0.000802ns 0 0 0 0 b
#6566 SendRequest net6.0 155μs 925ns 9.16μs 0.147 0 0 14.48 KB
#6566 SendRequest netcoreapp3.1 178μs 1.47μs 14.7μs 0.186 0 0 17.27 KB
#6566 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 576μs 3.2μs 20.3μs 0.558 0 0 41.56 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 658μs 2.02μs 7.29μs 0.327 0 0 41.74 KB
master WriteAndFlushEnrichedTraces net472 860μs 3.59μs 13.9μs 8.25 2.6 0.434 53.27 KB
#6566 WriteAndFlushEnrichedTraces net6.0 585μs 3.06μs 18.1μs 0.61 0 0 41.66 KB
#6566 WriteAndFlushEnrichedTraces netcoreapp3.1 657μs 3.15μs 12.6μs 0.329 0 0 41.74 KB
#6566 WriteAndFlushEnrichedTraces net472 825μs 3.86μs 15μs 8.06 2.42 0.403 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.32μs 1.08ns 3.91ns 0.0145 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.76μs 1.42ns 5.52ns 0.0131 0 0 1.02 KB
master ExecuteNonQuery net472 2.09μs 1.67ns 6.24ns 0.156 0.00105 0 987 B
#6566 ExecuteNonQuery net6.0 1.25μs 1.19ns 4.6ns 0.0144 0 0 1.02 KB
#6566 ExecuteNonQuery netcoreapp3.1 1.76μs 1.96ns 7.34ns 0.0133 0 0 1.02 KB
#6566 ExecuteNonQuery net472 2.21μs 2.78ns 10.8ns 0.156 0.0011 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.492ns 1.84ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.54μs 1.23ns 4.61ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.68μs 1.67ns 6.48ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.28μs 0.504ns 1.95ns 0.0135 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.69μs 0.398ns 1.43ns 0.0136 0 0 1.02 KB
master CallElasticsearchAsync net472 2.66μs 1.83ns 7.08ns 0.166 0 0 1.05 KB
#6566 CallElasticsearch net6.0 1.26μs 0.443ns 1.71ns 0.0139 0 0 976 B
#6566 CallElasticsearch netcoreapp3.1 1.53μs 0.783ns 2.93ns 0.0131 0 0 976 B
#6566 CallElasticsearch net472 2.63μs 2.75ns 10.6ns 0.157 0 0 995 B
#6566 CallElasticsearchAsync net6.0 1.33μs 0.542ns 2.1ns 0.0133 0 0 952 B
#6566 CallElasticsearchAsync netcoreapp3.1 1.58μs 0.494ns 1.91ns 0.0134 0 0 1.02 KB
#6566 CallElasticsearchAsync net472 2.58μs 2.45ns 9.49ns 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.31μs 0.718ns 2.69ns 0.0131 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.69μs 0.974ns 3.77ns 0.0126 0 0 952 B
master ExecuteAsync net472 1.85μs 0.604ns 2.26ns 0.145 0 0 915 B
#6566 ExecuteAsync net6.0 1.2μs 0.711ns 2.66ns 0.0133 0 0 952 B
#6566 ExecuteAsync netcoreapp3.1 1.59μs 1.11ns 4.16ns 0.0128 0 0 952 B
#6566 ExecuteAsync net472 1.81μs 0.775ns 3ns 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.43μs 1.49ns 5.77ns 0.031 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.28μs 1.72ns 6.65ns 0.0371 0 0 2.85 KB
master SendAsync net472 7.32μs 1.41ns 5.45ns 0.494 0 0 3.12 KB
#6566 SendAsync net6.0 4.31μs 3.59ns 13.4ns 0.0325 0 0 2.31 KB
#6566 SendAsync netcoreapp3.1 5.3μs 1.8ns 6.99ns 0.0368 0 0 2.85 KB
#6566 SendAsync net472 7.53μs 2.11ns 7.9ns 0.494 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.58μs 1ns 3.76ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.18μs 1.44ns 5.37ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.74μs 1.18ns 4.58ns 0.249 0 0 1.57 KB
#6566 EnrichedLog net6.0 1.54μs 0.692ns 2.59ns 0.0231 0 0 1.64 KB
#6566 EnrichedLog netcoreapp3.1 2.25μs 1.35ns 5.05ns 0.022 0 0 1.64 KB
#6566 EnrichedLog net472 2.6μs 1.51ns 5.83ns 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 119μs 180ns 696ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 123μs 263ns 1.02μs 0 0 0 4.28 KB
master EnrichedLog net472 152μs 120ns 448ns 0.691 0.23 0 4.46 KB
#6566 EnrichedLog net6.0 116μs 133ns 513ns 0.0581 0 0 4.28 KB
#6566 EnrichedLog netcoreapp3.1 119μs 111ns 428ns 0 0 0 4.28 KB
#6566 EnrichedLog net472 151μs 404ns 1.56μs 0.674 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.16μs 1.46ns 5.66ns 0.0303 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.14μs 1.55ns 5.36ns 0.0295 0 0 2.2 KB
master EnrichedLog net472 4.78μs 0.719ns 2.69ns 0.32 0 0 2.02 KB
#6566 EnrichedLog net6.0 3.09μs 0.889ns 3.44ns 0.0298 0 0 2.2 KB
#6566 EnrichedLog netcoreapp3.1 4.16μs 1.91ns 7.41ns 0.0291 0 0 2.2 KB
#6566 EnrichedLog net472 4.86μs 1.24ns 4.81ns 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.37μs 1.04ns 4.02ns 0.0159 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.86μs 0.598ns 2.32ns 0.0158 0 0 1.14 KB
master SendReceive net472 2.2μs 1.56ns 6.03ns 0.183 0 0 1.16 KB
#6566 SendReceive net6.0 1.41μs 0.975ns 3.77ns 0.0162 0 0 1.14 KB
#6566 SendReceive netcoreapp3.1 1.78μs 0.916ns 3.55ns 0.0151 0 0 1.14 KB
#6566 SendReceive net472 2.05μs 1.38ns 5.15ns 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.78μs 0.857ns 3.21ns 0.0226 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.89μs 1.97ns 7.64ns 0.0212 0 0 1.65 KB
master EnrichedLog net472 4.5μs 1.74ns 6.26ns 0.322 0 0 2.04 KB
#6566 EnrichedLog net6.0 2.62μs 0.78ns 2.92ns 0.0224 0 0 1.6 KB
#6566 EnrichedLog netcoreapp3.1 3.99μs 1.56ns 6.03ns 0.022 0 0 1.65 KB
#6566 EnrichedLog net472 4.41μs 3.57ns 13.8ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6566

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.136 733.50 645.87

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 410ns 0.344ns 1.33ns 0.00805 0 0 576 B
master StartFinishSpan netcoreapp3.1 553ns 0.481ns 1.86ns 0.00772 0 0 576 B
master StartFinishSpan net472 733ns 0.207ns 0.802ns 0.0918 0 0 578 B
master StartFinishScope net6.0 478ns 0.228ns 0.885ns 0.00985 0 0 696 B
master StartFinishScope netcoreapp3.1 729ns 0.517ns 2ns 0.00945 0 0 696 B
master StartFinishScope net472 896ns 0.369ns 1.38ns 0.104 0 0 658 B
#6566 StartFinishSpan net6.0 450ns 0.23ns 0.889ns 0.00817 0 0 576 B
#6566 StartFinishSpan netcoreapp3.1 558ns 0.485ns 1.81ns 0.00771 0 0 576 B
#6566 StartFinishSpan net472 646ns 0.287ns 1.11ns 0.0918 0 0 578 B
#6566 StartFinishScope net6.0 531ns 0.427ns 1.65ns 0.00985 0 0 696 B
#6566 StartFinishScope netcoreapp3.1 767ns 0.461ns 1.78ns 0.00926 0 0 696 B
#6566 StartFinishScope net472 891ns 0.414ns 1.6ns 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 617ns 0.573ns 2.22ns 0.00965 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 853ns 0.454ns 1.76ns 0.0094 0 0 696 B
master RunOnMethodBegin net472 1.11μs 0.583ns 2.26ns 0.105 0 0 658 B
#6566 RunOnMethodBegin net6.0 605ns 0.298ns 1.15ns 0.00969 0 0 696 B
#6566 RunOnMethodBegin netcoreapp3.1 921ns 0.538ns 2.01ns 0.00933 0 0 696 B
#6566 RunOnMethodBegin net472 1.18μs 0.606ns 2.35ns 0.104 0 0 658 B

@NachoEchevarria NachoEchevarria marked this pull request as ready for review January 17, 2025 09:01
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner January 17, 2025 09:01
Copy link
Member

@robertpi robertpi left a comment

Choose a reason for hiding this comment

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

Locking looks consistent to me.

Copy link
Member

@e-n-0 e-n-0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@NachoEchevarria
Copy link
Contributor Author

Thanks!

@NachoEchevarria NachoEchevarria merged commit d8038a0 into master Jan 17, 2025
125 of 128 checks passed
@NachoEchevarria NachoEchevarria deleted the nacho/LockForActiveAddresses branch January 17, 2025 14:53
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 17, 2025
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