DataDog / dd-trace-dotnet

.NET Client Library for Datadog APM
https://docs.datadoghq.com/tracing/
Apache License 2.0
456 stars 142 forks source link

Use a native logger for critical failures in the loader #5929

Closed kevingosse closed 2 months ago

kevingosse commented 2 months ago

Summary of changes

Wrap the call to the managed loader in a try/catch, and use a native logger to log the exception if any.

Reason for change

There's already a try/catch in the managed loader, but in some situations we can fail before even getting there (if jitting the method failed, for instance because of a trimmed runtime). Also, the managed loader logger can fail.

Implementation details

This PR adds a try/catch in the code emitted to load the managed loader. In the catch clause, we call a native logging function, with a direct unmanaged calli call to its address.

Because we have now this outer catch block, I removed the IsInSsi logic which isn't needed anymore.

andrewlock commented 2 months ago

Execution-Time Benchmarks Report :stopwatch:

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).

datadog-ddstaging[bot] commented 2 months ago

Datadog Report

Branch report: kevin/error_loader Commit report: 4b29f0a Test service: dd-trace-dotnet

:white_check_mark: 0 Failed, 306654 Passed, 2349 Skipped, 22h 2m 18.67s Total Time

andrewlock commented 2 months ago

Benchmarks Report for tracer :snail:

Benchmarks for #5929 compared to master:

The following thresholds were used for comparing the benchmark speeds:

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartStopWithChild`|net6.0|8.01μs|45.4ns|301ns|0.0157| 0.00785|0|5.43 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartStopWithChild`|netcoreapp3.1|9.9μs|49.7ns|217ns|0.0146| 0.00485|0|5.62 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartStopWithChild`|net472|16.1μs|50.3ns|195ns|1.04| 0.326|0.103|6.06 KB| |#5929|`StartStopWithChild`|net6.0|7.81μs|43.8ns|277ns|0.0115| 0.00767|0|5.42 KB| |#5929|`StartStopWithChild`|netcoreapp3.1|9.77μs|54.6ns|337ns|0.0236| 0.00944|0|5.61 KB| |#5929|`StartStopWithChild`|net472|16μs|49.4ns|185ns|1.01| 0.298|0.0966|6.07 KB|
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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`WriteAndFlushEnrichedTraces`|net6.0|509μs|344ns|1.24μs|0| 0|0|2.7 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|642μs|237ns|885ns|0| 0|0|2.7 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`WriteAndFlushEnrichedTraces`|net472|861μs|558ns|2.09μs|0.428| 0|0|3.3 KB| |#5929|`WriteAndFlushEnrichedTraces`|net6.0|466μs|168ns|630ns|0| 0|0|2.7 KB| |#5929|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|624μs|214ns|799ns|0| 0|0|2.7 KB| |#5929|`WriteAndFlushEnrichedTraces`|net472|843μs|589ns|2.28μs|0.422| 0|0|3.3 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendRequest`|net6.0|185μs|1.06μs|7.39μs|0.183| 0|0|18.45 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendRequest`|netcoreapp3.1|214μs|1.1μs|6.7μs|0.204| 0|0|20.61 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendRequest`|net472|0.000732ns|0.000431ns|0.00161ns|0| 0|0|0 b| |#5929|`SendRequest`|net6.0|189μs|1.05μs|6.88μs|0.179| 0|0|18.45 KB| |#5929|`SendRequest`|netcoreapp3.1|212μs|1.12μs|7.71μs|0.209| 0|0|20.61 KB| |#5929|`SendRequest`|net472|0.000939ns|0.000452ns|0.00175ns|0| 0|0|0 b|
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`WriteAndFlushEnrichedTraces`|net6.0|564μs|3.25μs|25.8μs|0.551| 0|0|41.6 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|694μs|3.58μs|16.4μs|0.355| 0|0|41.83 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`WriteAndFlushEnrichedTraces`|net472|865μs|3.58μs|13.9μs|8.13| 2.57|0.428|53.3 KB| |#5929|`WriteAndFlushEnrichedTraces`|net6.0|543μs|2.31μs|8.65μs|0.561| 0|0|41.64 KB| |#5929|`WriteAndFlushEnrichedTraces`|netcoreapp3.1|692μs|2.74μs|10.3μs|0.353| 0|0|41.75 KB| |#5929|`WriteAndFlushEnrichedTraces`|net472|884μs|2.26μs|8.74μs|8.13| 2.57|0.428|53.31 KB|
Benchmarks.Trace.DbCommandBenchmark - Faster :tada: Same allocations :heavy_check_mark: #### Faster :tada: in #5929 | Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality | |:----------|-----------:|-----------:|--------:|--------:| | Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 | 1.121 | 1,315.94 | 1,173.53 | ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`ExecuteNonQuery`|net6.0|1.32μs|1.49ns|5.75ns|0.0144| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`ExecuteNonQuery`|netcoreapp3.1|1.67μs|1.14ns|4.42ns|0.0135| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`ExecuteNonQuery`|net472|2.03μs|1.88ns|7.05ns|0.157| 0|0|987 B| |#5929|`ExecuteNonQuery`|net6.0|1.17μs|1.31ns|5.06ns|0.0141| 0|0|1.02 KB| |#5929|`ExecuteNonQuery`|netcoreapp3.1|1.65μs|1.21ns|4.67ns|0.0132| 0|0|1.02 KB| |#5929|`ExecuteNonQuery`|net472|1.94μs|2.67ns|10.3ns|0.156| 0|0|987 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`CallElasticsearch`|net6.0|1.21μs|1.88ns|7.02ns|0.0135| 0|0|976 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`CallElasticsearch`|netcoreapp3.1|1.49μs|0.988ns|3.83ns|0.0135| 0|0|976 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`CallElasticsearch`|net472|2.49μs|1.67ns|6.45ns|0.158| 0|0|995 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`CallElasticsearchAsync`|net6.0|1.35μs|0.614ns|2.3ns|0.0135| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`CallElasticsearchAsync`|netcoreapp3.1|1.63μs|0.668ns|2.5ns|0.0138| 0|0|1.02 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`CallElasticsearchAsync`|net472|2.58μs|3.29ns|12.7ns|0.166| 0|0|1.05 KB| |#5929|`CallElasticsearch`|net6.0|1.27μs|0.818ns|3.17ns|0.0135| 0|0|976 B| |#5929|`CallElasticsearch`|netcoreapp3.1|1.57μs|0.758ns|2.84ns|0.0127| 0|0|976 B| |#5929|`CallElasticsearch`|net472|2.43μs|1.79ns|6.69ns|0.157| 0.00122|0|995 B| |#5929|`CallElasticsearchAsync`|net6.0|1.32μs|0.504ns|1.95ns|0.0132| 0|0|952 B| |#5929|`CallElasticsearchAsync`|netcoreapp3.1|1.58μs|0.724ns|2.71ns|0.0144| 0|0|1.02 KB| |#5929|`CallElasticsearchAsync`|net472|2.65μs|2.08ns|7.5ns|0.166| 0.00133|0|1.05 KB|
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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`ExecuteAsync`|net6.0|1.33μs|1.13ns|4.06ns|0.0134| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`ExecuteAsync`|netcoreapp3.1|1.51μs|0.745ns|2.89ns|0.0127| 0|0|952 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`ExecuteAsync`|net472|1.81μs|1.35ns|5.24ns|0.145| 0|0|915 B| |#5929|`ExecuteAsync`|net6.0|1.28μs|0.781ns|3.02ns|0.0129| 0|0|952 B| |#5929|`ExecuteAsync`|netcoreapp3.1|1.56μs|0.653ns|2.35ns|0.0125| 0|0|952 B| |#5929|`ExecuteAsync`|net472|1.72μs|1.36ns|5.25ns|0.145| 0|0|915 B|
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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendAsync`|net6.0|4.19μs|1.91ns|7.41ns|0.0313| 0|0|2.22 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendAsync`|netcoreapp3.1|5.06μs|1.56ns|5.83ns|0.0377| 0|0|2.76 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendAsync`|net472|7.79μs|2.13ns|8.25ns|0.498| 0|0|3.15 KB| |#5929|`SendAsync`|net6.0|4.13μs|1.6ns|5.77ns|0.0309| 0|0|2.22 KB| |#5929|`SendAsync`|netcoreapp3.1|5.24μs|3.76ns|14.6ns|0.0366| 0|0|2.76 KB| |#5929|`SendAsync`|net472|7.75μs|2.28ns|8.85ns|0.497| 0|0|3.15 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|net6.0|1.64μs|0.963ns|3.6ns|0.023| 0|0|1.64 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|netcoreapp3.1|2.01μs|0.896ns|3.35ns|0.0222| 0|0|1.64 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|net472|2.72μs|2.69ns|10.4ns|0.249| 0|0|1.57 KB| |#5929|`EnrichedLog`|net6.0|1.53μs|1.09ns|4.21ns|0.023| 0|0|1.64 KB| |#5929|`EnrichedLog`|netcoreapp3.1|2.2μs|1.54ns|5.95ns|0.0218| 0|0|1.64 KB| |#5929|`EnrichedLog`|net472|2.72μs|1.68ns|6.52ns|0.249| 0|0|1.57 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|net6.0|115μs|285ns|1.11μs|0.0567| 0|0|4.28 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|netcoreapp3.1|119μs|223ns|833ns|0.0597| 0|0|4.28 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|net472|149μs|155ns|601ns|0.667| 0.222|0|4.46 KB| |#5929|`EnrichedLog`|net6.0|114μs|282ns|1.09μs|0.0573| 0|0|4.28 KB| |#5929|`EnrichedLog`|netcoreapp3.1|120μs|354ns|1.37μs|0| 0|0|4.28 KB| |#5929|`EnrichedLog`|net472|150μs|191ns|738ns|0.673| 0.224|0|4.46 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|net6.0|3.08μs|0.724ns|2.71ns|0.0309| 0|0|2.2 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|netcoreapp3.1|4.25μs|1.81ns|7.03ns|0.0297| 0|0|2.2 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|net472|4.83μs|0.936ns|3.38ns|0.319| 0|0|2.02 KB| |#5929|`EnrichedLog`|net6.0|3.11μs|1.15ns|4.47ns|0.0311| 0|0|2.2 KB| |#5929|`EnrichedLog`|netcoreapp3.1|4.19μs|2.11ns|7.88ns|0.0292| 0|0|2.2 KB| |#5929|`EnrichedLog`|net472|4.94μs|0.844ns|3.16ns|0.32| 0|0|2.02 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendReceive`|net6.0|1.42μs|0.767ns|2.97ns|0.0162| 0|0|1.14 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendReceive`|netcoreapp3.1|1.77μs|1.32ns|4.95ns|0.015| 0|0|1.14 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`SendReceive`|net472|2.2μs|1.69ns|6.53ns|0.184| 0|0|1.16 KB| |#5929|`SendReceive`|net6.0|1.31μs|1.09ns|4.22ns|0.0157| 0|0|1.14 KB| |#5929|`SendReceive`|netcoreapp3.1|1.76μs|1.93ns|7.48ns|0.015| 0|0|1.14 KB| |#5929|`SendReceive`|net472|2.22μs|1.6ns|5.97ns|0.184| 0.00111|0|1.16 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|net6.0|2.76μs|1.38ns|4.78ns|0.0221| 0|0|1.6 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|netcoreapp3.1|3.95μs|1.17ns|4.53ns|0.0219| 0|0|1.65 KB| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`EnrichedLog`|net472|4.6μs|1.63ns|6.33ns|0.322| 0|0|2.04 KB| |#5929|`EnrichedLog`|net6.0|2.84μs|1.27ns|4.94ns|0.0224| 0|0|1.6 KB| |#5929|`EnrichedLog`|netcoreapp3.1|3.96μs|0.756ns|2.72ns|0.0216| 0|0|1.65 KB| |#5929|`EnrichedLog`|net472|4.46μs|2.76ns|10.7ns|0.324| 0|0|2.04 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](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartFinishSpan`|net6.0|400ns|0.675ns|2.61ns|0.00802| 0|0|576 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartFinishSpan`|netcoreapp3.1|547ns|1.85ns|6.69ns|0.00772| 0|0|576 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartFinishSpan`|net472|660ns|0.227ns|0.878ns|0.0916| 0|0|578 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartFinishScope`|net6.0|513ns|0.596ns|2.31ns|0.00981| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartFinishScope`|netcoreapp3.1|741ns|0.291ns|1.13ns|0.00933| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`StartFinishScope`|net472|859ns|0.632ns|2.36ns|0.104| 0|0|658 B| |#5929|`StartFinishSpan`|net6.0|395ns|0.255ns|0.988ns|0.0081| 0|0|576 B| |#5929|`StartFinishSpan`|netcoreapp3.1|559ns|0.238ns|0.89ns|0.00783| 0|0|576 B| |#5929|`StartFinishSpan`|net472|596ns|0.41ns|1.59ns|0.0917| 0|0|578 B| |#5929|`StartFinishScope`|net6.0|498ns|0.17ns|0.658ns|0.00976| 0|0|696 B| |#5929|`StartFinishScope`|netcoreapp3.1|813ns|0.53ns|2.05ns|0.00939| 0|0|696 B| |#5929|`StartFinishScope`|net472|833ns|0.969ns|3.75ns|0.104| 0|0|658 B|
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster :tada: Same allocations :heavy_check_mark: #### Faster :tada: in #5929 | Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality | |:----------|-----------:|-----------:|--------:|--------:| | Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 | 1.128 | 673.62 | 597.22 | ### Raw results | Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated | |---------|---------------------------- |-------------- |---------:|---------:|--------:|-------:|------:|------:|----------:| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`RunOnMethodBegin`|net6.0|673ns|0.659ns|2.38ns|0.00958| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`RunOnMethodBegin`|netcoreapp3.1|942ns|0.427ns|1.65ns|0.00901| 0|0|696 B| |[master](https://github.com/DataDog/dd-trace-dotnet/tree/066e2ef6ea2a8b6638bad8aebb28ce10e063f2b7)|`RunOnMethodBegin`|net472|1.12μs|1.54ns|5.55ns|0.104| 0|0|658 B| |#5929|`RunOnMethodBegin`|net6.0|597ns|0.373ns|1.44ns|0.00959| 0|0|696 B| |#5929|`RunOnMethodBegin`|netcoreapp3.1|922ns|0.541ns|2.09ns|0.00928| 0|0|696 B| |#5929|`RunOnMethodBegin`|net472|1.08μs|0.198ns|0.766ns|0.104| 0|0|658 B|