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

[TRACER] Ensure synchronization in MethodInfo lazy operations #5698

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

daniel-romano-DD
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD commented Jun 15, 2024

Summary of changes

Aded better synchronization in MethodInfo lazy initialization

Reason for change

Some crashes in GetFullName() and IsExcluded() have been reported

Implementation details

IsExcluded() init moved to ctor. GetFullName() synched with parent's module mutex.

@daniel-romano-DD daniel-romano-DD added type:bug area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) labels Jun 15, 2024
@daniel-romano-DD daniel-romano-DD requested a review from a team as a code owner June 15, 2024 23:30
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jun 15, 2024

Datadog Report

Branch report: dani/tracer/fix_string_concurrency
Commit report: b0188d9
Test service: dd-trace-dotnet

✅ 0 Failed, 341231 Passed, 2156 Skipped, 22h 51m 17.52s Total Time

@andrewlock
Copy link
Member

andrewlock commented Jun 16, 2024

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 (5698) - mean (73ms)  : 65, 82
     .   : milestone, 73,
    master - mean (73ms)  : 64, 82
     .   : milestone, 73,

    section CallTarget+Inlining+NGEN
    This PR (5698) - mean (1,005ms)  : 982, 1029
     .   : milestone, 1005,
    master - mean (1,004ms)  : 984, 1025
     .   : milestone, 1004,

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

    section CallTarget+Inlining+NGEN
    This PR (5698) - mean (717ms)  : 690, 744
     .   : milestone, 717,
    master - mean (719ms)  : 695, 743
     .   : milestone, 719,

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

    section CallTarget+Inlining+NGEN
    This PR (5698) - mean (669ms)  : 650, 687
     .   : milestone, 669,
    master - mean (672ms)  : 650, 695
     .   : milestone, 672,

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

    section CallTarget+Inlining+NGEN
    This PR (5698) - mean (1,106ms)  : 1079, 1133
     .   : milestone, 1106,
    master - mean (1,103ms)  : 1079, 1128
     .   : milestone, 1103,

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

    section CallTarget+Inlining+NGEN
    This PR (5698) - mean (906ms)  : 883, 929
     .   : milestone, 906,
    master - mean (900ms)  : 873, 927
     .   : milestone, 900,

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

    section CallTarget+Inlining+NGEN
    This PR (5698) - mean (885ms)  : 861, 908
     .   : milestone, 885,
    master - mean (882ms)  : 856, 909
     .   : milestone, 882,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jun 16, 2024

Throughput/Crank Report:zap:

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5698) (11.408M)   : 0, 11407721
    master (11.448M)   : 0, 11447847
    benchmarks/2.9.0 (11.549M)   : 0, 11548501

    section Automatic
    This PR (5698) (7.578M)   : 0, 7578038
    master (7.788M)   : 0, 7788488
    benchmarks/2.9.0 (8.048M)   : 0, 8047587

    section Trace stats
    master (8.027M)   : 0, 8027001

    section Manual
    This PR (5698) (9.737M)   : 0, 9736657
    master (9.943M)   : 0, 9943278

    section Manual + Automatic
    This PR (5698) (7.228M)   : 0, 7228184
    master (7.271M)   : 0, 7271151

    section Version Conflict
    master (6.585M)   : 0, 6585167

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5698) (9.482M)   : 0, 9482346
    master (9.458M)   : 0, 9457647
    benchmarks/2.9.0 (9.577M)   : 0, 9576808

    section Automatic
    This PR (5698) (6.601M)   : 0, 6601471
    master (6.583M)   : 0, 6582951

    section Trace stats
    master (6.847M)   : 0, 6847454

    section Manual
    This PR (5698) (8.384M)   : 0, 8383973
    master (8.112M)   : 0, 8112217

    section Manual + Automatic
    This PR (5698) (6.243M)   : 0, 6243323
    master (6.131M)   : 0, 6130797

    section Version Conflict
    master (5.653M)   : 0, 5652860

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5698) (10.246M)   : 0, 10246157
    master (10.155M)   : 0, 10155212
    benchmarks/2.9.0 (10.137M)   : 0, 10136673

    section Automatic
    This PR (5698) (7.345M)   : 0, 7345456
    master (7.235M)   : 0, 7235269
    benchmarks/2.9.0 (7.555M)   : 0, 7555427

    section Trace stats
    master (7.562M)   : 0, 7562154

    section Manual
    This PR (5698) (9.065M)   : 0, 9065041
    master (8.975M)   : 0, 8974692

    section Manual + Automatic
    This PR (5698) (6.969M)   : 0, 6968724
    master (7.042M)   : 0, 7041944

    section Version Conflict
    master (6.204M)   : 0, 6204131

