-
Notifications
You must be signed in to change notification settings - Fork 140
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.385 | 195,765.88 | 141,394.88 | |
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 | 1.263 | 213,233.65 | 168,777.79 |
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 | 198μs | 1.15μs | 9.58μs | 0.195 | 0 | 0 | 18.73 KB |
master | SendRequest |
netcoreapp3.1 | 214μs | 1.08μs | 4.93μs | 0.213 | 0 | 0 | 20.89 KB |
master | SendRequest |
net472 | 0.00101ns | 0.000372ns | 0.00144ns | 0 | 0 | 0 | 0 b |
#6252 | SendRequest |
net6.0 | 142μs | 787ns | 4.85μs | 0.141 | 0 | 0 | 14.47 KB |
#6252 | SendRequest |
netcoreapp3.1 | 171μs | 985ns | 7.56μs | 0.175 | 0 | 0 | 17.27 KB |
#6252 | SendRequest |
net472 | 0.00111ns | 0.000391ns | 0.00141ns | 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 | 568μs | 2.51μs | 9.06μs | 0.548 | 0.274 | 0 | 41.45 KB |
master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 690μs | 3.47μs | 15.5μs | 0.342 | 0 | 0 | 41.85 KB |
master | WriteAndFlushEnrichedTraces |
net472 | 892μs | 4.37μs | 18.5μs | 8.42 | 2.66 | 0.443 | 53.32 KB |
#6252 | WriteAndFlushEnrichedTraces |
net6.0 | 568μs | 2.41μs | 10.2μs | 0.571 | 0 | 0 | 41.44 KB |
#6252 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 685μs | 2.49μs | 9.65μs | 0.338 | 0 | 0 | 41.71 KB |
#6252 | WriteAndFlushEnrichedTraces |
net472 | 867μs | 3.31μs | 12.8μs | 8.08 | 2.55 | 0.425 | 53.26 KB |
Benchmarks.Trace.DbCommandBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6252
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0
1.157
1,241.01
1,435.30
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 | 1.157 | 1,241.01 | 1,435.30 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | ExecuteNonQuery |
net6.0 | 1.24μs | 0.65ns | 2.34ns | 0.0143 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.73μs | 1.36ns | 4.7ns | 0.0139 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
net472 | 2.05μs | 1.45ns | 5.44ns | 0.157 | 0.00102 | 0 | 987 B |
#6252 | ExecuteNonQuery |
net6.0 | 1.44μs | 0.794ns | 2.97ns | 0.0144 | 0 | 0 | 1.02 KB |
#6252 | ExecuteNonQuery |
netcoreapp3.1 | 1.78μs | 1.16ns | 4.2ns | 0.0136 | 0 | 0 | 1.02 KB |
#6252 | ExecuteNonQuery |
net472 | 2.12μs | 1.07ns | 3.99ns | 0.156 | 0.00106 | 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.21μs | 1.38ns | 5.16ns | 0.014 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.62μs | 0.574ns | 2.15ns | 0.0131 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.5μs | 2.36ns | 9.14ns | 0.157 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.27μs | 0.703ns | 2.72ns | 0.0133 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.65μs | 0.741ns | 2.87ns | 0.0139 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.67μs | 1.94ns | 7.5ns | 0.166 | 0 | 0 | 1.05 KB |
#6252 | CallElasticsearch |
net6.0 | 1.32μs | 0.851ns | 3.29ns | 0.0133 | 0 | 0 | 976 B |
#6252 | CallElasticsearch |
netcoreapp3.1 | 1.6μs | 1.01ns | 3.93ns | 0.013 | 0 | 0 | 976 B |
#6252 | CallElasticsearch |
net472 | 2.53μs | 1.16ns | 4.33ns | 0.157 | 0 | 0 | 995 B |
#6252 | CallElasticsearchAsync |
net6.0 | 1.35μs | 0.443ns | 1.66ns | 0.0135 | 0 | 0 | 952 B |
#6252 | CallElasticsearchAsync |
netcoreapp3.1 | 1.71μs | 1.14ns | 4.25ns | 0.0145 | 0 | 0 | 1.02 KB |
#6252 | CallElasticsearchAsync |
net472 | 2.54μs | 0.704ns | 2.54ns | 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.22μs | 0.394ns | 1.36ns | 0.0132 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.66μs | 0.815ns | 3.16ns | 0.0125 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.69μs | 1.63ns | 6.32ns | 0.145 | 0 | 0 | 915 B |
#6252 | ExecuteAsync |
net6.0 | 1.26μs | 1.13ns | 4.36ns | 0.013 | 0 | 0 | 952 B |
#6252 | ExecuteAsync |
netcoreapp3.1 | 1.67μs | 1.85ns | 7.16ns | 0.0125 | 0 | 0 | 952 B |
#6252 | ExecuteAsync |
net472 | 1.78μs | 0.675ns | 2.43ns | 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.58μs | 1.32ns | 4.77ns | 0.0321 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.26μs | 1.28ns | 4.8ns | 0.0369 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.78μs | 2.72ns | 10.5ns | 0.494 | 0 | 0 | 3.12 KB |
#6252 | SendAsync |
net6.0 | 4.44μs | 2.2ns | 8.52ns | 0.031 | 0 | 0 | 2.31 KB |
#6252 | SendAsync |
netcoreapp3.1 | 5.31μs | 2.48ns | 9.59ns | 0.0369 | 0 | 0 | 2.85 KB |
#6252 | SendAsync |
net472 | 7.29μs | 5.04ns | 19.5ns | 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.58μs | 0.577ns | 2.16ns | 0.0229 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.18μs | 0.857ns | 3.21ns | 0.022 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.66μs | 1.47ns | 5.08ns | 0.25 | 0 | 0 | 1.57 KB |
#6252 | EnrichedLog |
net6.0 | 1.47μs | 0.805ns | 3.01ns | 0.0229 | 0 | 0 | 1.64 KB |
#6252 | EnrichedLog |
netcoreapp3.1 | 2.16μs | 0.281ns | 0.973ns | 0.0218 | 0 | 0 | 1.64 KB |
#6252 | EnrichedLog |
net472 | 2.6μs | 1.67ns | 6.45ns | 0.25 | 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 | 104ns | 391ns | 0.0588 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 124μs | 469ns | 1.81μs | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 156μs | 222ns | 860ns | 0.706 | 0.235 | 0 | 4.46 KB |
#6252 | EnrichedLog |
net6.0 | 120μs | 184ns | 713ns | 0.0602 | 0 | 0 | 4.28 KB |
#6252 | EnrichedLog |
netcoreapp3.1 | 121μs | 442ns | 1.71μs | 0 | 0 | 0 | 4.28 KB |
#6252 | EnrichedLog |
net472 | 151μs | 200ns | 775ns | 0.679 | 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.02μs | 1.31ns | 5.07ns | 0.031 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.14μs | 0.817ns | 2.83ns | 0.0289 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.92μs | 1.16ns | 4.17ns | 0.321 | 0 | 0 | 2.02 KB |
#6252 | EnrichedLog |
net6.0 | 3.04μs | 1.02ns | 3.94ns | 0.0301 | 0 | 0 | 2.2 KB |
#6252 | EnrichedLog |
netcoreapp3.1 | 4.16μs | 1.16ns | 4.5ns | 0.0292 | 0 | 0 | 2.2 KB |
#6252 | EnrichedLog |
net472 | 4.9μs | 2.11ns | 8.17ns | 0.319 | 0 | 0 | 2.02 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | SendReceive |
net6.0 | 1.33μs | 0.429ns | 1.66ns | 0.0159 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.83μs | 0.845ns | 3.27ns | 0.0156 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.15μs | 0.992ns | 3.84ns | 0.183 | 0 | 0 | 1.16 KB |
#6252 | SendReceive |
net6.0 | 1.31μs | 0.657ns | 2.46ns | 0.0157 | 0 | 0 | 1.14 KB |
#6252 | SendReceive |
netcoreapp3.1 | 1.76μs | 0.588ns | 2.28ns | 0.015 | 0 | 0 | 1.14 KB |
#6252 | SendReceive |
net472 | 2.18μs | 1.43ns | 5.53ns | 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.82μs | 5.35ns | 20.7ns | 0.0225 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.97μs | 1.67ns | 6.45ns | 0.0218 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.33μs | 5.36ns | 19.3ns | 0.323 | 0 | 0 | 2.04 KB |
#6252 | EnrichedLog |
net6.0 | 2.77μs | 9.72ns | 37.7ns | 0.0221 | 0 | 0 | 1.6 KB |
#6252 | EnrichedLog |
netcoreapp3.1 | 3.97μs | 1.68ns | 6.52ns | 0.0219 | 0 | 0 | 1.65 KB |
#6252 | EnrichedLog |
net472 | 4.36μs | 1.08ns | 3.88ns | 0.322 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 410ns | 0.186ns | 0.721ns | 0.00804 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 563ns | 0.322ns | 1.21ns | 0.00783 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 701ns | 0.974ns | 3.64ns | 0.0915 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 517ns | 0.475ns | 1.84ns | 0.00989 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 729ns | 0.632ns | 2.45ns | 0.00936 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 854ns | 0.698ns | 2.61ns | 0.104 | 0 | 0 | 658 B |
#6252 | StartFinishSpan |
net6.0 | 402ns | 0.494ns | 1.85ns | 0.00806 | 0 | 0 | 576 B |
#6252 | StartFinishSpan |
netcoreapp3.1 | 557ns | 0.843ns | 3.26ns | 0.00776 | 0 | 0 | 576 B |
#6252 | StartFinishSpan |
net472 | 744ns | 0.742ns | 2.87ns | 0.0916 | 0 | 0 | 578 B |
#6252 | StartFinishScope |
net6.0 | 500ns | 0.958ns | 3.71ns | 0.00971 | 0 | 0 | 696 B |
#6252 | StartFinishScope |
netcoreapp3.1 | 758ns | 0.309ns | 1.2ns | 0.0094 | 0 | 0 | 696 B |
#6252 | StartFinishScope |
net472 | 920ns | 3.45ns | 13.3ns | 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 | 649ns | 0.313ns | 1.17ns | 0.00979 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 998ns | 0.786ns | 3.04ns | 0.00948 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.18μs | 0.603ns | 2.25ns | 0.104 | 0 | 0 | 658 B |
#6252 | RunOnMethodBegin |
net6.0 | 680ns | 0.689ns | 2.67ns | 0.00975 | 0 | 0 | 696 B |
#6252 | RunOnMethodBegin |
netcoreapp3.1 | 939ns | 1.04ns | 3.9ns | 0.00937 | 0 | 0 | 696 B |
#6252 | RunOnMethodBegin |
net472 | 1.13μs | 3.84ns | 14.9ns | 0.105 | 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.281M) : 0, 11280867
master (11.120M) : 0, 11120201
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6252) (7.282M) : 0, 7282096
master (7.143M) : 0, 7143247
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.563M) : 0, 7562834
section Manual
master (11.052M) : 0, 11051540
section Manual + Automatic
This PR (6252) (6.770M) : 0, 6769646
master (6.532M) : 0, 6532471
section DD_TRACE_ENABLED=0
master (10.176M) : 0, 10176174
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6252) (9.548M) : 0, 9547654
master (9.435M) : 0, 9435139
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6252) (6.440M) : 0, 6439756
master (6.301M) : 0, 6300608
section Trace stats
master (6.646M) : 0, 6646045
section Manual
master (9.564M) : 0, 9563833
section Manual + Automatic
This PR (6252) (5.918M) : 0, 5917904
master (5.897M) : 0, 5897193
section DD_TRACE_ENABLED=0
master (8.862M) : 0, 8862065
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6252) (9.830M) : 0, 9830291
master (9.832M) : 0, 9832351
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6252) (6.329M) : 0, 6328761
master (6.258M) : 0, 6258447
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (6.950M) : 0, 6950057
section Manual
master (9.945M) : 0, 9945109
section Manual + Automatic
This PR (6252) (5.829M) : 0, 5829405
master (5.742M) : 0, 5742033
section DD_TRACE_ENABLED=0
master (9.091M) : 0, 9091089
|
Datadog ReportBranch report: ❌ 6 Failed (0 Known Flaky), 527391 Passed, 2043 Skipped, 17h 46m 33.9s 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