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

[APM] Made native definition lists temporary #6417

Merged
merged 7 commits into from
Dec 13, 2024

Conversation

daniel-romano-DD
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD commented Dec 10, 2024

Summary of changes

Move native definitions from a permanent list to a temporary one that gets created and freed on demand

Reason for change

Some crashes were reported in shutdown and it points to definition lists cleanup

Implementation details

Instead of storing the lists as static fields, they get created in the call to GetCallSites and GetCallTargets and destroyed right after they've been read by the profiler

Test coverage

Other details

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Dec 10, 2024

Datadog Report

Branch report: dani/apm/shutdown_crash_fix
Commit report: 120d29d
Test service: dd-trace-dotnet

✅ 0 Failed, 466798 Passed, 3700 Skipped, 33h 41m 20.48s Total Time

@andrewlock
Copy link
Member

andrewlock commented Dec 10, 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 (6417) - mean (69ms)  : 65, 72
     .   : milestone, 69,
    master - mean (68ms)  : 64, 73
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (6417) - mean (983ms)  : 955, 1011
     .   : milestone, 983,
    master - mean (974ms)  : 948, 999
     .   : milestone, 974,

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

    section CallTarget+Inlining+NGEN
    This PR (6417) - mean (676ms)  : 657, 696
     .   : milestone, 676,
    master - mean (674ms)  : 660, 689
     .   : milestone, 674,

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

    section CallTarget+Inlining+NGEN
    This PR (6417) - mean (630ms)  : 617, 644
     .   : milestone, 630,
    master - mean (629ms)  : 614, 644
     .   : milestone, 629,

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

    section CallTarget+Inlining+NGEN
    This PR (6417) - mean (1,097ms)  : 1072, 1122
     .   : milestone, 1097,
    master - mean (1,098ms)  : 1074, 1123
     .   : milestone, 1098,

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

    section CallTarget+Inlining+NGEN
    This PR (6417) - mean (868ms)  : 844, 892
     .   : milestone, 868,
    master - mean (869ms)  : 838, 901
     .   : milestone, 869,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6417) - mean (267ms)  : 263, 271
     .   : milestone, 267,
    master - mean (266ms)  : 262, 271
     .   : milestone, 266,

    section CallTarget+Inlining+NGEN
    This PR (6417) - mean (856ms)  : 819, 892
     .   : milestone, 856,
    master - mean (850ms)  : 811, 890
     .   : milestone, 850,

Loading

@andrewlock
Copy link
Member

andrewlock commented Dec 10, 2024

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 (6417) (11.255M)   : 0, 11254728
    master (11.195M)   : 0, 11194535
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6417) (7.264M)   : 0, 7263509
    master (7.216M)   : 0, 7216361
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.611M)   : 0, 7610504

    section Manual
    master (11.163M)   : 0, 11162548

    section Manual + Automatic
    This PR (6417) (6.636M)   : 0, 6635630
    master (6.753M)   : 0, 6752572

    section DD_TRACE_ENABLED=0
    master (10.216M)   : 0, 10215642

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6417) (9.598M)   : 0, 9598145
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6417) (6.313M)   : 0, 6313449

    section Manual + Automatic
    This PR (6417) (5.834M)   : 0, 5833698

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6417) (9.110M)   : 0, 9109599
    master (9.988M)   : 0, 9987589
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6417) (6.095M)   : 0, 6095198
    master (6.338M)   : 0, 6338249
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (7.137M)   : 0, 7136842

    section Manual
    master (9.965M)   : 0, 9965094

    section Manual + Automatic
    This PR (6417) (5.568M)   : 0, 5567736
    master (5.791M)   : 0, 5790893

    section DD_TRACE_ENABLED=0
    master (9.274M)   : 0, 9274318

Loading

@andrewlock
Copy link
Member

andrewlock commented Dec 11, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6417 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.147
  • 1 benchmarks are slower, with geometric mean 1.155
  • 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μs 44.8ns 297ns 0.0159 0.00794 0 5.61 KB