Loading

@andrewlock
Copy link
Member

andrewlock commented Jun 16, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5698 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.149
  • 1 benchmarks are slower, with geometric mean 1.173
  • 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.72μs 42.4ns 247ns 0.0153 0.00763 0 5.43 KB
master StartStopWithChild netcoreapp3.1 10.1μs 55.4ns 341ns 0.0147 0.00489 0 5.61 KB
master StartStopWithChild net472 16.2μs 48.1ns 180ns 1.02 0.311 0.107 6.07 KB
#5698 StartStopWithChild net6.0 7.8μs 43.1ns 259ns 0.0145 0.00726 0 5.43 KB
#5698 StartStopWithChild netcoreapp3.1 9.9μs 49.1ns 291ns 0.0146 0.00486 0 5.62 KB
#5698 StartStopWithChild net472 16μs 47.7ns 185ns 1.03 0.308 0.103 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 491μs 167ns 647ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 634μs 192ns 719ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 829μs 375ns 1.45μs 0.417 0 0 3.3 KB
#5698 WriteAndFlushEnrichedTraces net6.0 477μs 435ns 1.63μs 0 0 0 2.7 KB
#5698 WriteAndFlushEnrichedTraces netcoreapp3.1 633μs 189ns 733ns 0 0 0 2.7 KB
#5698 WriteAndFlushEnrichedTraces net472 831μs 166ns 600ns 0.417 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 173μs 221ns 856ns 0.258 0 0 18.44 KB
master SendRequest netcoreapp3.1 188μs 337ns 1.3μs 0.189 0 0 20.6 KB
master SendRequest net472 0.000614ns 0.000218ns 0.000844ns 0 0 0 0 b
#5698 SendRequest net6.0 172μs 250ns 970ns 0.257 0 0 18.44 KB
#5698 SendRequest netcoreapp3.1 195μs 251ns 972ns 0.195 0 0 20.6 KB
#5698 SendRequest net472 0.000328ns 0.000224ns 0.000807ns 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 552μs 1.15μs 4.47μs 0.551 0 0 41.5 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 672μs 883ns 3.42μs 0.327 0 0 41.76 KB
master WriteAndFlushEnrichedTraces net472 851μs 4.05μs 16.7μs 8.39 2.52 0.419 53.24 KB
#5698 WriteAndFlushEnrichedTraces net6.0 551μs 669ns 2.59μs 0.551 0 0 41.69 KB
#5698 WriteAndFlushEnrichedTraces netcoreapp3.1 648μs 2.57μs 9.96μs 0.316 0 0 41.81 KB
#5698 WriteAndFlushEnrichedTraces net472 857μs 2.76μs 10.3μs 8.3 2.62 0.437 53.22 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.19μs 0.973ns 3.77ns 0.0113 0 0 808 B
master ExecuteNonQuery netcoreapp3.1 1.5μs 0.914ns 3.54ns 0.0105 0 0 808 B
master ExecuteNonQuery net472 1.68μs 3.16ns 12.3ns 0.122 0 0 770 B
#5698 ExecuteNonQuery net6.0 1.16μs 1.82ns 7.04ns 0.011 0 0 808 B
#5698 ExecuteNonQuery netcoreapp3.1 1.51μs 1.05ns 4.05ns 0.0105 0 0 808 B
#5698 ExecuteNonQuery net472 1.74μs 4.42ns 17.1ns 0.122 0 0 770 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.17μs 0.454ns 1.76ns 0.0135 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.52μs 0.718ns 2.59ns 0.0132 0 0 976 B
master CallElasticsearch net472 2.39μs 1.37ns 5.29ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.27μs 0.765ns 2.86ns 0.0134 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.62μs 0.656ns 2.45ns 0.0139 0 0 1.02 KB
master CallElasticsearchAsync net472 2.47μs 1.43ns 5.34ns 0.166 0.00123 0 1.05 KB
#5698 CallElasticsearch net6.0 1.17μs 0.579ns 2.24ns 0.0141 0 0 976 B
#5698 CallElasticsearch netcoreapp3.1 1.52μs 0.723ns 2.7ns 0.0131 0 0 976 B
#5698 CallElasticsearch net472 2.52μs 2.33ns 9.03ns 0.158 0 0 995 B
#5698 CallElasticsearchAsync net6.0 1.27μs 1.51ns 5.84ns 0.0134 0 0 952 B
#5698 CallElasticsearchAsync netcoreapp3.1 1.55μs 1.34ns 4.81ns 0.0132 0 0 1.02 KB
#5698 CallElasticsearchAsync net472 2.53μs 2.04ns 7.9ns 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.18μs 0.626ns 2.34ns 0.0135 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.67μs 3.05ns 11.8ns 0.0125 0 0 952 B
master ExecuteAsync net472 1.82μs 0.926ns 3.47ns 0.145 0 0 915 B
#5698 ExecuteAsync net6.0 1.2μs 1.24ns 4.64ns 0.0134 0 0 952 B
#5698 ExecuteAsync netcoreapp3.1 1.68μs 1.04ns 4.02ns 0.0126 0 0 952 B
#5698 ExecuteAsync net472 1.82μs 1.1ns 4.28ns 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.14μs 1.81ns 6.75ns 0.0311 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.04μs 2.41ns 9.02ns 0.0379 0 0 2.76 KB
master SendAsync net472 7.62μs 2.03ns 7.6ns 0.498 0 0 3.15 KB
#5698 SendAsync net6.0 4.26μs 1.47ns 5.49ns 0.0299 0 0 2.22 KB
#5698 SendAsync netcoreapp3.1 5.11μs 2.81ns 10.9ns 0.0357 0 0 2.76 KB
#5698 SendAsync net472 7.61μs 3.39ns 13.1ns 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.49μs 0.54ns 2.02ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.26μs 1.19ns 4.29ns 0.0227 0 0 1.64 KB
master EnrichedLog net472 2.49μs 1.28ns 4.79ns 0.249 0 0 1.57 KB
#5698 EnrichedLog net6.0 1.48μs 1.41ns 5.46ns 0.0232 0 0 1.64 KB
#5698 EnrichedLog netcoreapp3.1 2.15μs 0.6ns 2.32ns 0.0218 0 0 1.64 KB
#5698 EnrichedLog net472 2.55μs 0.677ns 2.44ns 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 114μs 94.1ns 352ns 0.0566 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 119μs 150ns 582ns 0 0 0 4.28 KB
master EnrichedLog net472 148μs 100ns 375ns 0.663 0.221 0 4.46 KB
#5698 EnrichedLog net6.0 115μs 115ns 430ns 0.0571 0 0 4.28 KB
#5698 EnrichedLog netcoreapp3.1 119μs 117ns 452ns 0 0 0 4.28 KB
#5698 EnrichedLog net472 147μs 51.4ns 199ns 0.66 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.98μs 0.86ns 3.33ns 0.0311 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.18μs 2.18ns 8.45ns 0.0293 0 0 2.2 KB
master EnrichedLog net472 4.9μs 3.77ns 14.6ns 0.319 0 0 2.02 KB
#5698 EnrichedLog net6.0 3.12μs 1.37ns 5.3ns 0.0311 0 0 2.2 KB
#5698 EnrichedLog netcoreapp3.1 4.06μs 1.63ns 6.31ns 0.0304 0 0 2.2 KB
#5698 EnrichedLog net472 4.91μs 2.98ns 11.5ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5698

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 1.173 1,246.94 1,462.91

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.25μs 0.514ns 1.92ns 0.0162 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.78μs 0.594ns 2.22ns 0.0152 0 0 1.14 KB
master SendReceive net472 2.04μs 1.48ns 5.53ns 0.183 0 0 1.16 KB
#5698 SendReceive net6.0 1.46μs 0.933ns 3.62ns 0.0161 0 0 1.14 KB
#5698 SendReceive netcoreapp3.1 1.73μs 0.999ns 3.87ns 0.0149 0 0 1.14 KB
#5698 SendReceive net472 2.09μs 0.972ns 3.64ns 0.183 0.00104 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.87μs 1.26ns 4.88ns 0.0216 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.88μs 1.26ns 4.56ns 0.0213 0 0 1.65 KB
master EnrichedLog net472 4.51μs 1.29ns 5.01ns 0.322 0 0 2.04 KB
#5698 EnrichedLog net6.0 2.78μs 1.13ns 4.39ns 0.0222 0 0 1.6 KB
#5698 EnrichedLog netcoreapp3.1 3.89μs 1.55ns 6ns 0.0214 0 0 1.65 KB
#5698 EnrichedLog net472 4.32μs 1.34ns 5.01ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5698

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.149 558.68 486.33

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 400ns 0.188ns 0.703ns 0.00819 0 0 576 B
master StartFinishSpan netcoreapp3.1 618ns 0.576ns 2.16ns 0.00776 0 0 576 B
master StartFinishSpan net472 671ns 0.865ns 3.35ns 0.0916 0 0 578 B
master StartFinishScope net6.0 559ns 0.245ns 0.949ns 0.00982 0 0 696 B
master StartFinishScope netcoreapp3.1 721ns 0.454ns 1.76ns 0.00937 0 0 696 B
master StartFinishScope net472 845ns 0.308ns 1.19ns 0.104 0 0 658 B
#5698 StartFinishSpan net6.0 395ns 0.133ns 0.513ns 0.00813 0 0 576 B
#5698 StartFinishSpan netcoreapp3.1 591ns 0.342ns 1.28ns 0.00776 0 0 576 B
#5698 StartFinishSpan net472 718ns 0.445ns 1.72ns 0.0915 0 0 578 B
#5698 StartFinishScope net6.0 486ns 0.164ns 0.635ns 0.00985 0 0 696 B
#5698 StartFinishScope netcoreapp3.1 746ns 0.447ns 1.73ns 0.00939 0 0 696 B
#5698 StartFinishScope net472 871ns 0.833ns 3.22ns 0.105 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 636ns 0.405ns 1.4ns 0.00953 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 911ns 0.409ns 1.53ns 0.00955 0 0 696 B
master RunOnMethodBegin net472 1.1μs 1.49ns 5.79ns 0.104 0 0 658 B
#5698 RunOnMethodBegin net6.0 607ns 0.469ns 1.82ns 0.00978 0 0 696 B
#5698 RunOnMethodBegin netcoreapp3.1 884ns 0.372ns 1.39ns 0.00936 0 0 696 B
#5698 RunOnMethodBegin net472 1.08μs 0.564ns 2.18ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

