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

[IAST] Avoid lock in method ctor. #6115

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

daniel-romano-DD
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD commented Oct 3, 2024

Summary of changes

Avoid a unneeded lock in the MethodInfo constructor when calculating full name

Reason for change

All methods need to calculate their full name in order to determine if they are excluded from dataflow. FullName calculation is lazy, and thus, protected by a mutex. This was moved to the constructor in a previous refactor, but the mutext kept bein taken, and there's no need for that

Implementation details

Test coverage

Other details

@daniel-romano-DD daniel-romano-DD requested a review from a team as a code owner October 3, 2024 14:49
@daniel-romano-DD daniel-romano-DD added area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) area:asm-iast labels Oct 3, 2024
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Oct 3, 2024

Datadog Report

Branch report: dani/iast/improve_method_name_calculation
Commit report: 6d8572e
Test service: dd-trace-dotnet

✅ 0 Failed, 370035 Passed, 2749 Skipped, 27h 13m 50.92s Total Time
⌛ 1 Performance Regression

⌛ Performance Regressions vs Default Branch (1)

  • StartStopWithChild - Benchmarks.Trace.ActivityBenchmark 17.5µs (+1.38µs, +9%) - 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 (6115) - mean (70ms)  : 68, 72
     .   : milestone, 70,
    master - mean (71ms)  : 67, 74
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (6115) - mean (1,110ms)  : 1085, 1135
     .   : milestone, 1110,
    master - mean (1,108ms)  : 1083, 1132
     .   : milestone, 1108,

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

    section CallTarget+Inlining+NGEN
    This PR (6115) - mean (773ms)  : 758, 787
     .   : milestone, 773,
    master - mean (769ms)  : 750, 787
     .   : milestone, 769,

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

    section CallTarget+Inlining+NGEN
    This PR (6115) - mean (731ms)  : 713, 749
     .   : milestone, 731,
    master - mean (732ms)  : 716, 748
     .   : milestone, 732,

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

    section CallTarget+Inlining+NGEN
    This PR (6115) - mean (1,198ms)  : 1174, 1222
     .   : milestone, 1198,
    master - mean (1,197ms)  : 1174, 1219
     .   : milestone, 1197,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6115) - mean (278ms)  : 271, 284
     .   : milestone, 278,
    master - mean (277ms)  : 272, 282
     .   : milestone, 277,

    section CallTarget+Inlining+NGEN
    This PR (6115) - mean (942ms)  : 920, 963
     .   : milestone, 942,
    master - mean (939ms)  : 925, 953
     .   : milestone, 939,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6115) - mean (266ms)  : 262, 270
     .   : milestone, 266,
    master - mean (264ms)  : 260, 269
     .   : milestone, 264,

    section CallTarget+Inlining+NGEN
    This PR (6115) - mean (929ms)  : 911, 947
     .   : milestone, 929,
    master - mean (926ms)  : 904, 947
     .   : milestone, 926,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for appsec 🐌

Benchmarks for #6115 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.171
  • 1 benchmarks are slower, with geometric mean 1.154
  • 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 #6115

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody‑net472 1.154 3,799.07 4,383.57

Faster 🎉 in #6115

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑net472 1.171 192.64 164.58

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 73.1μs 76.2ns 285ns 0.0725 0 0 6 KB
master AllCycleSimpleBody netcoreapp3.1 63.1μs 89.2ns 334ns 0.0628 0 0 6.95 KB
master AllCycleSimpleBody net472 49.3μs 42.6ns 159ns 1.31 0 0 8.34 KB
master AllCycleMoreComplexBody net6.0 77.5μs 79.4ns 307ns 0.116 0 0 9.51 KB
master AllCycleMoreComplexBody netcoreapp3.1 69.9μs 75.6ns 283ns 0.14 0 0 10.36 KB
master AllCycleMoreComplexBody net472 56.1μs 67.6ns 262ns 1.86 0.0281 0 11.85 KB
master ObjectExtractorSimpleBody net6.0 141ns 0.137ns 0.513ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 198ns 0.194ns 0.753ns 0.00369 0 0 272 B
master ObjectExtractorSimpleBody net472 193ns 0.139ns 0.539ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3.09μs 1.51ns 5.67ns 0.0528 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.87μs 2.13ns 7.96ns 0.0503 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.8μs 3.64ns 14.1ns 0.601 0.00566 0 3.8 KB
#6115 AllCycleSimpleBody net6.0 72.6μs 72.9ns 273ns 0.072 0 0 6.01 KB
#6115 AllCycleSimpleBody netcoreapp3.1 62.9μs 66.5ns 258ns 0.0626 0 0 6.95 KB
#6115 AllCycleSimpleBody net472 48.4μs 24.6ns 88.8ns 1.32 0 0 8.34 KB
#6115 AllCycleMoreComplexBody net6.0 77.9μs 125ns 484ns 0.117 0 0 9.51 KB
#6115 AllCycleMoreComplexBody netcoreapp3.1 70μs 74.3ns 288ns 0.139 0 0 10.36 KB
#6115 AllCycleMoreComplexBody net472 56.9μs 52.7ns 197ns 1.87 0.0287 0 11.85 KB
#6115 ObjectExtractorSimpleBody net6.0 143ns 0.114ns 0.425ns 0.00395 0 0 280 B
#6115 ObjectExtractorSimpleBody netcoreapp3.1 197ns 0.422ns 1.64ns 0.00375 0 0 272 B
#6115 ObjectExtractorSimpleBody net472 165ns 0.109ns 0.421ns 0.0446 0 0 281 B
#6115 ObjectExtractorMoreComplexBody net6.0 3.12μs 1.79ns 6.7ns 0.0531 0 0 3.78 KB
#6115 ObjectExtractorMoreComplexBody netcoreapp3.1 3.99μs 4.21ns 15.7ns 0.0501 0 0 3.69 KB
#6115 ObjectExtractorMoreComplexBody net472 4.39μs 4.4ns 16.5ns 0.603 0.0066 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.5μs 20.4ns 79ns 0.449 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.5μs 19.4ns 75.3ns 0.433 0 0 32.4 KB
master EncodeArgs net472 67.4μs 31ns 116ns 5.16 0.0674 0 32.5 KB
master EncodeLegacyArgs net6.0 72.4μs 52.3ns 203ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 107μs 359ns 1.39μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 151μs 80.3ns 300ns 0.302 0 0 2.15 KB
#6115 EncodeArgs net6.0 37.4μs 22.1ns 82.8ns 0.465 0 0 32.4 KB
#6115 EncodeArgs netcoreapp3.1 55.5μs 25.3ns 97.8ns 0.444 0 0 32.4 KB
#6115 EncodeArgs net472 66.1μs 19.7ns 76.2ns 5.16 0.0662 0 32.5 KB
#6115 EncodeLegacyArgs net6.0 71.6μs 68.2ns 246ns 0 0 0 2.14 KB
#6115 EncodeLegacyArgs netcoreapp3.1 107μs 45.7ns 177ns 0 0 0 2.14 KB
#6115 EncodeLegacyArgs net472 153μs 88.6ns 343ns 0.306 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 186μs 58.1ns 201ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 196μs 185ns 716ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 210μs 186ns 719ns 0.312 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 123μs 226ns 874ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 131μs 126ns 487ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 140μs 34.7ns 125ns 0.209 0 0 1.49 KB
#6115 RunWafRealisticBenchmark net6.0 186μs 300ns 1.16μs 0 0 0 2.44 KB
#6115 RunWafRealisticBenchmark netcoreapp3.1 196μs 147ns 569ns 0 0 0 2.39 KB
#6115 RunWafRealisticBenchmark net472 209μs 85.1ns 330ns 0.315 0 0 2.46 KB
#6115 RunWafRealisticBenchmarkWithAttack net6.0 124μs 83ns 321ns 0 0 0 1.47 KB
#6115 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 127ns 492ns 0 0 0 1.46 KB
#6115 RunWafRealisticBenchmarkWithAttack net472 140μs 31.6ns 118ns 0.21 0 0 1.49 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6115

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 254.43 KB 252.77 KB -1.66 KB -0.65%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 60.26 KB 59.14 KB -1.11 KB -1.85%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 58μs 716ns 7.09μs 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 59.8μs 812ns 8.04μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 37.5μs 199ns 1.05μs 0 0 0 60.26 KB
master StringConcatAspectBenchmark net6.0 304μs 1.6μs 8.61μs 0 0 0 254.31 KB
master StringConcatAspectBenchmark netcoreapp3.1 351μs 1.96μs 13.1μs 0 0 0 254.43 KB
master StringConcatAspectBenchmark net472 292μs 6.53μs 65μs 0 0 0 278.53 KB
#6115 StringConcatBenchmark net6.0 51.2μs 228ns 821ns 0 0 0 43.44 KB
#6115 StringConcatBenchmark netcoreapp3.1 60.5μs 801ns 7.85μs 0 0 0 42.64 KB
#6115 StringConcatBenchmark net472 37.4μs 127ns 457ns 0 0 0 59.14 KB
#6115 StringConcatAspectBenchmark net6.0 307μs 1.71μs 10.9μs 0 0 0 255.33 KB
#6115 StringConcatAspectBenchmark netcoreapp3.1 328μs 1.61μs 12.1μs 0 0 0 252.77 KB
#6115 StringConcatAspectBenchmark net472 278μs 6.13μs 59.5μs 0 0 0 278.53 KB