master StartStopWithChild netcoreapp3.1 9.82μs 47.8ns 203ns 0.0242 0.00969 0 5.8 KB
master StartStopWithChild net472 16.2μs 49.4ns 191ns 1.04 0.3 0.0974 6.21 KB
#6417 StartStopWithChild net6.0 8.07μs 40.6ns 325ns 0.0195 0.00781 0 5.61 KB
#6417 StartStopWithChild netcoreapp3.1 10.3μs 55.6ns 289ns 0.021 0.0105 0 5.81 KB
#6417 StartStopWithChild net472 16.6μs 64ns 248ns 1.04 0.318 0.0979 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 480μs 735ns 2.85μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 647μs 309ns 1.2μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 853μs 419ns 1.62μs 0.425 0 0 3.3 KB
#6417 WriteAndFlushEnrichedTraces net6.0 499μs 425ns 1.59μs 0 0 0 2.7 KB
#6417 WriteAndFlushEnrichedTraces netcoreapp3.1 653μs 510ns 1.97μs 0 0 0 2.7 KB
#6417 WriteAndFlushEnrichedTraces net472 854μs 632ns 2.37μs 0.422 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 150μs 900ns 8.91μs 0.136 0 0 14.47 KB
master SendRequest netcoreapp3.1 169μs 1.02μs 9.81μs 0.181 0 0 17.27 KB
master SendRequest net472 0.00166ns 0.000575ns 0.00215ns 0 0 0 0 b
#6417 SendRequest net6.0 156μs 1.01μs 9.84μs 0.145 0 0 14.48 KB
#6417 SendRequest netcoreapp3.1 180μs 1.55μs 15.5μs 0.179 0 0 17.27 KB
#6417 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 570μs 3.09μs 18μs 0.579 0 0 41.64 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 677μs 3.69μs 21.2μs 0.347 0 0 41.78 KB
master WriteAndFlushEnrichedTraces net472 833μs 3.19μs 11.9μs 8.33 2.5 0.417 53.26 KB
#6417 WriteAndFlushEnrichedTraces net6.0 570μs 2.76μs 13.5μs 0.607 0 0 41.68 KB
#6417 WriteAndFlushEnrichedTraces netcoreapp3.1 669μs 3.4μs 15.2μs 0.326 0 0 41.89 KB
#6417 WriteAndFlushEnrichedTraces net472 860μs 3.2μs 12.4μs 8.13 2.57 0.428 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.3μs 0.717ns 2.78ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.76μs 1.82ns 7.04ns 0.0139 0 0 1.02 KB
master ExecuteNonQuery net472 2.01μs 1.64ns 6.34ns 0.156 0.00101 0 987 B
#6417 ExecuteNonQuery net6.0 1.34μs 1.31ns 5.09ns 0.0142 0 0 1.02 KB
#6417 ExecuteNonQuery netcoreapp3.1 1.77μs 1.17ns 4.37ns 0.0135 0 0 1.02 KB
#6417 ExecuteNonQuery net472 2.12μs 2.83ns 11ns 0.157 0.00105 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.27μs 0.541ns 2.1ns 0.0133 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.59μs 0.682ns 2.64ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.59μs 1.04ns 3.88ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.39μs 0.653ns 2.53ns 0.0132 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.74μs 0.608ns 2.27ns 0.0139 0 0 1.02 KB
master CallElasticsearchAsync net472 2.58μs 0.841ns 3.15ns 0.167 0 0 1.05 KB
#6417 CallElasticsearch net6.0 1.24μs 0.557ns 2.16ns 0.0138 0 0 976 B
#6417 CallElasticsearch netcoreapp3.1 1.6μs 0.624ns 2.33ns 0.0135 0 0 976 B
#6417 CallElasticsearch net472 2.5μs 1.21ns 4.69ns 0.158 0 0 995 B
#6417 CallElasticsearchAsync net6.0 1.4μs 0.779ns 3.02ns 0.0134 0 0 952 B
#6417 CallElasticsearchAsync netcoreapp3.1 1.68μs 0.439ns 1.7ns 0.0135 0 0 1.02 KB
#6417 CallElasticsearchAsync net472 2.61μs 1.52ns 5.89ns 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 3.72ns 14.4ns 0.0129 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.72μs 0.578ns 2.16ns 0.0129 0 0 952 B
master ExecuteAsync net472 1.79μs 0.544ns 1.96ns 0.145 0 0 915 B
#6417 ExecuteAsync net6.0 1.36μs 0.702ns 2.72ns 0.0136 0 0 952 B
#6417 ExecuteAsync netcoreapp3.1 1.68μs 0.941ns 3.39ns 0.0125 0 0 952 B
#6417 ExecuteAsync net472 1.81μs 0.61ns 2.28ns 0.144 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.37μs 1.03ns 3.99ns 0.0326 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.27μs 2.36ns 9.13ns 0.0396 0 0 2.85 KB
master SendAsync net472 7.34μs 1.57ns 5.87ns 0.495 0 0 3.12 KB
#6417 SendAsync net6.0 4.42μs 7.04ns 27.3ns 0.0307 0 0 2.31 KB
#6417 SendAsync netcoreapp3.1 5.21μs 0.885ns 3.31ns 0.0392 0 0 2.85 KB
#6417 SendAsync net472 7.44μs 1.63ns 6.11ns 0.495 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.48μs 2.98ns 11.6ns 0.0234 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.2μs 1.92ns 7.43ns 0.022 0 0 1.64 KB
master EnrichedLog net472 2.71μs 1.8ns 6.48ns 0.249 0 0 1.57 KB
#6417 EnrichedLog net6.0 1.54μs 0.407ns 1.52ns 0.0231 0 0 1.64 KB
#6417 EnrichedLog netcoreapp3.1 2.19μs 1.17ns 4.52ns 0.0221 0 0 1.64 KB
#6417 EnrichedLog net472 2.67μs 2.66ns 9.97ns 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 269ns 1.04μs 0.0594 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 124μs 258ns 1μs 0 0 0 4.28 KB
master EnrichedLog net472 151μs 250ns 970ns 0.669 0.223 0 4.46 KB
#6417 EnrichedLog net6.0 122μs 238ns 921ns 0.0609 0 0 4.28 KB
#6417 EnrichedLog netcoreapp3.1 122μs 159ns 573ns 0 0 0 4.28 KB
#6417 EnrichedLog net472 152μs 184ns 714ns 0.678 0.226 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.13μs 1.35ns 5.22ns 0.0312 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.18μs 2.66ns 10.3ns 0.0291 0 0 2.2 KB
master EnrichedLog net472 4.9μs 0.728ns 2.72ns 0.319 0 0 2.02 KB
#6417 EnrichedLog net6.0 3.05μs 1.07ns 4ns 0.0305 0 0 2.2 KB
#6417 EnrichedLog netcoreapp3.1 4.2μs 1.92ns 7.2ns 0.0295 0 0 2.2 KB
#6417 EnrichedLog net472 5.02μs 1.34ns 5.03ns 0.318 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6417

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 1.155 1,318.88 1,522.81

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.32μs 1.55ns 5.98ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.83μs 1.73ns 6.7ns 0.0153 0 0 1.14 KB
master SendReceive net472 2.11μs 1.3ns 5.03ns 0.184 0 0 1.16 KB
#6417 SendReceive net6.0 1.52μs 1.24ns 4.8ns 0.016 0 0 1.14 KB
#6417 SendReceive netcoreapp3.1 1.75μs 4.75ns 18.4ns 0.0156 0 0 1.14 KB
#6417 SendReceive net472 2.12μs 1.67ns 6.27ns 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.74μs 2.57ns 9.95ns 0.022 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.81μs 1.28ns 4.78ns 0.021 0 0 1.65 KB
master EnrichedLog net472 4.44μs 0.633ns 2.19ns 0.324 0 0 2.04 KB
#6417 EnrichedLog net6.0 2.66μs 1.02ns 3.96ns 0.0226 0 0 1.6 KB
#6417 EnrichedLog netcoreapp3.1 3.79μs 2.59ns 9.35ns 0.0211 0 0 1.65 KB
#6417 EnrichedLog net472 4.38μs 1.88ns 7.3ns 0.323 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6417

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.147 559.56 487.75

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 398ns 0.261ns 0.977ns 0.00814 0 0 576 B
master StartFinishSpan netcoreapp3.1 589ns 0.702ns 2.72ns 0.00767 0 0 576 B
master StartFinishSpan net472 649ns 0.436ns 1.69ns 0.0918 0 0 578 B
master StartFinishScope net6.0 560ns 0.241ns 0.901ns 0.00982 0 0 696 B
master StartFinishScope netcoreapp3.1 723ns 0.791ns 3.06ns 0.0094 0 0 696 B
master StartFinishScope net472 875ns 0.528ns 2.04ns 0.104 0 0 658 B
#6417 StartFinishSpan net6.0 392ns 0.347ns 1.34ns 0.00815 0 0 576 B
#6417 StartFinishSpan netcoreapp3.1 624ns 0.889ns 3.44ns 0.00777 0 0 576 B
#6417 StartFinishSpan net472 680ns 0.873ns 3.38ns 0.0915 0 0 578 B
#6417 StartFinishScope net6.0 488ns 0.464ns 1.74ns 0.0098 0 0 696 B
#6417 StartFinishScope netcoreapp3.1 705ns 0.756ns 2.93ns 0.00924 0 0 696 B
#6417 StartFinishScope net472 815ns 0.941ns 3.64ns 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 609ns 0.524ns 2.03ns 0.00977 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 927ns 0.491ns 1.9ns 0.00934 0 0 696 B
master RunOnMethodBegin net472 1.12μs 1.19ns 4.47ns 0.104 0 0 658 B
#6417 RunOnMethodBegin net6.0 608ns 0.181ns 0.678ns 0.00973 0 0 696 B
#6417 RunOnMethodBegin netcoreapp3.1 960ns 0.454ns 1.76ns 0.00908 0 0 696 B
#6417 RunOnMethodBegin net472 1.16μs 0.632ns 2.28ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

andrewlock commented Dec 11, 2024

Benchmarks Report for appsec 🐌

Benchmarks for #6417 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.163
  • 1 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 - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6417

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody‑netcoreapp3.1 1.163 229.02 197.00

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 187μs 117ns 437ns 2.62 0 0 188.52 KB
master AllCycleSimpleBody netcoreapp3.1 281μs 159ns 597ns 2.66 0 0 195.8 KB
master AllCycleSimpleBody net472 250μs 153ns 574ns 35.8 2 0 225.32 KB
master AllCycleMoreComplexBody net6.0 189μs 80.4ns 290ns 2.74 0 0 192.02 KB
master AllCycleMoreComplexBody netcoreapp3.1 298μs 639ns 2.48μs 2.63 0 0 199.22 KB
master AllCycleMoreComplexBody net472 254μs 425ns 1.64μs 36.4 2.02 0 228.83 KB
master ObjectExtractorSimpleBody net6.0 138ns 0.184ns 0.69ns 0.00394 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 229ns 0.339ns 1.31ns 0.00366 0 0 272 B
master ObjectExtractorSimpleBody net472 163ns 0.264ns 1.02ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.89μs 1.4ns 5.22ns 0.0522 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 3.73μs 3.7ns 13.8ns 0.0508 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 3.6μs 2.19ns 8.18ns 0.603 0.00543 0 3.8 KB
#6417 AllCycleSimpleBody net6.0 202μs 47.3ns 164ns 2.61 0 0 188.38 KB
#6417 AllCycleSimpleBody netcoreapp3.1 312μs 154ns 578ns 2.64 0 0 195.66 KB
#6417 AllCycleSimpleBody net472 270μs 336ns 1.3μs 35.7 2 0 225.16 KB
#6417 AllCycleMoreComplexBody net6.0 209μs 114ns 427ns 2.71 0 0 191.88 KB
#6417 AllCycleMoreComplexBody netcoreapp3.1 319μs 119ns 443ns 2.71 0 0 199.07 KB
#6417 AllCycleMoreComplexBody net472 274μs 222ns 860ns 36.3 2.06 0 228.67 KB
#6417 ObjectExtractorSimpleBody net6.0 145ns 0.164ns 0.613ns 0.00394 0 0 280 B
#6417 ObjectExtractorSimpleBody netcoreapp3.1 199ns 0.917ns 3.55ns 0.00375 0 0 272 B
#6417 ObjectExtractorSimpleBody net472 162ns 0.208ns 0.805ns 0.0446 0 0 281 B
#6417 ObjectExtractorMoreComplexBody net6.0 2.91μs 1.56ns 6.04ns 0.0536 0 0 3.78 KB
#6417 ObjectExtractorMoreComplexBody netcoreapp3.1 3.75μs 2.92ns 11.3ns 0.0506 0 0 3.69 KB
#6417 ObjectExtractorMoreComplexBody net472 3.61μs 5.27ns 20.4ns 0.602 0.00539 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.2μs 26.4ns 98.6ns 0.445 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 54.7μs 56.4ns 219ns 0.432 0 0 32.4 KB
master EncodeArgs net472 67.7μs 43.1ns 161ns 5.16 0.067 0 32.5 KB
master EncodeLegacyArgs net6.0 74.2μs 107ns 416ns 0 0 0 2.14 KB
master EncodeLegacyArgs netcoreapp3.1 104μs 163ns 630ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 154μs 128ns 497ns 0.306 0 0 2.15 KB
#6417 EncodeArgs net6.0 40.2μs 24.9ns 96.4ns 0.456 0 0 32.4 KB
#6417 EncodeArgs netcoreapp3.1 53.9μs 19.7ns 76.3ns 0.431 0 0 32.4 KB
#6417 EncodeArgs net472 68.4μs 52ns 195ns 5.16 0.0679 0 32.5 KB
#6417 EncodeLegacyArgs net6.0 73μs 52.3ns 196ns 0 0 0 2.14 KB
#6417 EncodeLegacyArgs netcoreapp3.1 106μs 146ns 567ns 0 0 0 2.14 KB
#6417 EncodeLegacyArgs net472 153μs 117ns 455ns 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 181μs 84ns 291ns 0 0 0 2.44 KB
master RunWafRealisticBenchmark netcoreapp3.1 192μs 249ns 964ns 0 0 0 2.39 KB
master RunWafRealisticBenchmark net472 209μs 180ns 696ns 0.309 0 0 2.46 KB
master RunWafRealisticBenchmarkWithAttack net6.0 122μs 119ns 461ns 0 0 0 1.47 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 129μs 162ns 583ns 0 0 0 1.46 KB
master RunWafRealisticBenchmarkWithAttack net472 139μs 56.6ns 219ns 0.209 0 0 1.49 KB
#6417 RunWafRealisticBenchmark net6.0 182μs 134ns 517ns 0 0 0 2.44 KB
#6417 RunWafRealisticBenchmark netcoreapp3.1 196μs 312ns 1.21μs 0 0 0 2.39 KB
#6417 RunWafRealisticBenchmark net472 206μs 47.2ns 176ns 0.309 0 0 2.46 KB
#6417 RunWafRealisticBenchmarkWithAttack net6.0 122μs 46.1ns 179ns 0 0 0 1.47 KB
#6417 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 130μs 146ns 565ns 0 0 0 1.46 KB
#6417 RunWafRealisticBenchmarkWithAttack net472 139μs 45.8ns 171ns 0.208 0 0 1.49 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #6417

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 61.66 KB 62.06 KB 400 B 0.65%