andrewlock commented Jun 16, 2024

Benchmarks Report for appsec 🐌

Benchmarks for #5698 compared to master:

  • All benchmarks have the same speed
  • 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 - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 70.7μs 116ns 450ns 0.0701 0 0 6 KB
master AllCycleSimpleBody netcoreapp3.1 61.8μs 95.4ns 370ns 0.0926 0 0 6.94 KB
master AllCycleSimpleBody net472 48μs 58.2ns 218ns 1.32 0 0 8.33 KB
master AllCycleMoreComplexBody net6.0 78.6μs 182ns 705ns 0.116 0 0 9.5 KB
master AllCycleMoreComplexBody netcoreapp3.1 68.6μs 49.4ns 191ns 0.103 0 0 10.36 KB
master AllCycleMoreComplexBody net472 55.2μs 77ns 298ns 1.88 0.028 0 11.84 KB
master ObjectExtractorSimpleBody net6.0 143ns 0.1ns 0.376ns 0.00393 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 199ns 0.119ns 0.427ns 0.00369 0 0 272 B
master ObjectExtractorSimpleBody net472 171ns 0.132ns 0.511ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 3μs 1.99ns 7.43ns 0.0523 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.99μs 3.27ns 12.7ns 0.05 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.8μs 2.84ns 10.6ns 0.603 0.00565 0 3.8 KB
#5698 AllCycleSimpleBody net6.0 73.3μs 140ns 544ns 0.0729 0 0 6 KB
#5698 AllCycleSimpleBody netcoreapp3.1 63.1μs 101ns 390ns 0.0949 0 0 6.94 KB
#5698 AllCycleSimpleBody net472 48μs 96.6ns 374ns 1.31 0 0 8.33 KB
#5698 AllCycleMoreComplexBody net6.0 79.1μs 113ns 439ns 0.118 0 0 9.5 KB
#5698 AllCycleMoreComplexBody netcoreapp3.1 70.1μs 86.4ns 335ns 0.14 0 0 10.36 KB
#5698 AllCycleMoreComplexBody net472 55.4μs 83.2ns 322ns 1.88 0.0276 0 11.84 KB
#5698 ObjectExtractorSimpleBody net6.0 143ns 0.107ns 0.413ns 0.00393 0 0 280 B
#5698 ObjectExtractorSimpleBody netcoreapp3.1 195ns 0.184ns 0.689ns 0.00375 0 0 272 B
#5698 ObjectExtractorSimpleBody net472 172ns 0.135ns 0.522ns 0.0446 0 0 281 B
#5698 ObjectExtractorMoreComplexBody net6.0 3μs 1.19ns 4.28ns 0.0527 0 0 3.78 KB
#5698 ObjectExtractorMoreComplexBody netcoreapp3.1 4.03μs 1.94ns 7.26ns 0.0506 0 0 3.69 KB
#5698 ObjectExtractorMoreComplexBody net472 3.8μs 2.34ns 8.75ns 0.603 0.00572 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.7μs 17.6ns 68.3ns 0.455 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.6μs 19.3ns 72.1ns 0.434 0 0 32.4 KB
master EncodeArgs net472 68μs 46.7ns 181ns 5.15 0.0678 0 32.5 KB
master EncodeLegacyArgs net6.0 76.8μs 25.2ns 90.8ns 0.0386 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 105μs 292ns 1.13μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 154μs 119ns 412ns 0.31 0 0 2.15 KB
#5698 EncodeArgs net6.0 37.8μs 26.4ns 102ns 0.453 0 0 32.4 KB
#5698 EncodeArgs netcoreapp3.1 54μs 29.8ns 115ns 0.431 0 0 32.4 KB
#5698 EncodeArgs net472 66.9μs 38.5ns 144ns 5.14 0.0668 0 32.5 KB
#5698 EncodeLegacyArgs net6.0 75.9μs 45ns 174ns 0 0 0 2.14 KB
#5698 EncodeLegacyArgs netcoreapp3.1 104μs 57.3ns 214ns 0 0 0 2.14 KB
#5698 EncodeLegacyArgs net472 155μs 80.8ns 313ns 0.309 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 182μs 99.1ns 384ns 0 0 0 2.42 KB
master RunWafRealisticBenchmark netcoreapp3.1 196μs 321ns 1.24μs 0 0 0 2.37 KB
master RunWafRealisticBenchmark net472 217μs 77.8ns 301ns 0.325 0 0 2.43 KB
master RunWafRealisticBenchmarkWithAttack net6.0 122μs 120ns 447ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 131μs 288ns 1.12μs 0 0 0 1.45 KB
master RunWafRealisticBenchmarkWithAttack net472 142μs 56.8ns 220ns 0.213 0 0 1.48 KB
#5698 RunWafRealisticBenchmark net6.0 182μs 258ns 999ns 0 0 0 2.42 KB
#5698 RunWafRealisticBenchmark netcoreapp3.1 197μs 336ns 1.3μs 0 0 0 2.37 KB
#5698 RunWafRealisticBenchmark net472 217μs 83.7ns 313ns 0.326 0 0 2.43 KB
#5698 RunWafRealisticBenchmarkWithAttack net6.0 122μs 90.3ns 338ns 0 0 0 1.46 KB
#5698 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 68.2ns 255ns 0 0 0 1.45 KB
#5698 RunWafRealisticBenchmarkWithAttack net472 144μs 83.7ns 313ns 0.214 0 0 1.48 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #5698

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 59.04 KB 61.6 KB 2.56 KB 4.34%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 52.5μs 240ns 928ns 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 61.3μs 712ns 7.12μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 38.4μs 173ns 624ns 0 0 0 59.04 KB
master StringConcatAspectBenchmark net6.0 312μs 1.69μs 9.88μs 0 0 0 255.05 KB
master StringConcatAspectBenchmark netcoreapp3.1 335μs 1.87μs 12.4μs 0 0 0 253.78 KB
master StringConcatAspectBenchmark net472 303μs 7.12μs 68.7μs 0 0 0 278.53 KB
#5698 StringConcatBenchmark net6.0 59.2μs 701ns 6.86μs 0 0 0 43.44 KB
#5698 StringConcatBenchmark netcoreapp3.1 62μs 801ns 7.89μs 0 0 0 42.64 KB
#5698 StringConcatBenchmark net472 38.2μs 101ns 377ns 0 0 0 61.6 KB
#5698 StringConcatAspectBenchmark net6.0 309μs 1.69μs 13.1μs 0 0 0 254.74 KB
#5698 StringConcatAspectBenchmark netcoreapp3.1 339μs 1.58μs 13.4μs 0 0 0 253.58 KB
#5698 StringConcatAspectBenchmark net472 295μs 4.98μs 48.3μs 0 0 0 278.53 KB

… GetFullname)

Made MethodInfoi::IsExcluded not lazy

Fix params string formation
@daniel-romano-DD daniel-romano-DD force-pushed the dani/tracer/fix_string_concurrency branch from 288aef4 to 0c4c536 Compare June 16, 2024 09:03
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.

LGTM with a comment :)

WSTRING GetMemberName();
WSTRING GetFullName();
WSTRING& GetName();
WSTRING& GetFullName();
WSTRING GetFullNameWithReturnType();
Copy link
Member

@e-n-0 e-n-0 Jun 17, 2024

Choose a reason for hiding this comment

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

Why does all other functions returning WSTRING changed to WSTRING& but not the GetFullNameWithReturnType() one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's calculated and not returning a field

@daniel-romano-DD daniel-romano-DD merged commit 37bbc2f into master Jun 19, 2024
63 checks passed
@daniel-romano-DD daniel-romano-DD deleted the dani/tracer/fix_string_concurrency branch June 19, 2024 09:54
@github-actions github-actions bot added this to the vNext-v2 milestone Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) identified-by:crashtracking type:bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants