-
Notifications
You must be signed in to change notification settings - Fork 145
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
Pack trimming file in Datadog.Trace NuGet, and add trimming smoke tests for the NuGet packages #6678
Pack trimming file in Datadog.Trace NuGet, and add trimming smoke tests for the NuGet packages #6678
Conversation
Co-authored-by: Kevin Gosse <kevin.gosse@datadoghq.com>
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 (6678) - mean (69ms) : 65, 72
. : milestone, 69,
master - mean (71ms) : 61, 80
. : milestone, 71,
section CallTarget+Inlining+NGEN
This PR (6678) - mean (996ms) : 973, 1018
. : milestone, 996,
master - mean (996ms) : 966, 1026
. : milestone, 996,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6678) - mean (102ms) : 99, 104
. : milestone, 102,
master - mean (102ms) : 100, 104
. : milestone, 102,
section CallTarget+Inlining+NGEN
This PR (6678) - mean (672ms) : 656, 687
. : milestone, 672,
master - mean (675ms) : 658, 692
. : milestone, 675,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6678) - mean (89ms) : 87, 91
. : milestone, 89,
master - mean (88ms) : 87, 90
. : milestone, 88,
section CallTarget+Inlining+NGEN
This PR (6678) - mean (626ms) : 607, 645
. : milestone, 626,
master - mean (629ms) : 613, 645
. : milestone, 629,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6678) - mean (191ms) : 187, 195
. : milestone, 191,
master - mean (191ms) : 187, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6678) - mean (1,107ms) : 1082, 1132
. : milestone, 1107,
master - mean (1,109ms) : 1083, 1136
. : milestone, 1109,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6678) - mean (271ms) : 266, 276
. : milestone, 271,
master - mean (271ms) : 267, 276
. : milestone, 271,
section CallTarget+Inlining+NGEN
This PR (6678) - mean (866ms) : 838, 894
. : milestone, 866,
master - mean (868ms) : 834, 901
. : milestone, 868,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6678) - mean (263ms) : 259, 267
. : milestone, 263,
master - mean (263ms) : 258, 267
. : milestone, 263,
section CallTarget+Inlining+NGEN
This PR (6678) - mean (840ms) : 808, 872
. : milestone, 840,
master - mean (847ms) : 814, 881
. : milestone, 847,
|
Benchmarks Report for tracer 🐌Benchmarks for #6678 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 - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 | 1.119 | 545.05 | 487.30 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 426ns | 0.495ns | 1.92ns | 0.00815 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 571ns | 0.757ns | 2.73ns | 0.00774 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 621ns | 1.14ns | 4.27ns | 0.0918 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 546ns | 1.2ns | 4.65ns | 0.00971 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 677ns | 1.26ns | 4.71ns | 0.00938 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 902ns | 2.37ns | 9.19ns | 0.104 | 0 | 0 | 658 B |
#6678 | StartFinishSpan |
net6.0 | 458ns | 0.362ns | 1.4ns | 0.00801 | 0 | 0 | 576 B |
#6678 | StartFinishSpan |
netcoreapp3.1 | 612ns | 0.582ns | 2.25ns | 0.00793 | 0 | 0 | 576 B |
#6678 | StartFinishSpan |
net472 | 587ns | 0.432ns | 1.62ns | 0.0918 | 0 | 0 | 578 B |
#6678 | StartFinishScope |
net6.0 | 486ns | 0.85ns | 3.29ns | 0.00976 | 0 | 0 | 696 B |
#6678 | StartFinishScope |
netcoreapp3.1 | 726ns | 1.99ns | 7.7ns | 0.00914 | 0 | 0 | 696 B |
#6678 | StartFinishScope |
net472 | 860ns | 0.646ns | 2.5ns | 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 | 632ns | 1.06ns | 4.1ns | 0.00982 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 892ns | 1.54ns | 5.78ns | 0.00948 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.09μs | 3.31ns | 12.8ns | 0.104 | 0 | 0 | 658 B |
#6678 | RunOnMethodBegin |
net6.0 | 660ns | 0.551ns | 2.14ns | 0.00971 | 0 | 0 | 696 B |
#6678 | RunOnMethodBegin |
netcoreapp3.1 | 874ns | 0.479ns | 1.85ns | 0.00921 | 0 | 0 | 696 B |
#6678 | RunOnMethodBegin |
net472 | 1.05μs | 0.667ns | 2.58ns | 0.104 | 0 | 0 | 658 B |
Summary of changes
Reason for change
When users are building trimmed (non-aot) apps, they need to reference our trimming file, which is currently exposed via the Datadog.Trace.Trimming NuGet package. We created this as a separate package, because we didn't want people to have to reference the Datadog.Trace NuGet if they didn't need it.
However, there's not really a good reason to force people to have to reference another NuGet package if they are already referencing Datadog.Trace. And there's no harm in including the trimming file for non-trimmed apps, it has no impact.
Implementation details
props
are correctly added etc.sdk/sdk.props
file from Datadog.Trace.Trimming as it's unused. This file is only useful if you're creating a "custom .NET SDK" to reference in the<Project SDK="Some.SDK">
element (which we're not).Test coverage
Added smoke tests to confirm both the Datadog.Trace and Datadog.Trace.Trimming packages work as expected. For now, these are:
linux-x64
/linux-musl-x64
onlynet8.0
/net9.0
onlyWe could expand that further if we want, but I'm not massively inclined to do so - we primarily want to ensure the packages are valid, and we don't really need to run that across all the different platforms IMO. Plus it will just increase the chance of flake.
Other details
As part of this, noticed that crash tracking didn't work.
I've kept these in the "standard, every PR" set of smoke tests for now, but maybe we should move them to the master-only set? 🤷♂️