Fewer allocations 🎉 in #6417

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 257.94 KB 254.62 KB -3.32 KB -1.29%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 52.3μs 249ns 932ns 0 0 0 43.44 KB
master StringConcatBenchmark netcoreapp3.1 53.4μs 176ns 660ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 36.4μs 80.4ns 290ns 0 0 0 61.66 KB
master StringConcatAspectBenchmark net6.0 310μs 1.09μs 3.92μs 0 0 0 257.94 KB
master StringConcatAspectBenchmark netcoreapp3.1 333μs 1.74μs 9.37μs 0 0 0 253.05 KB
master StringConcatAspectBenchmark net472 284μs 6.2μs 59.5μs 0 0 0 278.53 KB
#6417 StringConcatBenchmark net6.0 59.2μs 693ns 6.9μs 0 0 0 43.44 KB
#6417 StringConcatBenchmark netcoreapp3.1 54.6μs 262ns 1.05μs 0 0 0 42.64 KB
#6417 StringConcatBenchmark net472 37μs 79ns 296ns 0 0 0 62.06 KB
#6417 StringConcatAspectBenchmark net6.0 335μs 5.98μs 57.6μs 0 0 0 254.62 KB
#6417 StringConcatAspectBenchmark netcoreapp3.1 334μs 1.68μs 8.04μs 0 0 0 253.05 KB
#6417 StringConcatAspectBenchmark net472 293μs 7.45μs 72.3μs 0 0 0 278.53 KB

