-
Notifications
You must be signed in to change notification settings - Fork 142
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] Native CallTarget definitions #6252
base: dani/apm/NativeCallSites
Are you sure you want to change the base?
[ASM] Native CallTarget definitions #6252
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
44a2ea4
to
80ad64c
Compare
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:
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 (6252) - mean (72ms) : 64, 79
. : milestone, 72,
master - mean (72ms) : 64, 80
. : milestone, 72,
section CallTarget+Inlining+NGEN
This PR (6252) - mean (988ms) : 961, 1015
. : milestone, 988,
master - mean (1,107ms) : 1088, 1127
. : milestone, 1107,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6252) - mean (109ms) : 106, 111
. : milestone, 109,
master - mean (107ms) : 105, 110
. : milestone, 107,
section CallTarget+Inlining+NGEN
This PR (6252) - mean (686ms) : 670, 701
. : milestone, 686,
master - mean (767ms) : 746, 787
. : milestone, 767,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6252) - mean (92ms) : 90, 93
. : milestone, 92,
master - mean (92ms) : 90, 94
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6252) - mean (635ms) : 619, 650
. : milestone, 635,
master - mean (722ms) : 711, 733
. : milestone, 722,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6252) - mean (191ms) : 186, 195
. : milestone, 191,
master - mean (190ms) : 185, 196
. : milestone, 190,
section CallTarget+Inlining+NGEN
This PR (6252) - mean (1,097ms) : 1071, 1124
. : milestone, 1097,
master - mean (1,212ms) : 1193, 1232
. : milestone, 1212,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6252) - mean (276ms) : 272, 280
. : milestone, 276,
master - mean (276ms) : 272, 280
. : milestone, 276,
section CallTarget+Inlining+NGEN
This PR (6252) - mean (872ms) : 844, 900
. : milestone, 872,
master - mean (946ms) : 923, 969
. : milestone, 946,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6252) - mean (265ms) : 260, 270
. : milestone, 265,
master - mean (265ms) : 260, 270
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6252) - mean (851ms) : 817, 884
. : milestone, 851,
master - mean (926ms) : 910, 942
. : milestone, 926,
|
Benchmarks Report for tracer 🐌Benchmarks for #6252 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Faster 🎉 Fewer allocations 🎉
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑net6.0 | 1.348 | 196,032.01 | 145,463.02 | |
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 | 1.279 | 220,789.94 | 172,577.77 | several? |
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 | 20.89 KB | 17.27 KB | -3.62 KB | -17.32% |
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑net6.0 | 18.73 KB | 14.47 KB | -4.26 KB | -22.73% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendRequest |
net6.0 | 197μs | 1.13μs | 8.13μs | 0.198 | 0 | 0 | 18.73 KB |
master | SendRequest |
netcoreapp3.1 | 222μs | 1.18μs | 9μs | 0.206 | 0 | 0 | 20.89 KB |
master | SendRequest |
net472 | 0.00052ns | 0.000242ns | 0.000907ns | 0 | 0 | 0 | 0 b |
#6252 | SendRequest |
net6.0 | 146μs | 822ns | 5.27μs | 0.147 | 0 | 0 | 14.47 KB |
#6252 | SendRequest |
netcoreapp3.1 | 175μs | 1.02μs | 9.66μs | 0.173 | 0 | 0 | 17.27 KB |
#6252 | SendRequest |
net472 | 0.00196ns | 0.000674ns | 0.00261ns | 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 | 575μs | 2.78μs | 13μs | 0.579 | 0 | 0 | 41.55 KB |
master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 675μs | 3.17μs | 12.3μs | 0.324 | 0 | 0 | 41.87 KB |
master | WriteAndFlushEnrichedTraces |
net472 | 858μs | 3.67μs | 14.2μs | 8.39 | 2.52 | 0.419 | 53.29 KB |
#6252 | WriteAndFlushEnrichedTraces |
net6.0 | 558μs | 2.51μs | 10.6μs | 0.568 | 0 | 0 | 41.46 KB |
#6252 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 690μs | 3.44μs | 20.1μs | 0.381 | 0 | 0 | 41.82 KB |
#6252 | WriteAndFlushEnrichedTraces |
net472 | 850μs | 2.84μs | 11μs | 8.13 | 2.57 | 0.428 | 53.26 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.31ns | 5.06ns | 0.0146 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.73μs | 1.3ns | 4.69ns | 0.0139 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
net472 | 2.01μs | 1.54ns | 5.96ns | 0.156 | 0.00101 | 0 | 987 B |
#6252 | ExecuteNonQuery |
net6.0 | 1.33μs | 1.09ns | 4.23ns | 0.0147 | 0 | 0 | 1.02 KB |
#6252 | ExecuteNonQuery |
netcoreapp3.1 | 1.79μs | 1.28ns | 4.79ns | 0.0134 | 0 | 0 | 1.02 KB |
#6252 | ExecuteNonQuery |
net472 | 2.01μs | 1.72ns | 6.67ns | 0.157 | 0.001 | 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.15μs | 0.379ns | 1.42ns | 0.0138 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.49μs | 0.517ns | 1.93ns | 0.0134 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.48μs | 1.06ns | 3.95ns | 0.157 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.28μs | 0.475ns | 1.78ns | 0.0134 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.66μs | 0.8ns | 3.1ns | 0.0133 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.63μs | 0.664ns | 2.39ns | 0.166 | 0 | 0 | 1.05 KB |
#6252 | CallElasticsearch |
net6.0 | 1.25μs | 0.99ns | 3.7ns | 0.0137 | 0 | 0 | 976 B |
#6252 | CallElasticsearch |
netcoreapp3.1 | 1.61μs | 0.717ns | 2.78ns | 0.0129 | 0 | 0 | 976 B |
#6252 | CallElasticsearch |
net472 | 2.54μs | 1.04ns | 4.05ns | 0.158 | 0 | 0 | 995 B |
#6252 | CallElasticsearchAsync |
net6.0 | 1.31μs | 1.02ns | 3.83ns | 0.0131 | 0 | 0 | 952 B |
#6252 | CallElasticsearchAsync |
netcoreapp3.1 | 1.65μs | 0.602ns | 2.25ns | 0.014 | 0 | 0 | 1.02 KB |
#6252 | CallElasticsearchAsync |
net472 | 2.6μs | 1.51ns | 5.84ns | 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.15μs | 0.63ns | 2.36ns | 0.0132 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.73μs | 0.229ns | 0.857ns | 0.0129 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.84μs | 0.377ns | 1.36ns | 0.145 | 0 | 0 | 915 B |
#6252 | ExecuteAsync |
net6.0 | 1.14μs | 1.3ns | 5.03ns | 0.0133 | 0 | 0 | 952 B |
#6252 | ExecuteAsync |
netcoreapp3.1 | 1.66μs | 1.24ns | 4.8ns | 0.0126 | 0 | 0 | 952 B |
#6252 | ExecuteAsync |
net472 | 1.81μs | 0.782ns | 2.93ns | 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.47μs | 1.08ns | 4.04ns | 0.0314 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.15μs | 1.92ns | 7.17ns | 0.0385 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.35μs | 1.79ns | 6.94ns | 0.495 | 0 | 0 | 3.12 KB |
#6252 | SendAsync |
net6.0 | 4.32μs | 1.68ns | 6.3ns | 0.0316 | 0 | 0 | 2.31 KB |
#6252 | SendAsync |
netcoreapp3.1 | 5.47μs | 2.53ns | 9.81ns | 0.0382 | 0 | 0 | 2.85 KB |
#6252 | SendAsync |
net472 | 7.24μs | 1.94ns | 7.53ns | 0.496 | 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.54μs | 2.82ns | 10.9ns | 0.0229 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.35μs | 1.44ns | 5.38ns | 0.0224 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.69μs | 2.11ns | 8.17ns | 0.25 | 0 | 0 | 1.57 KB |
#6252 | EnrichedLog |
net6.0 | 1.59μs | 0.752ns | 2.81ns | 0.0231 | 0 | 0 | 1.64 KB |
#6252 | EnrichedLog |
netcoreapp3.1 | 2.29μs | 1.22ns | 4.57ns | 0.0227 | 0 | 0 | 1.64 KB |
#6252 | EnrichedLog |
net472 | 2.59μs | 1.11ns | 4.29ns | 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 | 103ns | 400ns | 0.0599 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 125μs | 107ns | 386ns | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 152μs | 137ns | 532ns | 0.681 | 0.227 | 0 | 4.46 KB |
#6252 | EnrichedLog |
net6.0 | 118μs | 202ns | 784ns | 0.059 | 0 | 0 | 4.28 KB |
#6252 | EnrichedLog |
netcoreapp3.1 | 124μs | 170ns | 657ns | 0 | 0 | 0 | 4.28 KB |
#6252 | EnrichedLog |
net472 | 151μs | 122ns | 471ns | 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.23μs | 0.93ns | 3.6ns | 0.0313 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.18μs | 1.33ns | 5.13ns | 0.0293 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.89μs | 2.3ns | 8.61ns | 0.32 | 0 | 0 | 2.02 KB |
#6252 | EnrichedLog |
net6.0 | 3.05μs | 1.57ns | 6.07ns | 0.0304 | 0 | 0 | 2.2 KB |
#6252 | EnrichedLog |
netcoreapp3.1 | 4.24μs | 1.6ns | 6.21ns | 0.0297 | 0 | 0 | 2.2 KB |
#6252 | EnrichedLog |
net472 | 4.96μs | 1.65ns | 6.4ns | 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 | 1.72ns | 6.66ns | 0.0157 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.83μs | 1.26ns | 4.71ns | 0.0155 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.02μs | 1.06ns | 3.67ns | 0.183 | 0 | 0 | 1.16 KB |
#6252 | SendReceive |
net6.0 | 1.34μs | 0.848ns | 3.29ns | 0.016 | 0 | 0 | 1.14 KB |
#6252 | SendReceive |
netcoreapp3.1 | 1.8μs | 0.737ns | 2.85ns | 0.0152 | 0 | 0 | 1.14 KB |
#6252 | SendReceive |
net472 | 2.11μs | 0.673ns | 2.61ns | 0.184 | 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.62μs | 0.737ns | 2.86ns | 0.0221 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.93μs | 2.07ns | 8.02ns | 0.0216 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.46μs | 2.62ns | 10.1ns | 0.323 | 0 | 0 | 2.04 KB |
#6252 | EnrichedLog |
net6.0 | 2.7μs | 1.24ns | 4.65ns | 0.023 | 0 | 0 | 1.6 KB |
#6252 | EnrichedLog |
netcoreapp3.1 | 3.94μs | 2.62ns | 10.2ns | 0.0214 | 0 | 0 | 1.65 KB |
#6252 | EnrichedLog |
net472 | 4.39μs | 2.16ns | 8.07ns | 0.323 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #6252
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1
1.185
799.13
674.30
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 | 1.185 | 799.13 | 674.30 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 398ns | 0.233ns | 0.903ns | 0.00805 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 561ns | 0.48ns | 1.86ns | 0.00776 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 621ns | 0.231ns | 0.893ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 501ns | 0.409ns | 1.58ns | 0.00978 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 799ns | 0.426ns | 1.65ns | 0.0095 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 908ns | 0.452ns | 1.75ns | 0.104 | 0 | 0 | 658 B |
#6252 | StartFinishSpan |
net6.0 | 424ns | 0.356ns | 1.38ns | 0.00814 | 0 | 0 | 576 B |
#6252 | StartFinishSpan |
netcoreapp3.1 | 546ns | 0.574ns | 2.22ns | 0.00792 | 0 | 0 | 576 B |
#6252 | StartFinishSpan |
net472 | 649ns | 1.4ns | 5.03ns | 0.0917 | 0 | 0 | 578 B |
#6252 | StartFinishScope |
net6.0 | 498ns | 0.388ns | 1.5ns | 0.00983 | 0 | 0 | 696 B |
#6252 | StartFinishScope |
netcoreapp3.1 | 674ns | 0.537ns | 2.01ns | 0.00938 | 0 | 0 | 696 B |
#6252 | StartFinishScope |
net472 | 868ns | 0.725ns | 2.81ns | 0.105 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6252
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0
1.134
602.41
682.94
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 1.134 | 602.41 | 682.94 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 602ns | 0.221ns | 0.855ns | 0.00987 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 975ns | 0.49ns | 1.83ns | 0.00927 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.18μs | 0.483ns | 1.87ns | 0.104 | 0 | 0 | 658 B |
#6252 | RunOnMethodBegin |
net6.0 | 683ns | 0.428ns | 1.66ns | 0.00994 | 0 | 0 | 696 B |
#6252 | RunOnMethodBegin |
netcoreapp3.1 | 961ns | 3.84ns | 14.4ns | 0.00945 | 0 | 0 | 696 B |
#6252 | RunOnMethodBegin |
net472 | 1.17μs | 1.1ns | 4.11ns | 0.104 | 0 | 0 | 658 B |
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 (6252) (11.114M) : 0, 11114362
master (11.197M) : 0, 11197381
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6252) (7.264M) : 0, 7263739
master (7.192M) : 0, 7192384
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.476M) : 0, 7475872
section Manual
master (11.271M) : 0, 11270878
section Manual + Automatic
This PR (6252) (6.603M) : 0, 6603211
master (6.621M) : 0, 6620931
section DD_TRACE_ENABLED=0
master (10.177M) : 0, 10176556
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6252) (9.404M) : 0, 9403660
master (9.640M) : 0, 9639769
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6252) (6.459M) : 0, 6458527
master (6.385M) : 0, 6384570
section Trace stats
master (6.740M) : 0, 6739552
section Manual
master (9.612M) : 0, 9611974
section Manual + Automatic
This PR (6252) (5.983M) : 0, 5982868
master (5.891M) : 0, 5890550
section DD_TRACE_ENABLED=0
master (8.839M) : 0, 8838985
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6252) (10.052M) : 0, 10052259
master (10.121M) : 0, 10120763
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6252) (6.619M) : 0, 6618774
master (6.469M) : 0, 6469072
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (6.864M) : 0, 6863851
section Manual
master (9.854M) : 0, 9854162
section Manual + Automatic
This PR (6252) (6.288M) : 0, 6288423
master (5.906M) : 0, 5906154
section DD_TRACE_ENABLED=0
master (9.224M) : 0, 9224050
|
Datadog ReportBranch report: ❌ 6 Failed (0 Known Flaky), 571041 Passed, 4731 Skipped, 47h 1m 8.18s Total Time ❌ Failed Tests (6)
|
c803d7d
to
afed6e3
Compare
Benchmarks Report for appsec 🐌Benchmarks for #6252 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations
|
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 | 272.91 KB | 278.53 KB | 5.62 KB | 2.06% |
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 255.27 KB | 253.38 KB | -1.89 KB | -0.74% |
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 60.49 KB | 59.04 KB | -1.45 KB | -2.39% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StringConcatBenchmark |
net6.0 | 52.9μs | 209ns | 782ns | 0 | 0 | 0 | 43.44 KB |
master | StringConcatBenchmark |
netcoreapp3.1 | 54.2μs | 287ns | 1.38μs | 0 | 0 | 0 | 42.64 KB |
master | StringConcatBenchmark |
net472 | 38μs | 165ns | 616ns | 0 | 0 | 0 | 60.49 KB |
master | StringConcatAspectBenchmark |
net6.0 | 295μs | 4.71μs | 43.7μs | 0 | 0 | 0 | 253.95 KB |
master | StringConcatAspectBenchmark |
netcoreapp3.1 | 354μs | 1.97μs | 12.1μs | 0 | 0 | 0 | 255.27 KB |
master | StringConcatAspectBenchmark |
net472 | 278μs | 6.14μs | 58.9μs | 0 | 0 | 0 | 272.91 KB |
#6252 | StringConcatBenchmark |
net6.0 | 61.1μs | 769ns | 7.53μs | 0 | 0 | 0 | 43.44 KB |
#6252 | StringConcatBenchmark |
netcoreapp3.1 | 62.5μs | 869ns | 8.65μs | 0 | 0 | 0 | 42.64 KB |
#6252 | StringConcatBenchmark |
net472 | 37.6μs | 119ns | 429ns | 0 | 0 | 0 | 59.04 KB |
#6252 | StringConcatAspectBenchmark |
net6.0 | 310μs | 1.41μs | 5.46μs | 0 | 0 | 0 | 255.08 KB |
#6252 | StringConcatAspectBenchmark |
netcoreapp3.1 | 334μs | 1.7μs | 10.9μs | 0 | 0 | 0 | 253.38 KB |
#6252 | StringConcatAspectBenchmark |
net472 | 283μs | 6.3μs | 61.4μs | 0 | 0 | 0 | 278.53 KB |
5f466a9
to
6463601
Compare
bc03048
to
faade40
Compare
tracer/build/_build/PrepareRelease/GenerateIntegrationDefinitions.cs
Outdated
Show resolved
Hide resolved
"Item1": 2, | ||
"Item2": 0, | ||
"Item3": 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is not intended to be read by a human, but Item1
Item2and
Item3`? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the version struct is defined as a Tuple...
// TODO : Temporary build fix | ||
Definitions = null; // InstrumentationDefinitions.GetAllDefinitionsNative(); | ||
DerivedDefinitions = null; // InstrumentationDefinitions.GetAllDerivedDefinitionsNative(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should use the same json file for dependabot... wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, quite possible, but I think the reality is that this isn't supported or used anywhere yet, so it's not worth worrying about until we come back to this IMO
@@ -1,41 +1,42 @@ | |||
// <copyright file="NativeCallTargetDefinition2.cs" company="Datadog"> | |||
// <copyright file="NativeCallTargetDefinition3.cs" company="Datadog"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, if we're not sending these from managed -> Native, I'm not sure why we need this file at all? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of tests need this. We'll figure out how to circumvent this in a future PR
2a92d00
to
74bab4a
Compare
0e2e051
to
fd471c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👍
Mostly just some small suggestions e.g. be more aggressive about validation and error cases in the generator file - we can just throw as soon as we spot anything invalid, better to break the build than have something invalid in there.
A bigger concern is the changing of the native interface - I don't think we should change the native method that is called from the managed size, just add a new one?
tracer/build/_build/PrepareRelease/GenerateIntegrationDefinitions.cs
Outdated
Show resolved
Hide resolved
|
||
public static void GenerateCallTargets(IEnumerable<TargetFramework> targetFrameworks, Func<string, string> getDllPath, AbsolutePath outputPath, string version, AbsolutePath dependabotPath) | ||
{ | ||
Serilog.Log.Debug("Generating CallTarget definitions file ..."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serilog.Log.Debug("Generating CallTarget definitions file ..."); | |
Logger.Debug("Generating CallTarget definitions file ..."); |
TryGetVersion(minimumVersion, ushort.MinValue, out minVersion); | ||
TryGetVersion(maximumVersion, ushort.MaxValue, out maxVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably handle the return value of false
here and throw, pointing to the value and the integration with the problem, otherwise we could end up with strange issues:
TryGetVersion(minimumVersion, ushort.MinValue, out minVersion); | |
TryGetVersion(maximumVersion, ushort.MaxValue, out maxVersion); | |
if (!TryGetVersion(minimumVersion, ushort.MinValue, out minVersion)) | |
{ | |
throw new InvalidOperationException($"Error: Integration type '{type}' has invalid value for minimum: '{minimumVersion}'"); | |
} | |
if (!TryGetVersion(maximumVersion, ushort.MaxValue, out maxVersion)) | |
{ | |
throw new InvalidOperationException($"Error: Integration type '{type}' has invalid value for maximum: '{maximumVersion}'"); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, but this is already covered in the SourceCodeGenerator. Although I could add more checks here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we don't want the source code generator any more after this PR do we? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nop, but yep, but nop, but yep... The IntegrationOptions
is calling GetIntegrationId
, so... We might want to look for an alternative method in a following PR
@@ -183,7 +129,7 @@ public static int RegisterIastAspects(string[] aspects) | |||
} | |||
} | |||
|
|||
public static int RegisterCallTargetDefinitions(string id, NativeCallTargetDefinition2[] items, uint enabledCategories) | |||
public static int RegisterCallTargetDefinitions(string id, NativeCallTargetDefinition3[] items, uint enabledCategories) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, we don't need this method do we, we shouldn't be calling it from anywhere as I understand it 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is used to test the category enablement / disablement feature. It's just an entry point that executes the same code that is invoked with the built in definitions
RegisterCallTargetDefinitions | ||
RegisterCallTargetDefinitions3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be exactly what we don't want to do 🤔 We shouldn't remove the RegisterCallTargetDefinitions
method, it needs to remain there, unchanged. And we don't need RegisterCallTargetDefinitions3
because it will never be called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legacy init uses InitProfiler in version mismatch scenarios. RegisterCallTargetDefs was called when no mismatch was found, so not needed anymore (but for testing purposes)
@@ -15,671 +15,8 @@ namespace Datadog.Trace.ClrProfiler | |||
{ | |||
internal static partial class InstrumentationDefinitions | |||
{ | |||
internal static NativeCallTargetDefinition2[] Instrumentations; | |||
|
|||
static InstrumentationDefinitions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to generate this file at all any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InterationOption
is still invoking the GetIntegrationId
function...
{(WCHAR*)WStr("Microsoft.AspNetCore.Diagnostics"),(WCHAR*)WStr("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware"),(WCHAR*)WStr("DisplayException"),g_callTargets_Sig_159,3,2,0,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration"),CallTargetKind::Default,4,164}, | ||
{(WCHAR*)WStr("Microsoft.AspNetCore.Diagnostics"),(WCHAR*)WStr("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware"),(WCHAR*)WStr("DisplayException"),g_callTargets_Sig_157,2,3,0,0,6,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0"),CallTargetKind::Default,4,164}, | ||
{(WCHAR*)WStr("Microsoft.AspNetCore.Diagnostics"),(WCHAR*)WStr("Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl"),(WCHAR*)WStr("DisplayException"),g_callTargets_Sig_157,2,7,0,0,8,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.DeveloperExceptionPageMiddlewareIntegration_Pre_3_0_0"),CallTargetKind::Default,4,164}, | ||
{(WCHAR*)WStr("System.Web"),(WCHAR*)WStr("System.Web.HttpResponse"),(WCHAR*)WStr("WriteErrorMessage"),g_callTargets_Sig_267,3,4,0,0,4,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.StackTraceLeak.HttpResponseIntegration"),CallTargetKind::Default,4,1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for callsites, I wonder if we can omit the NETFX-only integrations in linux/macos, but that's an optimization for later if we want to consider it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, interesting. Noted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -203,8 +203,7 @@ class CorProfiler : public CorProfilerBase | |||
// | |||
// Tracer Integration methods #2 | |||
// | |||
long RegisterCallTargetDefinitions(WCHAR* id, CallTargetDefinition2* items, int size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can or should delete this. I think this is exactly the sort of method that we explicitly should never touch 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's never used in version mismatch scenarios
e232f67
to
0b98667
Compare
ec76382
to
3d10c13
Compare
17bc420
to
2277786
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work! I'm not sure I've understood all the ins and outs, but from asm pov it looks good, just a few comments for my understanding, thanks
parameterTypeNames = GetStringArray(namedArgument.Argument.Value); | ||
break; | ||
case nameof(InstrumentAttributeProperties.CallTargetType): | ||
//callTargetType = (namedArgument.Argument.Value as INamedTypeSymbol)?.ToDisplayString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this case be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, maybe. I put a breakpoint there that never triggered. Good catch
targetParameterTypes: parameterTypeNames ?? Array.Empty<string>(), | ||
minimumVersion: minVersion, | ||
maximumVersion: maxVersion, | ||
instrumentationTypeName: callTargetType ?? type.FullName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the case above is removed, call target type will always be null?
} | ||
} | ||
|
||
public static void DisableTracerCLRProfiler() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we don't need this anymore? I still see it in the Native.def exports though ( same for the ones above I think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, some cleaning is still needed. Good catch
3d10c13
to
c433d36
Compare
df76b2f
to
d1bb046
Compare
Updated API
d1bb046
to
b0d7fec
Compare
Summary of changes
Moved CallTarget definitions to the Native library so we can spare the marshalling.
As from V3, there will not be a situation where a Managed V3 will have to specify its definitions to a newer Native library, we can remove the definitions from the managed part.
We must still keep the ability to receive definitions from a V2 managed library.
Reason for change
Marshalling of definitions from managed to native is taxing. Also, embedding the definitions in each managed library takes space, precious in Serverless scenarions
Implementation details
Moved the generation of the
CallTargets
definitions to a nuke step, removing them from the managed library.Created a json file in dependabot folder with all the call target definitions declared. This file is read by the UpdatePackageVersions build step, instead of retrieving them by reflection from the compiled assemblies.
Removed uneeded exports from the native library.
Test coverage
Other details