Add instrumentation for AspNetCore 2.1 apps targeting .NET Framework
This adds several CallTarget instrumentation points to invoke the same logic as our AspNetCore integration that's built-in for our netstandard2.0/netcoreapp build targets. However, since we can't refer to the abstraction libraries, we must duck type everything. This leads to some code duplication that I hope to minimize.
Additional Changes
- Add feature to DuckTyping library to use implicit casts when returning a value from the target method to the proxy method. This enables us to return
string objects from proxy methods instead of Microsoft.Extensions.Primitives.StringValues. Fixes the following issue: Datadog.Trace.DuckTyping.DuckTypeInvalidTypeConversionException : Invalid type conversion from Microsoft.Extensions.Primitives.StringValues to System.String
Testing
Snapshot testing passes for the new tests:
-
tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreIisMvc21Tests.cs matches the ".OutOfProcess" scenario snapshots
-
tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/AspNetCore/AspNetCoreMvc21Tests.cs matches all the original snapshots
-
tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCore2.cs now runs on net461 matches all the original snapshots
Remaining Work
- [ ] Reduce code duplication
- [ ] Optimize duck typing
- [x] Add ducktyping unit tests for implicit cast returns
Benchmarks Report :snail:
Benchmarks for #2398 compared to master:
- 1 benchmarks are slower, with geometric mean 1.139
- All benchmarks have the same allocations
The following thresholds were used for comparing the benchmark speeds:
- Mann–Whitney U test with statistical test for significance of 5%
- Only results indicating a difference greater than 10% and 0.3 ns are considered.
Allocation changes below 0.5% are ignored.
Benchmark details
Benchmarks.Trace.AgentWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
WriteAndFlushEnrichedTraces |
net472 |
830μs |
2.04μs |
7.06μs |
0 |
0 |
0 |
3.16 KB |
| master |
WriteAndFlushEnrichedTraces |
netcoreapp3.1 |
648μs |
2.45μs |
9.51μs |
0 |
0 |
0 |
2.57 KB |
| #2398 |
WriteAndFlushEnrichedTraces |
net472 |
859μs |
3.65μs |
15.9μs |
0 |
0 |
0 |
3.16 KB |
| #2398 |
WriteAndFlushEnrichedTraces |
netcoreapp3.1 |
656μs |
2.36μs |
9.13μs |
0 |
0 |
0 |
2.57 KB |
Benchmarks.Trace.AspNetCoreBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendRequest |
net472 |
0ns |
0ns |
0ns |
0 |
0 |
0 |
0 b |
| master |
SendRequest |
netcoreapp3.1 |
285μs |
1.05μs |
4.07μs |
0.145 |
0 |
0 |
19.67 KB |
| #2398 |
SendRequest |
net472 |
0ns |
0ns |
0ns |
0 |
0 |
0 |
0 b |
| #2398 |
SendRequest |
netcoreapp3.1 |
295μs |
913ns |
3.53μs |
0.148 |
0 |
0 |
19.67 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
ExecuteNonQuery |
net472 |
1.57μs |
7.52ns |
29.1ns |
0.093 |
0.000781 |
0 |
586 B |
| master |
ExecuteNonQuery |
netcoreapp3.1 |
1.43μs |
5.47ns |
21.2ns |
0.00864 |
0 |
0 |
624 B |
| #2398 |
ExecuteNonQuery |
net472 |
1.66μs |
8.45ns |
43.1ns |
0.093 |
0.000816 |
0 |
586 B |
| #2398 |
ExecuteNonQuery |
netcoreapp3.1 |
1.47μs |
4.12ns |
15.4ns |
0.00826 |
0 |
0 |
624 B |
Benchmarks.Trace.ElasticsearchBenchmark - Slower :warning: Same allocations :heavy_check_mark:
Slower :warning: in #2398
| Benchmark |
diff/base |
Base Median (ns) |
Diff Median (ns) |
Modality |
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net472 |
1.139 |
2,477.62 |
2,822.53 |
|
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
CallElasticsearch |
net472 |
2.39μs |
12.3ns |
56.3ns |
0.124 |
0 |
0 |
794 B |
| master |
CallElasticsearch |
netcoreapp3.1 |
1.57μs |
5.42ns |
20.3ns |
0.0107 |
0 |
0 |
784 B |
| master |
CallElasticsearchAsync |
net472 |
2.51μs |
13.8ns |
76.7ns |
0.146 |
0 |
0 |
931 B |
| master |
CallElasticsearchAsync |
netcoreapp3.1 |
1.77μs |
9.33ns |
50.2ns |
0.0126 |
0 |
0 |
904 B |
| #2398 |
CallElasticsearch |
net472 |
2.39μs |
9.36ns |
36.2ns |
0.123 |
0 |
0 |
794 B |
| #2398 |
CallElasticsearch |
netcoreapp3.1 |
1.64μs |
6.91ns |
25.9ns |
0.0104 |
0 |
0 |
784 B |
| #2398 |
CallElasticsearchAsync |
net472 |
2.83μs |
11.8ns |
48.6ns |
0.145 |
0 |
0 |
931 B |
| #2398 |
CallElasticsearchAsync |
netcoreapp3.1 |
1.74μs |
8.42ns |
35.7ns |
0.0125 |
0 |
0 |
904 B |
Benchmarks.Trace.GraphQLBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
ExecuteAsync |
net472 |
3.23μs |
16.1ns |
68.5ns |
0.164 |
0 |
0 |
1.05 KB |
| master |
ExecuteAsync |
netcoreapp3.1 |
1.88μs |
6.75ns |
25.2ns |
0.0139 |
0 |
0 |
1.02 KB |
| #2398 |
ExecuteAsync |
net472 |
3.12μs |
7.47ns |
28ns |
0.163 |
0 |
0 |
1.05 KB |
| #2398 |
ExecuteAsync |
netcoreapp3.1 |
1.96μs |
7.13ns |
27.6ns |
0.0144 |
0 |
0 |
1.02 KB |
Benchmarks.Trace.HttpClientBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendAsync |
net472 |
6.25μs |
32ns |
160ns |
0.353 |
0 |
0 |
2.26 KB |
| master |
SendAsync |
netcoreapp3.1 |
4.67μs |
17.2ns |
64.3ns |
0.03 |
0 |
0 |
2.16 KB |
| #2398 |
SendAsync |
net472 |
6.11μs |
20.2ns |
75.5ns |
0.354 |
0 |
0 |
2.26 KB |
| #2398 |
SendAsync |
netcoreapp3.1 |
4.38μs |
17.5ns |
67.7ns |
0.0303 |
0 |
0 |
2.16 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
3.49μs |
17.4ns |
75.7ns |
0.225 |
0 |
0 |
1.44 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
3.12μs |
15.1ns |
64ns |
0.0204 |
0 |
0 |
1.52 KB |
| #2398 |
EnrichedLog |
net472 |
3.47μs |
17.2ns |
71.1ns |
0.225 |
0 |
0 |
1.44 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
3.2μs |
15.6ns |
64.2ns |
0.0203 |
0 |
0 |
1.52 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
288μs |
1.17μs |
4.52μs |
0.43 |
0.143 |
0 |
4.31 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
234μs |
732ns |
2.84μs |
0 |
0 |
0 |
4.19 KB |
| #2398 |
EnrichedLog |
net472 |
299μs |
1.55μs |
7.25μs |
0.433 |
0.144 |
0 |
4.31 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
239μs |
1.27μs |
6.85μs |
0 |
0 |
0 |
4.19 KB |
Benchmarks.Trace.NLogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
8.13μs |
41.1ns |
184ns |
0.504 |
0 |
0 |
3.21 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
6.34μs |
34.8ns |
217ns |
0.0484 |
0 |
0 |
3.58 KB |
| #2398 |
EnrichedLog |
net472 |
7.7μs |
38.4ns |
196ns |
0.504 |
0 |
0 |
3.21 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
6.28μs |
29.4ns |
114ns |
0.0495 |
0 |
0 |
3.58 KB |
Benchmarks.Trace.RedisBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendReceive |
net472 |
2.07μs |
6.92ns |
25.9ns |
0.157 |
0 |
0 |
1 KB |
| master |
SendReceive |
netcoreapp3.1 |
1.96μs |
5.56ns |
21.5ns |
0.0134 |
0 |
0 |
1 KB |
| #2398 |
SendReceive |
net472 |
2.11μs |
9.41ns |
48ns |
0.157 |
0 |
0 |
1 KB |
| #2398 |
SendReceive |
netcoreapp3.1 |
1.95μs |
10.4ns |
58.6ns |
0.0142 |
0 |
0 |
1 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
5.92μs |
31ns |
152ns |
0.29 |
0 |
0 |
1.85 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
5.07μs |
25.4ns |
108ns |
0.0199 |
0 |
0 |
1.47 KB |
| #2398 |
EnrichedLog |
net472 |
6.62μs |
20ns |
72.2ns |
0.288 |
0 |
0 |
1.85 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
5.1μs |
15.8ns |
61.4ns |
0.02 |
0 |
0 |
1.47 KB |
Benchmarks.Trace.SpanBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
StartFinishSpan |
net472 |
912ns |
4.13ns |
23.4ns |
0.0703 |
0 |
0 |
449 B |
| master |
StartFinishSpan |
netcoreapp3.1 |
975ns |
4.71ns |
18.3ns |
0.00585 |
0 |
0 |
448 B |
| master |
StartFinishScope |
net472 |
1.1μs |
5.58ns |
25ns |
0.0829 |
0 |
0 |
530 B |
| master |
StartFinishScope |
netcoreapp3.1 |
1.02μs |
3.86ns |
14.9ns |
0.00796 |
0 |
0 |
568 B |
| #2398 |
StartFinishSpan |
net472 |
918ns |
4.42ns |
17.7ns |
0.0707 |
0 |
0 |
449 B |
| #2398 |
StartFinishSpan |
netcoreapp3.1 |
906ns |
4.08ns |
15.8ns |
0.00618 |
0 |
0 |
448 B |
| #2398 |
StartFinishScope |
net472 |
1.06μs |
1.37ns |
4.73ns |
0.0833 |
0 |
0 |
530 B |
| #2398 |
StartFinishScope |
netcoreapp3.1 |
1.04μs |
3.92ns |
15.2ns |
0.00752 |
0 |
0 |
568 B |
Benchmarks Report :snail:
Benchmarks for #2398 compared to master:
- 1 benchmarks are faster, with geometric mean 1.202
- All benchmarks have the same allocations
The following thresholds were used for comparing the benchmark speeds:
- Mann–Whitney U test with statistical test for significance of 5%
- Only results indicating a difference greater than 10% and 0.3 ns are considered.
Allocation changes below 0.5% are ignored.
Benchmark details
Benchmarks.Trace.AgentWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
WriteAndFlushEnrichedTraces |
net472 |
830μs |
2.04μs |
7.06μs |
0 |
0 |
0 |
3.16 KB |
| master |
WriteAndFlushEnrichedTraces |
netcoreapp3.1 |
648μs |
2.45μs |
9.51μs |
0 |
0 |
0 |
2.57 KB |
| #2398 |
WriteAndFlushEnrichedTraces |
net472 |
899μs |
3.62μs |
20.5μs |
0 |
0 |
0 |
3.16 KB |
| #2398 |
WriteAndFlushEnrichedTraces |
netcoreapp3.1 |
647μs |
2.89μs |
11.2μs |
0 |
0 |
0 |
2.57 KB |
Benchmarks.Trace.AspNetCoreBenchmark - Unknown :shrug: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendRequest |
net472 |
0ns |
0ns |
0ns |
0 |
0 |
0 |
0 b |
| master |
SendRequest |
netcoreapp3.1 |
285μs |
1.05μs |
4.07μs |
0.145 |
0 |
0 |
19.67 KB |
| #2398 |
SendRequest |
net472 |
0ns |
0ns |
0ns |
0 |
0 |
0 |
0 b |
| #2398 |
SendRequest |
netcoreapp3.1 |
296μs |
1.25μs |
4.83μs |
0.144 |
0 |
0 |
19.67 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
ExecuteNonQuery |
net472 |
1.57μs |
7.52ns |
29.1ns |
0.093 |
0.000781 |
0 |
586 B |
| master |
ExecuteNonQuery |
netcoreapp3.1 |
1.43μs |
5.47ns |
21.2ns |
0.00864 |
0 |
0 |
624 B |
| #2398 |
ExecuteNonQuery |
net472 |
1.58μs |
5.45ns |
20.4ns |
0.0925 |
0.000777 |
0 |
586 B |
| #2398 |
ExecuteNonQuery |
netcoreapp3.1 |
1.43μs |
7.14ns |
29.4ns |
0.00847 |
0 |
0 |
624 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
CallElasticsearch |
net472 |
2.39μs |
12.3ns |
56.3ns |
0.124 |
0 |
0 |
794 B |
| master |
CallElasticsearch |
netcoreapp3.1 |
1.57μs |
5.42ns |
20.3ns |
0.0107 |
0 |
0 |
784 B |
| master |
CallElasticsearchAsync |
net472 |
2.51μs |
13.8ns |
76.7ns |
0.146 |
0 |
0 |
931 B |
| master |
CallElasticsearchAsync |
netcoreapp3.1 |
1.77μs |
9.33ns |
50.2ns |
0.0126 |
0 |
0 |
904 B |
| #2398 |
CallElasticsearch |
net472 |
2.44μs |
14ns |
113ns |
0.125 |
0 |
0 |
794 B |
| #2398 |
CallElasticsearch |
netcoreapp3.1 |
1.59μs |
6.05ns |
21.8ns |
0.0111 |
0 |
0 |
784 B |
| #2398 |
CallElasticsearchAsync |
net472 |
2.49μs |
13.8ns |
87.2ns |
0.146 |
0 |
0 |
931 B |
| #2398 |
CallElasticsearchAsync |
netcoreapp3.1 |
1.82μs |
4.16ns |
15ns |
0.0124 |
0 |
0 |
904 B |
Benchmarks.Trace.GraphQLBenchmark - Faster :tada: Same allocations :heavy_check_mark:
Faster :tada: in #2398
| Benchmark |
base/diff |
Base Median (ns) |
Diff Median (ns) |
Modality |
| Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net472 |
1.202 |
3,227.23 |
2,685.38 |
|
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
ExecuteAsync |
net472 |
3.23μs |
16.1ns |
68.5ns |
0.164 |
0 |
0 |
1.05 KB |
| master |
ExecuteAsync |
netcoreapp3.1 |
1.88μs |
6.75ns |
25.2ns |
0.0139 |
0 |
0 |
1.02 KB |
| #2398 |
ExecuteAsync |
net472 |
2.7μs |
12.5ns |
68.7ns |
0.165 |
0 |
0 |
1.05 KB |
| #2398 |
ExecuteAsync |
netcoreapp3.1 |
2μs |
9.13ns |
35.4ns |
0.0142 |
0 |
0 |
1.02 KB |
Benchmarks.Trace.HttpClientBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendAsync |
net472 |
6.25μs |
32ns |
160ns |
0.353 |
0 |
0 |
2.26 KB |
| master |
SendAsync |
netcoreapp3.1 |
4.67μs |
17.2ns |
64.3ns |
0.03 |
0 |
0 |
2.16 KB |
| #2398 |
SendAsync |
net472 |
6.2μs |
22.6ns |
87.7ns |
0.353 |
0 |
0 |
2.26 KB |
| #2398 |
SendAsync |
netcoreapp3.1 |
4.39μs |
15ns |
58ns |
0.0307 |
0 |
0 |
2.16 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
3.49μs |
17.4ns |
75.7ns |
0.225 |
0 |
0 |
1.44 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
3.12μs |
15.1ns |
64ns |
0.0204 |
0 |
0 |
1.52 KB |
| #2398 |
EnrichedLog |
net472 |
3.47μs |
15ns |
58ns |
0.226 |
0 |
0 |
1.44 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
3.14μs |
14.2ns |
53ns |
0.0212 |
0 |
0 |
1.52 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
288μs |
1.17μs |
4.52μs |
0.43 |
0.143 |
0 |
4.31 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
234μs |
732ns |
2.84μs |
0 |
0 |
0 |
4.19 KB |
| #2398 |
EnrichedLog |
net472 |
291μs |
1.27μs |
4.93μs |
0.426 |
0.142 |
0 |
4.31 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
243μs |
1.06μs |
4.1μs |
0 |
0 |
0 |
4.19 KB |
Benchmarks.Trace.NLogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
8.13μs |
41.1ns |
184ns |
0.504 |
0 |
0 |
3.21 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
6.34μs |
34.8ns |
217ns |
0.0484 |
0 |
0 |
3.58 KB |
| #2398 |
EnrichedLog |
net472 |
7.73μs |
41.5ns |
231ns |
0.501 |
0 |
0 |
3.21 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
6.2μs |
18ns |
69.6ns |
0.0494 |
0 |
0 |
3.58 KB |
Benchmarks.Trace.RedisBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendReceive |
net472 |
2.07μs |
6.92ns |
25.9ns |
0.157 |
0 |
0 |
1 KB |
| master |
SendReceive |
netcoreapp3.1 |
1.96μs |
5.56ns |
21.5ns |
0.0134 |
0 |
0 |
1 KB |
| #2398 |
SendReceive |
net472 |
2.06μs |
9.32ns |
36.1ns |
0.158 |
0 |
0 |
1 KB |
| #2398 |
SendReceive |
netcoreapp3.1 |
1.95μs |
8.71ns |
33.7ns |
0.0133 |
0 |
0 |
1 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
5.92μs |
31ns |
152ns |
0.29 |
0 |
0 |
1.85 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
5.07μs |
25.4ns |
108ns |
0.0199 |
0 |
0 |
1.47 KB |
| #2398 |
EnrichedLog |
net472 |
6.67μs |
27.3ns |
106ns |
0.288 |
0 |
0 |
1.85 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
5.16μs |
24.6ns |
135ns |
0.02 |
0 |
0 |
1.47 KB |
Benchmarks.Trace.SpanBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
StartFinishSpan |
net472 |
912ns |
4.13ns |
23.4ns |
0.0703 |
0 |
0 |
449 B |
| master |
StartFinishSpan |
netcoreapp3.1 |
975ns |
4.71ns |
18.3ns |
0.00585 |
0 |
0 |
448 B |
| master |
StartFinishScope |
net472 |
1.1μs |
5.58ns |
25ns |
0.0829 |
0 |
0 |
530 B |
| master |
StartFinishScope |
netcoreapp3.1 |
1.02μs |
3.86ns |
14.9ns |
0.00796 |
0 |
0 |
568 B |
| #2398 |
StartFinishSpan |
net472 |
896ns |
3.74ns |
14.5ns |
0.0706 |
0 |
0 |
449 B |
| #2398 |
StartFinishSpan |
netcoreapp3.1 |
901ns |
4.35ns |
17.4ns |
0.00619 |
0 |
0 |
448 B |
| #2398 |
StartFinishScope |
net472 |
1.11μs |
5.88ns |
30.5ns |
0.0832 |
0 |
0 |
530 B |
| #2398 |
StartFinishScope |
netcoreapp3.1 |
1.02μs |
3.63ns |
13.6ns |
0.00778 |
0 |
0 |
568 B |
Benchmarks Report :snail:
Benchmarks for #2398 compared to master:
- 1 benchmarks are faster, with geometric mean 1.237
- All benchmarks have the same allocations
The following thresholds were used for comparing the benchmark speeds:
- Mann–Whitney U test with statistical test for significance of 5%
- Only results indicating a difference greater than 10% and 0.3 ns are considered.
Allocation changes below 0.5% are ignored.
Benchmark details
Benchmarks.Trace.AgentWriterBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
WriteAndFlushEnrichedTraces |
net472 |
847μs |
3.22μs |
12.5μs |
0 |
0 |
0 |
3.16 KB |
| master |
WriteAndFlushEnrichedTraces |
netcoreapp3.1 |
662μs |
3.03μs |
12.1μs |
0 |
0 |
0 |
2.57 KB |
| #2398 |
WriteAndFlushEnrichedTraces |
net472 |
846μs |
2.2μs |
8.24μs |
0 |
0 |
0 |
3.16 KB |
| #2398 |
WriteAndFlushEnrichedTraces |
netcoreapp3.1 |
670μs |
2.86μs |
11.1μs |
0 |
0 |
0 |
2.57 KB |
Benchmarks.Trace.AspNetCoreBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendRequest |
net472 |
0ns |
0ns |
0ns |
0 |
0 |
0 |
0 b |
| master |
SendRequest |
netcoreapp3.1 |
306μs |
1.6μs |
7.68μs |
0.148 |
0 |
0 |
19.67 KB |
| #2398 |
SendRequest |
net472 |
0ns |
0ns |
0ns |
0 |
0 |
0 |
0 b |
| #2398 |
SendRequest |
netcoreapp3.1 |
299μs |
1.45μs |
7.54μs |
0.287 |
0 |
0 |
19.67 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
ExecuteNonQuery |
net472 |
1.69μs |
7.32ns |
27.4ns |
0.0924 |
0.000889 |
0 |
586 B |
| master |
ExecuteNonQuery |
netcoreapp3.1 |
1.42μs |
5.34ns |
20ns |
0.00854 |
0 |
0 |
624 B |
| #2398 |
ExecuteNonQuery |
net472 |
1.65μs |
4.74ns |
16.4ns |
0.0925 |
0.000889 |
0 |
586 B |
| #2398 |
ExecuteNonQuery |
netcoreapp3.1 |
1.42μs |
5.66ns |
21.9ns |
0.00856 |
0 |
0 |
624 B |
Benchmarks.Trace.ElasticsearchBenchmark - Faster :tada: Same allocations :heavy_check_mark:
Faster :tada: in #2398
| Benchmark |
base/diff |
Base Median (ns) |
Diff Median (ns) |
Modality |
| Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net472 |
1.237 |
3,084.56 |
2,494.06 |
|
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
CallElasticsearch |
net472 |
2.31μs |
10.3ns |
39.8ns |
0.124 |
0 |
0 |
794 B |
| master |
CallElasticsearch |
netcoreapp3.1 |
1.64μs |
5.69ns |
22ns |
0.0108 |
0 |
0 |
784 B |
| master |
CallElasticsearchAsync |
net472 |
3.1μs |
14.1ns |
54.7ns |
0.146 |
0 |
0 |
931 B |
| master |
CallElasticsearchAsync |
netcoreapp3.1 |
1.71μs |
4.64ns |
16.7ns |
0.0128 |
0 |
0 |
904 B |
| #2398 |
CallElasticsearch |
net472 |
2.29μs |
8.91ns |
34.5ns |
0.125 |
0 |
0 |
794 B |
| #2398 |
CallElasticsearch |
netcoreapp3.1 |
1.57μs |
5.41ns |
20.3ns |
0.0105 |
0 |
0 |
784 B |
| #2398 |
CallElasticsearchAsync |
net472 |
2.51μs |
7.93ns |
30.7ns |
0.145 |
0 |
0 |
931 B |
| #2398 |
CallElasticsearchAsync |
netcoreapp3.1 |
1.74μs |
7.87ns |
30.5ns |
0.0121 |
0 |
0 |
904 B |
Benchmarks.Trace.GraphQLBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
ExecuteAsync |
net472 |
2.74μs |
13.5ns |
60.4ns |
0.164 |
0 |
0 |
1.05 KB |
| master |
ExecuteAsync |
netcoreapp3.1 |
1.93μs |
9.99ns |
51.9ns |
0.0135 |
0 |
0 |
1.02 KB |
| #2398 |
ExecuteAsync |
net472 |
2.77μs |
10.4ns |
40.2ns |
0.164 |
0 |
0 |
1.05 KB |
| #2398 |
ExecuteAsync |
netcoreapp3.1 |
1.88μs |
4.14ns |
16ns |
0.0147 |
0 |
0 |
1.02 KB |
Benchmarks.Trace.HttpClientBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendAsync |
net472 |
6.3μs |
30ns |
116ns |
0.354 |
0 |
0 |
2.26 KB |
| master |
SendAsync |
netcoreapp3.1 |
4.28μs |
21.5ns |
91.3ns |
0.0301 |
0 |
0 |
2.16 KB |
| #2398 |
SendAsync |
net472 |
5.92μs |
26.7ns |
99.9ns |
0.352 |
0 |
0 |
2.26 KB |
| #2398 |
SendAsync |
netcoreapp3.1 |
4.31μs |
17.2ns |
66.8ns |
0.0299 |
0 |
0 |
2.16 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
3.47μs |
14.7ns |
56.8ns |
0.224 |
0 |
0 |
1.44 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
3.22μs |
18.4ns |
135ns |
0.0215 |
0 |
0 |
1.52 KB |
| #2398 |
EnrichedLog |
net472 |
3.29μs |
16.2ns |
66.7ns |
0.226 |
0 |
0 |
1.44 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
3.1μs |
12.1ns |
46.9ns |
0.0209 |
0 |
0 |
1.52 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
290μs |
1.54μs |
8.15μs |
0.447 |
0.149 |
0 |
4.31 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
230μs |
1.07μs |
3.99μs |
0 |
0 |
0 |
4.19 KB |
| #2398 |
EnrichedLog |
net472 |
295μs |
768ns |
2.98μs |
0.441 |
0.147 |
0 |
4.31 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
239μs |
1.15μs |
4.46μs |
0 |
0 |
0 |
4.19 KB |
Benchmarks.Trace.NLogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
7.51μs |
35.9ns |
143ns |
0.503 |
0 |
0 |
3.21 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
6.35μs |
21ns |
81.3ns |
0.0471 |
0 |
0 |
3.58 KB |
| #2398 |
EnrichedLog |
net472 |
7.85μs |
44.6ns |
306ns |
0.504 |
0 |
0 |
3.21 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
6.38μs |
28.3ns |
110ns |
0.0479 |
0 |
0 |
3.58 KB |
Benchmarks.Trace.RedisBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
SendReceive |
net472 |
2.12μs |
7.45ns |
28.9ns |
0.157 |
0 |
0 |
1 KB |
| master |
SendReceive |
netcoreapp3.1 |
1.92μs |
9.55ns |
39.4ns |
0.0137 |
0 |
0 |
1 KB |
| #2398 |
SendReceive |
net472 |
2.14μs |
8.7ns |
33.7ns |
0.157 |
0 |
0 |
1 KB |
| #2398 |
SendReceive |
netcoreapp3.1 |
1.99μs |
5.6ns |
20.9ns |
0.014 |
0 |
0 |
1 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
EnrichedLog |
net472 |
5.99μs |
32.5ns |
198ns |
0.289 |
0 |
0 |
1.85 KB |
| master |
EnrichedLog |
netcoreapp3.1 |
5.27μs |
26.2ns |
120ns |
0.0199 |
0 |
0 |
1.47 KB |
| #2398 |
EnrichedLog |
net472 |
6.34μs |
17.9ns |
69.4ns |
0.288 |
0 |
0 |
1.85 KB |
| #2398 |
EnrichedLog |
netcoreapp3.1 |
5.06μs |
20.5ns |
76.9ns |
0.02 |
0 |
0 |
1.47 KB |
Benchmarks.Trace.SpanBenchmark - Same speed :heavy_check_mark: Same allocations :heavy_check_mark:
Raw results
| Branch |
Method |
Toolchain |
Mean |
StdError |
StdDev |
Gen 0 |
Gen 1 |
Gen 2 |
Allocated |
| master |
StartFinishSpan |
net472 |
940ns |
3.42ns |
12.8ns |
0.0703 |
0 |
0 |
449 B |
| master |
StartFinishSpan |
netcoreapp3.1 |
940ns |
5.09ns |
27.4ns |
0.00599 |
0 |
0 |
448 B |
| master |
StartFinishScope |
net472 |
1.08μs |
2.81ns |
9.72ns |
0.0833 |
0 |
0 |
530 B |
| master |
StartFinishScope |
netcoreapp3.1 |
1.1μs |
5.09ns |
19.7ns |
0.00757 |
0 |
0 |
568 B |
| #2398 |
StartFinishSpan |
net472 |
905ns |
1.75ns |
6.06ns |
0.0704 |
0 |
0 |
449 B |
| #2398 |
StartFinishSpan |
netcoreapp3.1 |
888ns |
4.27ns |
16.6ns |
0.00605 |
0 |
0 |
448 B |
| #2398 |
StartFinishScope |
net472 |
1.14μs |
6.42ns |
42.6ns |
0.0833 |
0 |
0 |
530 B |
| #2398 |
StartFinishScope |
netcoreapp3.1 |
1.04μs |
5.11ns |
20.5ns |
0.00805 |
0 |
0 |
568 B |
@zacharycmontoya, what is the status of this work? Can we close this PR?
@zacharycmontoya, what is the status of this work? Can we close this PR?
We can close this. We don't have a desire to support this at this time unless we have a strong need for it.