@andrewlock
Copy link
Member

Throughput/Crank Report ⚡

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 (6115) (11.116M)   : 0, 11115571
    master (11.141M)   : 0, 11140702
    benchmarks/2.9.0 (11.081M)   : 0, 11080577

    section Automatic
    This PR (6115) (7.344M)   : 0, 7344069
    master (7.405M)   : 0, 7405201
    benchmarks/2.9.0 (7.732M)   : 0, 7732233

    section Trace stats
    master (7.560M)   : 0, 7559772

    section Manual
    master (11.167M)   : 0, 11167059

    section Manual + Automatic
    This PR (6115) (6.760M)   : 0, 6760437
    master (6.766M)   : 0, 6765500

    section DD_TRACE_ENABLED=0
    master (10.279M)   : 0, 10278615

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6115) (9.407M)   : 0, 9407354
    master (9.721M)   : 0, 9721360
    benchmarks/2.9.0 (9.798M)   : 0, 9798067

    section Automatic
    This PR (6115) (6.533M)   : 0, 6533045
    master (6.623M)   : 0, 6623242

    section Trace stats
    master (6.765M)   : 0, 6764653

    section Manual
    master (9.661M)   : 0, 9660607

    section Manual + Automatic
    This PR (6115) (6.036M)   : 0, 6035930
    master (6.237M)   : 0, 6236560

    section DD_TRACE_ENABLED=0
    master (8.815M)   : 0, 8815374

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6115) (10.183M)   : 0, 10183474
    master (9.926M)   : 0, 9926042
    benchmarks/2.9.0 (10.067M)   : 0, 10067315

    section Automatic
    This PR (6115) (6.892M)   : 0, 6892301
    master (6.573M)   : 0, 6572681
    benchmarks/2.9.0 (7.552M)   : 0, 7552193

    section Trace stats
    master (7.374M)   : 0, 7373627

    section Manual
    master (10.104M)   : 0, 10103830

    section Manual + Automatic
    This PR (6115) (6.278M)   : 0, 6278139
    master (6.247M)   : 0, 6246669

    section DD_TRACE_ENABLED=0
    master (9.437M)   : 0, 9437343

Loading

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6115 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.209
  • 2 benchmarks are slower, with geometric mean 1.144
  • 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.84μs 43.8ns 304ns 0.0165 0.00413 0 5.43 KB
master StartStopWithChild netcoreapp3.1 10μs 54.3ns 326ns 0.0209 0.00523 0 5.61 KB
master StartStopWithChild net472 16μs 16.6ns 62.1ns 1.01 0.293 0.0952 6.07 KB
#6115 StartStopWithChild net6.0 7.87μs 44.3ns 294ns 0.016 0.00801 0 5.43 KB
#6115 StartStopWithChild netcoreapp3.1 10.4μs 57.9ns 352ns 0.0196 0.00981 0 5.62 KB
#6115 StartStopWithChild net472 17.5μs 35.1ns 131ns 1.03 0.312 0.104 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 477μs 247ns 958ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 661μs 411ns 1.59μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 839μs 702ns 2.53μs 0.417 0 0 3.3 KB
#6115 WriteAndFlushEnrichedTraces net6.0 475μs 326ns 1.26μs 0 0 0 2.7 KB
#6115 WriteAndFlushEnrichedTraces netcoreapp3.1 646μs 431ns 1.67μs 0 0 0 2.7 KB
#6115 WriteAndFlushEnrichedTraces net472 833μs 318ns 1.14μs 0.414 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 195μs 1.11μs 8.32μs 0.188 0 0 18.45 KB
master SendRequest netcoreapp3.1 217μs 1.24μs 8.92μs 0.201 0 0 20.61 KB
master SendRequest net472 0.00215ns 0.000542ns 0.0021ns 0 0 0 0 b
#6115 SendRequest net6.0 192μs 971ns 4.55μs 0.185 0 0 18.45 KB
#6115 SendRequest netcoreapp3.1 215μs 1.13μs 5.66μs 0.217 0 0 20.61 KB
#6115 SendRequest net472 0.00177ns 0.00077ns 0.00298ns 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 574μs 3.08μs 19μs 0.553 0 0 41.66 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 687μs 3.21μs 12.4μs 0.343 0 0 41.66 KB
master WriteAndFlushEnrichedTraces net472 854μs 4.02μs 16.6μs 8.08 2.55 0.425 53.29 KB
#6115 WriteAndFlushEnrichedTraces net6.0 579μs 2.92μs 12.7μs 0.558 0 0 41.5 KB
#6115 WriteAndFlushEnrichedTraces netcoreapp3.1 710μs 3.43μs 13.7μs 0.347 0 0 41.62 KB
#6115 WriteAndFlushEnrichedTraces net472 849μs 4.25μs 18μs 8.19 2.59 0.431 53.29 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.35μs 1.18ns 4.57ns 0.0144 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.81μs 1.35ns 5.04ns 0.0136 0 0 1.02 KB
master ExecuteNonQuery net472 2.06μs 1.78ns 6.89ns 0.157 0 0 987 B
#6115 ExecuteNonQuery net6.0 1.32μs 1.36ns 5.28ns 0.0139 0 0 1.02 KB
#6115 ExecuteNonQuery netcoreapp3.1 1.84μs 1.38ns 5.35ns 0.013 0 0 1.02 KB
#6115 ExecuteNonQuery net472 2.16μs 1.87ns 7.26ns 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.18μs 0.688ns 2.67ns 0.0136 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.55μs 1.76ns 6.58ns 0.0133 0 0 976 B
master CallElasticsearch net472 2.47μs 1.39ns 5.2ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.24μs 0.712ns 2.66ns 0.0136 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.64μs 0.498ns 1.93ns 0.014 0 0 1.02 KB
master CallElasticsearchAsync net472 2.58μs 2.68ns 10.4ns 0.166 0 0 1.05 KB
#6115 CallElasticsearch net6.0 1.11μs 0.682ns 2.64ns 0.014 0 0 976 B
#6115 CallElasticsearch netcoreapp3.1 1.5μs 0.664ns 2.48ns 0.0129 0 0 976 B
#6115 CallElasticsearch net472 2.53μs 2.14ns 8.3ns 0.158 0 0 995 B
#6115 CallElasticsearchAsync net6.0 1.33μs 0.579ns 2.24ns 0.0132 0 0 952 B
#6115 CallElasticsearchAsync netcoreapp3.1 1.61μs 0.484ns 1.81ns 0.0139 0 0 1.02 KB
#6115 CallElasticsearchAsync net472 2.51μs 1.39ns 5.37ns 0.167 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.21μs 0.827ns 3.1ns 0.0134 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.62μs 4.28ns 16.6ns 0.0127 0 0 952 B
master ExecuteAsync net472 1.75μs 0.692ns 2.68ns 0.145 0 0 915 B
#6115 ExecuteAsync net6.0 1.34μs 1ns 3.75ns 0.0134 0 0 952 B
#6115 ExecuteAsync netcoreapp3.1 1.57μs 0.71ns 2.46ns 0.0126 0 0 952 B
#6115 ExecuteAsync net472 1.76μs 2.25ns 8.73ns 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.19μs 1.31ns 5.07ns 0.0313 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.14μs 2.12ns 7.63ns 0.0359 0 0 2.76 KB
master SendAsync net472 7.78μs 3.22ns 12ns 0.496 0 0 3.15 KB
#6115 SendAsync net6.0 4.14μs 1.07ns 4ns 0.0311 0 0 2.22 KB
#6115 SendAsync netcoreapp3.1 5.11μs 2.73ns 10.2ns 0.0358 0 0 2.76 KB
#6115 SendAsync net472 7.78μs 1.54ns 5.76ns 0.498 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.45μs 0.528ns 2.04ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.1μs 3.92ns 15.2ns 0.0221 0 0 1.64 KB
master EnrichedLog net472 2.48μs 1.14ns 4.43ns 0.249 0 0 1.57 KB
#6115 EnrichedLog net6.0 1.56μs 0.74ns 2.77ns 0.0233 0 0 1.64 KB
#6115 EnrichedLog netcoreapp3.1 2.14μs 0.913ns 3.29ns 0.0225 0 0 1.64 KB
#6115 EnrichedLog net472 2.48μs 0.633ns 2.45ns 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 118μs 426ns 1.9μs 0.0566 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 121μs 316ns 1.22μs 0 0 0 4.28 KB
master EnrichedLog net472 148μs 184ns 688ns 0.664 0.221 0 4.46 KB
#6115 EnrichedLog net6.0 113μs 55.1ns 206ns 0.0581 0 0 4.28 KB
#6115 EnrichedLog netcoreapp3.1 118μs 115ns 446ns 0.0589 0 0 4.28 KB
#6115 EnrichedLog net472 146μs 173ns 668ns 0.655 0.218 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.24μs 0.736ns 2.75ns 0.0305 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.18μs 1.16ns 4.36ns 0.0293 0 0 2.2 KB
master EnrichedLog net472 4.83μs 1.19ns 4.62ns 0.321 0 0 2.02 KB
#6115 EnrichedLog net6.0 3.13μs 0.899ns 3.48ns 0.0298 0 0 2.2 KB
#6115 EnrichedLog netcoreapp3.1 4.21μs 2.46ns 9.19ns 0.0295 0 0 2.2 KB
#6115 EnrichedLog net472 4.9μs 1.22ns 4.72ns 0.318 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.744ns 2.68ns 0.0161 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.78μs 2.19ns 8.5ns 0.0152 0 0 1.14 KB
master SendReceive net472 2.19μs 1.04ns 3.75ns 0.183 0.00105 0 1.16 KB
#6115 SendReceive net6.0 1.39μs 0.838ns 3.24ns 0.016 0 0 1.14 KB
#6115 SendReceive netcoreapp3.1 1.78μs 4.24ns 16.4ns 0.0158 0 0 1.14 KB
#6115 SendReceive net472 2.09μs 1.29ns 5ns 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.85μs 0.916ns 3.55ns 0.0214 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 4.01μs 0.984ns 3.68ns 0.022 0 0 1.65 KB
master EnrichedLog net472 4.33μs 2.63ns 9.5ns 0.323 0 0 2.04 KB
#6115 EnrichedLog net6.0 2.8μs 1.18ns 4.41ns 0.0223 0 0 1.6 KB
#6115 EnrichedLog netcoreapp3.1 3.79μs 1.36ns 4.92ns 0.0211 0 0 1.65 KB
#6115 EnrichedLog net472 4.29μs 2.47ns 9.56ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6115

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.209 719.47 595.25

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 400ns 0.209ns 0.808ns 0.00795 0 0 576 B
master StartFinishSpan netcoreapp3.1 610ns 0.328ns 1.27ns 0.00792 0 0 576 B
master StartFinishSpan net472 720ns 0.285ns 1.1ns 0.0916 0 0 578 B
master StartFinishScope net6.0 537ns 0.35ns 1.35ns 0.00984 0 0 696 B
master StartFinishScope netcoreapp3.1 752ns 0.407ns 1.58ns 0.0096 0 0 696 B
master StartFinishScope net472 839ns 0.46ns 1.66ns 0.104 0 0 658 B
#6115 StartFinishSpan net6.0 418ns 0.14ns 0.525ns 0.00813 0 0 576 B
#6115 StartFinishSpan netcoreapp3.1 579ns 0.217ns 0.781ns 0.00786 0 0 576 B
#6115 StartFinishSpan net472 595ns 0.373ns 1.4ns 0.0915 0 0 578 B
#6115 StartFinishScope net6.0 494ns 0.216ns 0.838ns 0.00989 0 0 696 B
#6115 StartFinishScope netcoreapp3.1 796ns 0.432ns 1.67ns 0.00954 0 0 696 B
#6115 StartFinishScope net472 818ns 0.585ns 2.11ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6115

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.145 587.24 672.57
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.142 883.25 1,008.98

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 587ns 0.183ns 0.707ns 0.00972 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 883ns 0.45ns 1.74ns 0.0093 0 0 696 B
master RunOnMethodBegin net472 1.16μs 0.732ns 2.84ns 0.104 0 0 658 B
#6115 RunOnMethodBegin net6.0 673ns 0.184ns 0.687ns 0.00975 0 0 696 B
#6115 RunOnMethodBegin netcoreapp3.1 1.01μs 0.39ns 1.51ns 0.0096 0 0 696 B
#6115 RunOnMethodBegin net472 1.14μs 1.94ns 7.53ns 0.105 0 0 658 B

Copy link
Member

@tonyredondo tonyredondo left a comment

Choose a reason for hiding this comment

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

LGTM

@daniel-romano-DD daniel-romano-DD merged commit db9da9d into master Oct 4, 2024
78 of 79 checks passed
@daniel-romano-DD daniel-romano-DD deleted the dani/iast/improve_method_name_calculation branch October 4, 2024 09:35
@github-actions github-actions bot added this to the vNext-v3 milestone Oct 4, 2024
@andrewlock andrewlock added the type:cleanup Minor code clean up label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm-iast area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) type:cleanup Minor code clean up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants