-
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
Stop using current_path in the native loader #6132
Conversation
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.
Worth a try 🤞 Started a run that tests all installer tests here
@@ -128,9 +124,9 @@ namespace datadog::shared::nativeloader | |||
{ | |||
// Convert possible relative paths to absolute paths using the configuration file folder as base | |||
// (current_path) | |||
std::string absoluteFilepathValue = fs::absolute(filepathValue).string(); | |||
std::string absoluteFilepathValue = (configFolder / filepathValue).string(); |
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 assume this uses the correct separator for the platform right? win/linux
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.
yes
Log::Debug("DynamicDispatcherImpl::LoadConfiguration: [", type, "] Loading: ", filepathValue, " [AbsolutePath=", absoluteFilepathValue,"] (", currentOsArch, ")" ); | ||
if (fs::exists(absoluteFilepathValue)) | ||
if (fs::exists(absoluteFilepathValue, ec)) |
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 logging the error code? 🤔
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 think that would be interesting in case of a failure
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 (6132) - mean (70ms) : 67, 73
. : milestone, 70,
master - mean (70ms) : 67, 72
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6132) - mean (1,123ms) : 1097, 1148
. : milestone, 1123,
master - mean (1,107ms) : 1090, 1125
. : milestone, 1107,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6132) - mean (109ms) : 105, 112
. : milestone, 109,
master - mean (108ms) : 106, 111
. : milestone, 108,
section CallTarget+Inlining+NGEN
This PR (6132) - mean (770ms) : 752, 787
. : milestone, 770,
master - mean (769ms) : 752, 786
. : milestone, 769,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6132) - mean (94ms) : 83, 105
. : milestone, 94,
master - mean (92ms) : 89, 94
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6132) - mean (764ms) : 571, 957
. : milestone, 764,
master - mean (727ms) : 708, 747
. : milestone, 727,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6132) - mean (190ms) : 187, 193
. : milestone, 190,
master - mean (189ms) : 186, 192
. : milestone, 189,
section CallTarget+Inlining+NGEN
This PR (6132) - mean (1,200ms) : 1174, 1227
. : milestone, 1200,
master - mean (1,194ms) : 1168, 1219
. : milestone, 1194,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6132) - mean (275ms) : 270, 279
. : milestone, 275,
master - mean (275ms) : 270, 280
. : milestone, 275,
section CallTarget+Inlining+NGEN
This PR (6132) - mean (939ms) : 920, 957
. : milestone, 939,
master - mean (942ms) : 925, 958
. : milestone, 942,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6132) - mean (264ms) : 260, 268
. : milestone, 264,
master - mean (262ms) : 259, 266
. : milestone, 262,
section CallTarget+Inlining+NGEN
This PR (6132) - mean (926ms) : 907, 946
. : milestone, 926,
master - mean (922ms) : 904, 939
. : milestone, 922,
|
Datadog ReportBranch report: ✅ 0 Failed, 367890 Passed, 2379 Skipped, 16h 21m 8.85s Total Time |
Benchmarks Report for tracer 🐌Benchmarks for #6132 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 - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 | 1.126 | 1,257.65 | 1,116.98 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.26μs | 1.89ns | 7.32ns | 0.0139 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.54μs | 1.9ns | 7.34ns | 0.0131 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.53μs | 2.33ns | 8.71ns | 0.158 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.33μs | 0.826ns | 3.09ns | 0.0134 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.6μs | 1.07ns | 4ns | 0.0136 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.57μs | 2.23ns | 8.33ns | 0.166 | 0 | 0 | 1.05 KB |
#6132 | CallElasticsearch |
net6.0 | 1.12μs | 3.86ns | 14.4ns | 0.014 | 0 | 0 | 976 B |
#6132 | CallElasticsearch |
netcoreapp3.1 | 1.5μs | 1.42ns | 5.49ns | 0.0127 | 0 | 0 | 976 B |
#6132 | CallElasticsearch |
net472 | 2.52μs | 2.89ns | 11.2ns | 0.158 | 0 | 0 | 995 B |
#6132 | CallElasticsearchAsync |
net6.0 | 1.28μs | 3.03ns | 11.3ns | 0.0135 | 0 | 0 | 952 B |
#6132 | CallElasticsearchAsync |
netcoreapp3.1 | 1.62μs | 6.78ns | 26.2ns | 0.0136 | 0 | 0 | 1.02 KB |
#6132 | CallElasticsearchAsync |
net472 | 2.66μs | 2.75ns | 10.6ns | 0.166 | 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.38μs | 1.45ns | 5.44ns | 0.0131 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.61μs | 0.591ns | 2.21ns | 0.013 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.87μs | 1.59ns | 6.15ns | 0.145 | 0 | 0 | 915 B |
#6132 | ExecuteAsync |
net6.0 | 1.37μs | 1.28ns | 4.77ns | 0.013 | 0 | 0 | 952 B |
#6132 | ExecuteAsync |
netcoreapp3.1 | 1.63μs | 0.637ns | 2.47ns | 0.0128 | 0 | 0 | 952 B |
#6132 | ExecuteAsync |
net472 | 1.74μs | 0.915ns | 3.54ns | 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.35μs | 2.57ns | 9.25ns | 0.0305 | 0 | 0 | 2.22 KB |
master | SendAsync |
netcoreapp3.1 | 5.12μs | 1.47ns | 5.69ns | 0.0358 | 0 | 0 | 2.76 KB |
master | SendAsync |
net472 | 7.68μs | 1.75ns | 6.77ns | 0.497 | 0 | 0 | 3.15 KB |
#6132 | SendAsync |
net6.0 | 4.17μs | 2.97ns | 11.1ns | 0.0313 | 0 | 0 | 2.22 KB |
#6132 | SendAsync |
netcoreapp3.1 | 5.2μs | 2.68ns | 10.4ns | 0.0363 | 0 | 0 | 2.76 KB |
#6132 | SendAsync |
net472 | 7.8μs | 7.61ns | 29.5ns | 0.498 | 0 | 0 | 3.15 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.45μs | 1.09ns | 3.91ns | 0.0233 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.28μs | 1.09ns | 4.08ns | 0.0217 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.48μs | 1.28ns | 4.77ns | 0.249 | 0 | 0 | 1.57 KB |
#6132 | EnrichedLog |
net6.0 | 1.5μs | 0.826ns | 3.09ns | 0.0233 | 0 | 0 | 1.64 KB |
#6132 | EnrichedLog |
netcoreapp3.1 | 2.24μs | 8.25ns | 31.9ns | 0.0218 | 0 | 0 | 1.64 KB |
#6132 | EnrichedLog |
net472 | 2.48μs | 0.849ns | 3.18ns | 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 | 114μs | 110ns | 426ns | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 119μs | 108ns | 389ns | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 148μs | 106ns | 411ns | 0.663 | 0.221 | 0 | 4.46 KB |
#6132 | EnrichedLog |
net6.0 | 118μs | 174ns | 676ns | 0.0589 | 0 | 0 | 4.28 KB |
#6132 | EnrichedLog |
netcoreapp3.1 | 122μs | 117ns | 422ns | 0.0601 | 0 | 0 | 4.28 KB |
#6132 | EnrichedLog |
net472 | 153μs | 126ns | 488ns | 0.685 | 0.228 | 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.18μs | 11.1ns | 40.1ns | 0.0302 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.22μs | 0.935ns | 3.62ns | 0.0295 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.86μs | 1.99ns | 7.18ns | 0.32 | 0 | 0 | 2.02 KB |
#6132 | EnrichedLog |
net6.0 | 3.13μs | 1.27ns | 4.75ns | 0.0297 | 0 | 0 | 2.2 KB |
#6132 | EnrichedLog |
netcoreapp3.1 | 4.21μs | 1.53ns | 5.93ns | 0.0294 | 0 | 0 | 2.2 KB |
#6132 | EnrichedLog |
net472 | 4.91μs | 1.44ns | 5.58ns | 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.29μs | 1.25ns | 4.66ns | 0.0159 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.82μs | 1.44ns | 5.56ns | 0.0154 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.04μs | 1.42ns | 5.5ns | 0.183 | 0.00102 | 0 | 1.16 KB |
#6132 | SendReceive |
net6.0 | 1.41μs | 0.845ns | 3.27ns | 0.0161 | 0 | 0 | 1.14 KB |
#6132 | SendReceive |
netcoreapp3.1 | 1.83μs | 1.42ns | 5.51ns | 0.0155 | 0 | 0 | 1.14 KB |
#6132 | SendReceive |
net472 | 2.12μs | 1.32ns | 5.1ns | 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.77μs | 1.08ns | 4.04ns | 0.0221 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.97μs | 1.07ns | 4.14ns | 0.0218 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.31μs | 3.75ns | 14.5ns | 0.322 | 0 | 0 | 2.04 KB |
#6132 | EnrichedLog |
net6.0 | 2.67μs | 2.26ns | 8.47ns | 0.0224 | 0 | 0 | 1.6 KB |
#6132 | EnrichedLog |
netcoreapp3.1 | 3.86μs | 1.29ns | 4.81ns | 0.0213 | 0 | 0 | 1.65 KB |
#6132 | EnrichedLog |
net472 | 4.28μs | 2.86ns | 11.1ns | 0.323 | 0 | 0 | 2.04 KB |
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6132
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472
1.269
567.74
720.26
Faster 🎉 in #6132
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0
1.117
450.31
403.22
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 | 1.269 | 567.74 | 720.26 |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 1.117 | 450.31 | 403.22 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 450ns | 0.229ns | 0.888ns | 0.00813 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 600ns | 0.559ns | 2.17ns | 0.00776 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 569ns | 0.614ns | 2.3ns | 0.0918 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 548ns | 0.14ns | 0.524ns | 0.00967 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 713ns | 0.631ns | 2.44ns | 0.0096 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 851ns | 0.274ns | 0.987ns | 0.104 | 0 | 0 | 658 B |
#6132 | StartFinishSpan |
net6.0 | 403ns | 0.167ns | 0.647ns | 0.00805 | 0 | 0 | 576 B |
#6132 | StartFinishSpan |
netcoreapp3.1 | 566ns | 1.02ns | 3.93ns | 0.00768 | 0 | 0 | 576 B |
#6132 | StartFinishSpan |
net472 | 720ns | 0.372ns | 1.39ns | 0.0917 | 0 | 0 | 578 B |
#6132 | StartFinishScope |
net6.0 | 520ns | 0.383ns | 1.49ns | 0.00988 | 0 | 0 | 696 B |
#6132 | StartFinishScope |
netcoreapp3.1 | 704ns | 0.358ns | 1.39ns | 0.00934 | 0 | 0 | 696 B |
#6132 | StartFinishScope |
net472 | 881ns | 0.321ns | 1.2ns | 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 | 701ns | 0.286ns | 1.11ns | 0.00981 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 921ns | 0.593ns | 2.14ns | 0.00925 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.14μs | 0.715ns | 2.48ns | 0.104 | 0 | 0 | 658 B |
#6132 | RunOnMethodBegin |
net6.0 | 692ns | 0.278ns | 1.04ns | 0.00972 | 0 | 0 | 696 B |
#6132 | RunOnMethodBegin |
netcoreapp3.1 | 969ns | 0.492ns | 1.91ns | 0.00923 | 0 | 0 | 696 B |
#6132 | RunOnMethodBegin |
net472 | 1.2μs | 0.654ns | 2.53ns | 0.104 | 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 (6132) (10.772M) : 0, 10772379
master (10.938M) : 0, 10938338
benchmarks/2.9.0 (11.081M) : 0, 11080577
section Automatic
This PR (6132) (0.768M) : crit ,0, 767623
master (7.287M) : 0, 7287003
benchmarks/2.9.0 (7.732M) : 0, 7732233
section Trace stats
master (7.632M) : 0, 7632146
section Manual
master (10.878M) : 0, 10878310
section Manual + Automatic
This PR (6132) (0.752M) : crit ,0, 752142
master (6.730M) : 0, 6729810
section DD_TRACE_ENABLED=0
master (10.111M) : 0, 10111307
gantt
title Throughput Linux arm64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6132) (9.516M) : 0, 9515812
master (9.427M) : 0, 9426776
benchmarks/2.9.0 (9.798M) : 0, 9798067
section Automatic
This PR (6132) (0.459M) : crit ,0, 458614
master (6.636M) : 0, 6636217
section Trace stats
master (6.851M) : 0, 6851155
section Manual
master (9.461M) : 0, 9461065
section Manual + Automatic
This PR (6132) (0.456M) : crit ,0, 455746
master (6.187M) : 0, 6186642
section DD_TRACE_ENABLED=0
master (8.712M) : 0, 8711537
gantt
title Throughput Windows x64 (Total requests)
dateFormat X
axisFormat %s
section Baseline
This PR (6132) (10.260M) : 0, 10259812
master (10.095M) : 0, 10095451
benchmarks/2.9.0 (10.067M) : 0, 10067315
section Automatic
This PR (6132) (0.265M) : crit ,0, 265335
master (6.632M) : 0, 6631756
benchmarks/2.9.0 (7.552M) : 0, 7552193
section Trace stats
master (7.222M) : 0, 7222352
section Manual
master (9.922M) : 0, 9921984
section Manual + Automatic
This PR (6132) (0.267M) : crit ,0, 267217
master (6.217M) : 0, 6217342
section DD_TRACE_ENABLED=0
master (9.452M) : 0, 9451878
|
Summary of changes
Stop changing the current path in the native loader.
Reason for change
We've received crash reports caused by
fs::current_path
. It's unclear why it threw (apparently it can happen for instance if the current path is too long), but it doesn't look like we actually need it anyway (it was needed forfs::absolute
but we can replace it by directly appending the relative path to the base path).Implementation details
After removing the call to
current_path
, there is a risk that whatever caused it to fail would causefs::exist
to fail as well, so I replaced the call with the overload that doesn't throw.Test coverage
Many tests already rely on the native loader.