@daniel-romano-DD daniel-romano-DD changed the title Emptied definition lists on exit [APM] Made native definition lists temporary Dec 12, 2024
@daniel-romano-DD daniel-romano-DD marked this pull request as ready for review December 12, 2024 14:26
@daniel-romano-DD daniel-romano-DD requested review from a team as code owners December 12, 2024 14:26
@daniel-romano-DD daniel-romano-DD force-pushed the dani/apm/shutdown_crash_fix branch from a4a1e54 to c7d4b46 Compare December 12, 2024 14:51
Copy link
Contributor

@link04 link04 left a comment

Choose a reason for hiding this comment

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

TY!

@daniel-romano-DD daniel-romano-DD force-pushed the dani/apm/shutdown_crash_fix branch from 7b913f7 to 120d29d Compare December 13, 2024 16:31
Copy link
Contributor

@NachoEchevarria NachoEchevarria left a comment

Choose a reason for hiding this comment

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

LGTM!

@link04 link04 merged commit 0d9393d into master Dec 13, 2024
108 of 110 checks passed
@link04 link04 deleted the dani/apm/shutdown_crash_fix branch December 13, 2024 19:16
@github-actions github-actions bot added this to the vNext-v3 milestone Dec 13, 2024
veerbia pushed a commit that referenced this pull request Dec 16, 2024
## Summary of changes
Move native definitions from a permanent list to a temporary one that
gets created and freed on demand

## Reason for change
Some crashes were reported in shutdown and it points to definition lists
cleanup

## Implementation details
Instead of storing the lists as static fields, they get created in the
call to GetCallSites and GetCallTargets and destroyed right after
they've been read by the profiler

## Test coverage

## Other details
<!-- Fixes #{issue} -->

<!-- ⚠️ Note: where possible, please obtain 2 approvals prior to
merging. Unless CODEOWNERS specifies otherwise, for external teams it is
typically best to have one review from a team member, and one review
from apm-dotnet. Trivial changes do not require 2 reviews. -->
@andrewlock andrewlock added area:automatic-instrumentation Automatic instrumentation managed C# code (Datadog.Trace.ClrProfiler.Managed) area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) type:reliability labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:automatic-instrumentation Automatic instrumentation managed C# code (Datadog.Trace.ClrProfiler.Managed) area:native-library Automatic instrumentation native C++ code (Datadog.Trace.ClrProfiler.Native) area:shared-components type:reliability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants