-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IAST] Native CallSites Definitions #6241
Conversation
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 (6241) - mean (72ms) : 63, 80
. : milestone, 72,
master - mean (72ms) : 64, 80
. : milestone, 72,
section CallTarget+Inlining+NGEN
This PR (6241) - mean (1,111ms) : 1091, 1131
. : milestone, 1111,
master - mean (1,107ms) : 1085, 1128
. : milestone, 1107,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6241) - mean (108ms) : 106, 110
. : milestone, 108,
master - mean (108ms) : 106, 110
. : milestone, 108,
section CallTarget+Inlining+NGEN
This PR (6241) - mean (766ms) : 752, 780
. : milestone, 766,
master - mean (771ms) : 757, 785
. : milestone, 771,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6241) - mean (92ms) : 90, 94
. : milestone, 92,
master - mean (92ms) : 90, 93
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6241) - mean (720ms) : 709, 731
. : milestone, 720,
master - mean (726ms) : 707, 745
. : milestone, 726,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6241) - mean (191ms) : 185, 196
. : milestone, 191,
master - mean (191ms) : 186, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6241) - mean (1,209ms) : 1182, 1236
. : milestone, 1209,
master - mean (1,213ms) : 1190, 1236
. : milestone, 1213,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6241) - mean (276ms) : 271, 280
. : milestone, 276,
master - mean (276ms) : 271, 281
. : milestone, 276,
section CallTarget+Inlining+NGEN
This PR (6241) - mean (942ms) : 927, 957
. : milestone, 942,
master - mean (948ms) : 929, 967
. : milestone, 948,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6241) - mean (265ms) : 261, 269
. : milestone, 265,
master - mean (265ms) : 261, 270
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6241) - mean (924ms) : 907, 941
. : milestone, 924,
master - mean (931ms) : 913, 950
. : milestone, 931,
|
Benchmarks Report for tracer 🐌Benchmarks for #6241 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.421 | 214,393.06 | 150,855.56 | bimodal |
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 | 1.407 | 234,382.55 | 166,635.19 |
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 | 20.89 KB | 17.27 KB | -3.62 KB | -17.31% |
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 | 216μs | 1.38μs | 13.6μs | 0.197 | 0 | 0 | 18.73 KB |
master | SendRequest |
netcoreapp3.1 | 237μs | 1.69μs | 16.8μs | 0.227 | 0 | 0 | 20.89 KB |
master | SendRequest |
net472 | 0.00128ns | 0.000428ns | 0.00154ns | 0 | 0 | 0 | 0 b |
#6241 | SendRequest |
net6.0 | 151μs | 846ns | 6.66μs | 0.151 | 0 | 0 | 14.47 KB |
#6241 | SendRequest |
netcoreapp3.1 | 166μs | 602ns | 2.09μs | 0.161 | 0 | 0 | 17.27 KB |
#6241 | SendRequest |
net472 | 0.00223ns | 0.000828ns | 0.00321ns | 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 | 595μs | 3.13μs | 18.5μs | 0.587 | 0 | 0 | 41.76 KB |
master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 679μs | 3.08μs | 11.5μs | 0.349 | 0 | 0 | 41.66 KB |
master | WriteAndFlushEnrichedTraces |
net472 | 858μs | 3.57μs | 13.8μs | 8.33 | 2.5 | 0.417 | 53.34 KB |
#6241 | WriteAndFlushEnrichedTraces |
net6.0 | 573μs | 2.55μs | 9.9μs | 0.561 | 0 | 0 | 41.65 KB |
#6241 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 689μs | 3.13μs | 11.7μs | 0.336 | 0 | 0 | 41.66 KB |
#6241 | WriteAndFlushEnrichedTraces |
net472 | 882μs | 4.21μs | 17.4μs | 8.08 | 2.55 | 0.425 | 53.34 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.37μs | 1.08ns | 4.05ns | 0.0141 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.7μs | 1.17ns | 4.55ns | 0.0135 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
net472 | 2.06μs | 1.65ns | 6.39ns | 0.156 | 0.00103 | 0 | 987 B |
#6241 | ExecuteNonQuery |
net6.0 | 1.37μs | 0.99ns | 3.83ns | 0.0138 | 0 | 0 | 1.02 KB |
#6241 | ExecuteNonQuery |
netcoreapp3.1 | 1.77μs | 2.62ns | 10.1ns | 0.014 | 0 | 0 | 1.02 KB |
#6241 | ExecuteNonQuery |
net472 | 2.03μs | 1.11ns | 4.17ns | 0.156 | 0.00102 | 0 | 987 B |
Benchmarks.Trace.ElasticsearchBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6241
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0
1.117
1,274.77
1,424.05
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 | 1.117 | 1,274.77 | 1,424.05 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.13μs | 0.736ns | 2.75ns | 0.0136 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.59μs | 0.774ns | 3ns | 0.0128 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.51μs | 2.8ns | 10.8ns | 0.158 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.27μs | 0.629ns | 2.35ns | 0.0134 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.64μs | 0.86ns | 3.33ns | 0.0139 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.6μs | 2.22ns | 8.61ns | 0.167 | 0 | 0 | 1.05 KB |
#6241 | CallElasticsearch |
net6.0 | 1.1μs | 0.427ns | 1.6ns | 0.0138 | 0 | 0 | 976 B |
#6241 | CallElasticsearch |
netcoreapp3.1 | 1.64μs | 0.549ns | 2.05ns | 0.0132 | 0 | 0 | 976 B |
#6241 | CallElasticsearch |
net472 | 2.71μs | 1.04ns | 3.75ns | 0.157 | 0 | 0 | 995 B |
#6241 | CallElasticsearchAsync |
net6.0 | 1.42μs | 0.954ns | 3.7ns | 0.0128 | 0 | 0 | 952 B |
#6241 | CallElasticsearchAsync |
netcoreapp3.1 | 1.67μs | 0.686ns | 2.66ns | 0.014 | 0 | 0 | 1.02 KB |
#6241 | CallElasticsearchAsync |
net472 | 2.66μs | 2.64ns | 10.2ns | 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.23μs | 0.961ns | 3.72ns | 0.0134 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.66μs | 1.06ns | 4.11ns | 0.0133 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.82μs | 1.88ns | 7.27ns | 0.145 | 0 | 0 | 915 B |
#6241 | ExecuteAsync |
net6.0 | 1.21μs | 0.884ns | 3.31ns | 0.0134 | 0 | 0 | 952 B |
#6241 | ExecuteAsync |
netcoreapp3.1 | 1.69μs | 0.415ns | 1.5ns | 0.0127 | 0 | 0 | 952 B |
#6241 | ExecuteAsync |
net472 | 1.79μs | 0.683ns | 2.55ns | 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 | 2.75ns | 10.3ns | 0.0317 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.32μs | 2.88ns | 11.1ns | 0.0373 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.25μs | 3.7ns | 14.3ns | 0.495 | 0 | 0 | 3.12 KB |
#6241 | SendAsync |
net6.0 | 4.44μs | 5.24ns | 20.3ns | 0.0334 | 0 | 0 | 2.31 KB |
#6241 | SendAsync |
netcoreapp3.1 | 5.27μs | 3.11ns | 11.6ns | 0.0371 | 0 | 0 | 2.85 KB |
#6241 | SendAsync |
net472 | 7.39μs | 1.57ns | 5.86ns | 0.494 | 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.57μs | 0.661ns | 2.47ns | 0.0227 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.17μs | 1.4ns | 5.04ns | 0.0218 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.62μs | 1.51ns | 5.86ns | 0.249 | 0 | 0 | 1.57 KB |
#6241 | EnrichedLog |
net6.0 | 1.47μs | 0.731ns | 2.73ns | 0.0229 | 0 | 0 | 1.64 KB |
#6241 | EnrichedLog |
netcoreapp3.1 | 2.23μs | 1.41ns | 5.48ns | 0.0216 | 0 | 0 | 1.64 KB |
#6241 | EnrichedLog |
net472 | 2.57μs | 1.23ns | 4.76ns | 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 | 266ns | 1.03μs | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 124μs | 281ns | 1.09μs | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 151μs | 100ns | 387ns | 0.676 | 0.225 | 0 | 4.46 KB |
#6241 | EnrichedLog |
net6.0 | 121μs | 196ns | 758ns | 0.0606 | 0 | 0 | 4.28 KB |
#6241 | EnrichedLog |
netcoreapp3.1 | 124μs | 137ns | 531ns | 0.0621 | 0 | 0 | 4.28 KB |
#6241 | EnrichedLog |
net472 | 153μs | 111ns | 432ns | 0.682 | 0.227 | 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.17μs | 1.81ns | 6.99ns | 0.0297 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.35μs | 1.45ns | 5.62ns | 0.0283 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.83μs | 1.52ns | 5.9ns | 0.319 | 0 | 0 | 2.02 KB |
#6241 | EnrichedLog |
net6.0 | 3.1μs | 4.66ns | 18ns | 0.03 | 0 | 0 | 2.2 KB |
#6241 | EnrichedLog |
netcoreapp3.1 | 4.2μs | 2.37ns | 8.55ns | 0.0294 | 0 | 0 | 2.2 KB |
#6241 | EnrichedLog |
net472 | 4.96μs | 1.21ns | 4.69ns | 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.31μs | 0.65ns | 2.43ns | 0.0157 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.79μs | 0.661ns | 2.47ns | 0.0151 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.04μs | 1.01ns | 3.79ns | 0.183 | 0 | 0 | 1.16 KB |
#6241 | SendReceive |
net6.0 | 1.26μs | 0.655ns | 2.54ns | 0.0157 | 0 | 0 | 1.14 KB |
#6241 | SendReceive |
netcoreapp3.1 | 1.75μs | 0.553ns | 2.14ns | 0.0158 | 0 | 0 | 1.14 KB |
#6241 | SendReceive |
net472 | 2.15μs | 1.29ns | 4.83ns | 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.76μs | 1.2ns | 4.64ns | 0.022 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.99μs | 3.27ns | 12.7ns | 0.0218 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.37μs | 2.59ns | 10ns | 0.322 | 0 | 0 | 2.04 KB |
#6241 | EnrichedLog |
net6.0 | 2.72μs | 1.08ns | 4.06ns | 0.0217 | 0 | 0 | 1.6 KB |
#6241 | EnrichedLog |
netcoreapp3.1 | 3.84μs | 0.911ns | 3.41ns | 0.0213 | 0 | 0 | 1.65 KB |
#6241 | EnrichedLog |
net472 | 4.42μs | 3.14ns | 12.2ns | 0.323 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6241
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0
1.183
405.10
479.16
Faster 🎉 in #6241
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472
1.158
913.82
788.89
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 1.183 | 405.10 | 479.16 |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472 | 1.158 | 913.82 | 788.89 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 405ns | 0.665ns | 2.57ns | 0.00806 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 566ns | 0.73ns | 2.83ns | 0.00792 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 672ns | 0.909ns | 3.52ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 493ns | 0.611ns | 2.37ns | 0.00982 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 654ns | 1.08ns | 4.2ns | 0.00954 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 913ns | 0.51ns | 1.98ns | 0.104 | 0 | 0 | 658 B |
#6241 | StartFinishSpan |
net6.0 | 479ns | 0.415ns | 1.61ns | 0.0081 | 0 | 0 | 576 B |
#6241 | StartFinishSpan |
netcoreapp3.1 | 593ns | 1.32ns | 5.1ns | 0.0078 | 0 | 0 | 576 B |
#6241 | StartFinishSpan |
net472 | 631ns | 1.33ns | 4.99ns | 0.0917 | 0 | 0 | 578 B |
#6241 | StartFinishScope |
net6.0 | 512ns | 0.771ns | 2.99ns | 0.00983 | 0 | 0 | 696 B |
#6241 | StartFinishScope |
netcoreapp3.1 | 653ns | 1.33ns | 5.16ns | 0.00926 | 0 | 0 | 696 B |
#6241 | StartFinishScope |
net472 | 784ns | 3.22ns | 12.5ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6241
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0
1.142
591.00
675.03
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 1.142 | 591.00 | 675.03 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 591ns | 0.63ns | 2.44ns | 0.0096 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 947ns | 1.12ns | 4.34ns | 0.00945 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.16μs | 2.46ns | 9.54ns | 0.104 | 0 | 0 | 658 B |
#6241 | RunOnMethodBegin |
net6.0 | 674ns | 0.749ns | 2.9ns | 0.00977 | 0 | 0 | 696 B |
#6241 | RunOnMethodBegin |
netcoreapp3.1 | 986ns | 1.62ns | 6.06ns | 0.00942 | 0 | 0 | 696 B |
#6241 | RunOnMethodBegin |
net472 | 1.13μs | 3.82ns | 14.8ns | 0.104 | 0 | 0 | 658 B |
Datadog ReportBranch report: ❌ 6 Failed (0 Known Flaky), 566835 Passed, 4587 Skipped, 48h 7m 42.12s Total Time ❌ Failed Tests (6)
New Flaky Tests (59)
|
...g.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs
Outdated
Show resolved
Hide resolved
bdf5f79
to
45b0c85
Compare
Benchmarks Report for appsec 🐌Benchmarks for #6241 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.StringConcatBenchmark‑net472 | 60.49 KB | 61.83 KB | 1.34 KB | 2.22% |
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 | 272.91 KB | 278.53 KB | 5.62 KB | 2.06% |
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 |
#6241 | StringConcatBenchmark |
net6.0 | 59.8μs | 703ns | 6.85μs | 0 | 0 | 0 | 43.44 KB |
#6241 | StringConcatBenchmark |
netcoreapp3.1 | 61.4μs | 838ns | 8.25μs | 0 | 0 | 0 | 42.64 KB |
#6241 | StringConcatBenchmark |
net472 | 36.7μs | 88.8ns | 320ns | 0 | 0 | 0 | 61.83 KB |
#6241 | StringConcatAspectBenchmark |
net6.0 | 313μs | 1.64μs | 8.01μs | 0 | 0 | 0 | 255.11 KB |
#6241 | StringConcatAspectBenchmark |
netcoreapp3.1 | 350μs | 1.7μs | 9.29μs | 0 | 0 | 0 | 254.23 KB |
#6241 | StringConcatAspectBenchmark |
net472 | 266μs | 5.06μs | 48.3μs | 0 | 0 | 0 | 278.53 KB |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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 (6241) (11.014M) : 0, 11014258
master (11.155M) : 0, 11154721
benchmarks/2.9.0 (11.033M) : 0, 11032866
section Automatic
This PR (6241) (7.196M) : 0, 7196294
master (7.297M) : 0, 7297200
benchmarks/2.9.0 (7.786M) : 0, 7785853
section Trace stats
master (7.684M) : 0, 7684145
section Manual
master (11.069M) : 0, 11068901
section Manual + Automatic
This PR (6241) (6.652M) : 0, 6651985
master (6.786M) : 0, 6785523
section DD_TRACE_ENABLED=0
master (10.249M) : 0, 10249493
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6241) (9.472M) : 0, 9471816
master (9.602M) : 0, 9601778
benchmarks/2.9.0 (9.495M) : 0, 9494821
section Automatic
This PR (6241) (6.142M) : 0, 6141782
master (6.210M) : 0, 6209560
section Trace stats
master (6.728M) : 0, 6728350
section Manual
master (9.437M) : 0, 9436743
section Manual + Automatic
This PR (6241) (5.937M) : 0, 5937023
master (5.810M) : 0, 5809535
section DD_TRACE_ENABLED=0
master (8.705M) : 0, 8705485
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6241) (10.109M) : 0, 10109285
master (10.329M) : 0, 10328534
benchmarks/2.9.0 (10.020M) : 0, 10019592
section Automatic
This PR (6241) (6.344M) : 0, 6344047
master (6.617M) : 0, 6616689
benchmarks/2.9.0 (7.255M) : 0, 7255257
section Trace stats
master (7.166M) : 0, 7165623
section Manual
master (10.093M) : 0, 10093300
section Manual + Automatic
This PR (6241) (6.036M) : 0, 6036305
master (6.311M) : 0, 6310782
section DD_TRACE_ENABLED=0
master (9.459M) : 0, 9459125
|
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, thanks!
<ItemGroup> | ||
<Compile Include="..\..\build\_build\CodeGenerators\InstrumentationCategory.cs" Link="ClrProfiler\InstrumentationCategory.cs" /> | ||
<Compile Include="..\..\build\_build\CodeGenerators\TargetFrameworks.cs" Link="ClrProfiler\TargetFrameworks.cs" /> | ||
</ItemGroup> |
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.
What's the reason to do this in Datadog.Trace.csproj
?
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.
In the opposite way (files in Datadog.Trace and link in _build) it failed in Linux with a File not found 🤷♂️
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.
In the opposite way (files in Datadog.Trace and link in _build) it failed in Linux with a File not found 🤷♂️
Urgh, I'd really prefer we don't do this 😟 We get into issues of chasing the files around, esp as the build won't explicitly fail with "file not found" or anything.
The reason it fails is because in the docker file we copy only the build files across first, and compile the _build
project.
Does the build really need direct references to these files? 🤔 Instead of having a direct reference, I wonder if we can grab the values from the dlls we load even?
Worst case, I'd probably actually prefer we just duplicated the files and added a comment 🙈
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 duplicating the files and add comments.
5f466a9
to
6463601
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! 😄 90% tiny nits, just a couple of questions build-wise... I didn't review the changes to the aspects very extensively, probably want to get ASM 👀 on that
var tfmCategory = GetCategory(tfm); | ||
|
||
// Open dll to extract all AspectsClass attributes. | ||
using var asmDefinition = Mono.Cecil.AssemblyDefinition.ReadAssembly(dllPath); |
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 guess this is just easier/better than what we were doing in GenerateIntegrationDefinitions
, loading into a custom assembly context to read the calltargetdefinitions🤔
namespace trace | ||
{ | ||
|
||
std::vector<WCHAR*> g_callSites= |
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.
Just to clarify, I think we need a github check that this file has been correctly generated and committed:
- Currently, this file is generated in the
CompileManagedSrc
target (which is where it has to be generated). - However, we build the native tracer, before we build the managed tracer
- That means the native tracer will be built with the previous generated files.
I think this is already covered by the existing GitHub Actions check for committed source generators that we currently have, but it would be good to double check that 🤔
However, when running locally, there's no guarantee that CompileNativeSrc
runs after CompileManagedSrc
, which it now requires. That could lead to weird experiences locally, where you make some changes to the aspects, call BuildTracerHome
, and it looks like everything is working, but actually your native code doesn't include the definitions...
The question is, can we just add .After(CompileManagedSrc)
to the CompileNativeSrc
target 🤔 I'm not sure unfortunately... I can't remember...
(WCHAR*)WStr(" [AspectMethodReplace(\"System.Text.Json.JsonDocument::Parse(System.String,System.Text.Json.JsonDocumentOptions)\",\"\",[0],[False],[None],Default,[]);V2.49.0] Parse(System.String,System.Text.Json.JsonDocumentOptions) 160"), | ||
(WCHAR*)WStr(" [AspectMethodReplace(\"System.Text.Json.JsonElement::GetRawText()\",\"\",[0],[True],[None],Default,[]);V2.49.0] GetRawText(System.Object) 160"), | ||
(WCHAR*)WStr(" [AspectMethodReplace(\"System.Text.Json.JsonElement::GetString()\",\"\",[0],[True],[None],Default,[]);V2.49.0] GetString(System.Object) 160"), | ||
(WCHAR*)WStr("[AspectClass(\"System.Web\",[None],Propagation,[])] Datadog.Trace.Iast.Aspects.System.Web.HttpCookieAspect 4"), |
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.
Is it worth trying to #if
out the aspects which are .NET FX only when we're running on Linux/macOS 🤔 No need to in this PR, but could be an optimisation, both for dll size, runtime memory size, and speed of lookups? 🤷♂️
@@ -50,7 +50,7 @@ namespace iast | |||
//------------------------------------ | |||
VersionInfo currentVersion = GetVersionInfo(GetDatadogVersion()); | |||
|
|||
DataflowAspectClass::DataflowAspectClass(Dataflow* dataflow, const WSTRING& aspectsAssembly, const WSTRING& line) | |||
DataflowAspectClass::DataflowAspectClass(Dataflow* dataflow, const WSTRING& aspectsAssembly, const WSTRING& line, const UINT32 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.
Again, not for this PR, but if we're generating the code directly now instead of marshalling, there's no reason we have to (or should) use strings for everything, which we then have to manipulate, right? We could just embed the already-parsed structures directly? 🤔
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, agree, but that's a big enough task to do it in another PR
foreach (var line in File.ReadAllLines(path)) | ||
{ | ||
if (!line.Contains("Aspect")) { continue; } | ||
var aspect = line.Substring(14, line.Length - 17).Replace("\\\"", "\""); |
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 many magic numbers
@@ -1447,7 +1447,7 @@ internal enum CallTargetKind | |||
} | |||
|
|||
[Flags] | |||
internal enum InstrumentationCategory | |||
internal enum InstrumentationCategory : uint |
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.
Is this still used? You deleted the generator right? 🤔
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 one is the CallTarget ones. I changed the nature of the enum to uint, and reused it for the CallSites
2a92d00
to
74bab4a
Compare
public Dictionary<string, Aspect> Aspects = new Dictionary<string, Aspect>(); | ||
public InstrumentationCategory Categories = InstrumentationCategory.Iast; | ||
|
||
public string Subfix() |
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.
Typo? Should it be Suffix instead?
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.
True
NET5_0 = 64, | ||
NET6_0 = 128, | ||
NET7_0 = 256, | ||
NET8_0 = 512 |
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.
Since .Net 9 is already on its way, it would be worth to add it here and avoid an extra modification later
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'd rather do it where it's due.
@@ -21,7 +21,4 @@ internal enum AspectType | |||
|
|||
/// <summary> Source aspect </summary> | |||
Source, | |||
|
|||
/// <summary> Rasp and Iast Sink aspect </summary> | |||
RaspIastSink, |
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! It was not very clean having this.
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!
3d10c13
to
c433d36
Compare
b0dfaea
to
54e950e
Compare
Improved build execution order Update build step
Co-authored-by: Andrew Lock <[email protected]>
54e950e
to
23077b9
Compare
Summary of changes
Moved
CallSite
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
CallSites
definitions to a nuke step, removing theSourceGenerator
.Added
InstrumentationCategory
toCallSites
, to match whatCallTargets
haveTest coverage
Other details