Move loading dynamic library mechanism to shared code#2624
Merged
Conversation
loading dynamic library mechanism to shared code
gleocadie
force-pushed
the
gleocadie/share-dynamic-loading-mechanism
branch
from
March 31, 2022 13:44
4fa8453 to
41bce4d
Compare
gleocadie
marked this pull request as ready for review
March 31, 2022 14:09
gleocadie
force-pushed
the
gleocadie/share-dynamic-loading-mechanism
branch
from
March 31, 2022 16:35
41bce4d to
992d4d9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
gleocadie
force-pushed
the
gleocadie/share-dynamic-loading-mechanism
branch
from
April 7, 2022 18:50
fecb442 to
0f03f5a
Compare
Member
Code Coverage Report 📊✔️ Merging #2624 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
View the full reports for further details: |
Member
Benchmarks Report 🐌Benchmarks for #2624 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AppSecBodyBenchmark - Slower
|
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.AppSecBodyBenchmark.BodyExtractorMoreComplexBody‑netcoreapp3.1 | 1.189 | 20,912.61 | 24,862.77 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net472 | 295ns | 1.24ns | 4.49ns | 0.052 | 0 | 0 | 329 B |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 378ns | 1.83ns | 7.55ns | 0.00445 | 0 | 0 | 328 B |
| master | AllCycleMoreComplexBody |
net472 | 291ns | 1.25ns | 4.32ns | 0.0482 | 0 | 0 | 305 B |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 358ns | 1.23ns | 4.75ns | 0.00431 | 0 | 0 | 304 B |
| master | BodyExtractorSimpleBody |
net472 | 440ns | 2.34ns | 11.9ns | 0.0569 | 0 | 0 | 361 B |
| master | BodyExtractorSimpleBody |
netcoreapp3.1 | 478ns | 2.07ns | 8ns | 0.00377 | 0 | 0 | 272 B |
| master | BodyExtractorMoreComplexBody |
net472 | 24.7μs | 136ns | 905ns | 1.19 | 0.012 | 0 | 7.62 KB |
| master | BodyExtractorMoreComplexBody |
netcoreapp3.1 | 21μs | 70ns | 271ns | 0.0941 | 0 | 0 | 6.75 KB |
| #2624 | AllCycleSimpleBody |
net472 | 291ns | 1.02ns | 3.93ns | 0.0521 | 0 | 0 | 329 B |
| #2624 | AllCycleSimpleBody |
netcoreapp3.1 | 375ns | 1.27ns | 4.91ns | 0.00441 | 0 | 0 | 328 B |
| #2624 | AllCycleMoreComplexBody |
net472 | 290ns | 0.926ns | 3.59ns | 0.0482 | 0 | 0 | 305 B |
| #2624 | AllCycleMoreComplexBody |
netcoreapp3.1 | 366ns | 1.68ns | 10.3ns | 0.00418 | 0 | 0 | 304 B |
| #2624 | BodyExtractorSimpleBody |
net472 | 422ns | 1.71ns | 6.39ns | 0.057 | 0 | 0 | 361 B |
| #2624 | BodyExtractorSimpleBody |
netcoreapp3.1 | 435ns | 2.14ns | 8.57ns | 0.00368 | 0 | 0 | 272 B |
| #2624 | BodyExtractorMoreComplexBody |
net472 | 24μs | 98.1ns | 380ns | 1.18 | 0.0122 | 0 | 7.62 KB |
| #2624 | BodyExtractorMoreComplexBody |
netcoreapp3.1 | 24.9μs | 107ns | 414ns | 0.0876 | 0 | 0 | 6.75 KB |
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️
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 | 291μs | 611ns | 2.2μs | 0.286 | 0 | 0 | 19.74 KB |
| #2624 | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
| #2624 | SendRequest |
netcoreapp3.1 | 296μs | 832ns | 3.11μs | 0.286 | 0 | 0 | 19.74 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 |
net472 | 1.8μs | 10.2ns | 66.7ns | 0.0943 | 0.000865 | 0 | 594 B |
| master | ExecuteNonQuery |
netcoreapp3.1 | 1.46μs | 7.12ns | 30.2ns | 0.0089 | 0 | 0 | 632 B |
| #2624 | ExecuteNonQuery |
net472 | 1.74μs | 9.25ns | 48.9ns | 0.0941 | 0.000904 | 0 | 594 B |
| #2624 | ExecuteNonQuery |
netcoreapp3.1 | 1.45μs | 2.79ns | 9.66ns | 0.00878 | 0 | 0 | 632 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | CallElasticsearch |
net472 | 2.8μs | 15.1ns | 80.1ns | 0.126 | 0 | 0 | 803 B |
| master | CallElasticsearch |
netcoreapp3.1 | 1.71μs | 8.14ns | 45.3ns | 0.0108 | 0 | 0 | 792 B |
| master | CallElasticsearchAsync |
net472 | 3.01μs | 15.9ns | 84.2ns | 0.149 | 0.00186 | 0 | 939 B |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 1.86μs | 8.86ns | 34.3ns | 0.0126 | 0 | 0 | 912 B |
| #2624 | CallElasticsearch |
net472 | 2.64μs | 9.88ns | 35.6ns | 0.126 | 0 | 0 | 803 B |
| #2624 | CallElasticsearch |
netcoreapp3.1 | 1.69μs | 7.06ns | 26.4ns | 0.011 | 0 | 0 | 792 B |
| #2624 | CallElasticsearchAsync |
net472 | 2.92μs | 11.6ns | 45.1ns | 0.148 | 0 | 0 | 939 B |
| #2624 | CallElasticsearchAsync |
netcoreapp3.1 | 1.8μs | 6.57ns | 24.6ns | 0.0124 | 0 | 0 | 912 B |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net472 | 3.13μs | 10.3ns | 40.1ns | 0.167 | 0.00153 | 0 | 1.06 KB |
| master | ExecuteAsync |
netcoreapp3.1 | 2.09μs | 10.3ns | 42.4ns | 0.0145 | 0 | 0 | 1.03 KB |
| #2624 | ExecuteAsync |
net472 | 3.08μs | 9.55ns | 37ns | 0.168 | 0 | 0 | 1.06 KB |
| #2624 | ExecuteAsync |
netcoreapp3.1 | 2.11μs | 11.4ns | 65.4ns | 0.0141 | 0 | 0 | 1.03 KB |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendAsync |
net472 | 6.74μs | 27.7ns | 124ns | 0.362 | 0 | 0 | 2.28 KB |
| master | SendAsync |
netcoreapp3.1 | 4.74μs | 17.6ns | 63.4ns | 0.0304 | 0 | 0 | 2.21 KB |
| #2624 | SendAsync |
net472 | 6.8μs | 26.9ns | 101ns | 0.36 | 0 | 0 | 2.28 KB |
| #2624 | SendAsync |
netcoreapp3.1 | 4.86μs | 17.4ns | 65.1ns | 0.0314 | 0 | 0 | 2.21 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 |
net472 | 3.4μs | 10.1ns | 36.3ns | 0.228 | 0 | 0 | 1.45 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.07μs | 9.29ns | 34.8ns | 0.0213 | 0 | 0 | 1.53 KB |
| #2624 | EnrichedLog |
net472 | 3.51μs | 20ns | 153ns | 0.227 | 0 | 0 | 1.45 KB |
| #2624 | EnrichedLog |
netcoreapp3.1 | 3.11μs | 12.3ns | 46.1ns | 0.0217 | 0 | 0 | 1.53 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 |
net472 | 293μs | 1.15μs | 4.47μs | 0.451 | 0.15 | 0 | 4.33 KB |
| master | EnrichedLog |
netcoreapp3.1 | 232μs | 585ns | 2.27μs | 0 | 0 | 0 | 4.21 KB |
| #2624 | EnrichedLog |
net472 | 293μs | 1.42μs | 6.18μs | 0.458 | 0.153 | 0 | 4.33 KB |
| #2624 | EnrichedLog |
netcoreapp3.1 | 232μs | 816ns | 3.16μs | 0 | 0 | 0 | 4.21 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 |
net472 | 8.05μs | 42.7ns | 263ns | 0.503 | 0 | 0 | 3.23 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.51μs | 36.4ns | 239ns | 0.0484 | 0 | 0 | 3.6 KB |
| #2624 | EnrichedLog |
net472 | 7.88μs | 36.4ns | 136ns | 0.507 | 0 | 0 | 3.23 KB |
| #2624 | EnrichedLog |
netcoreapp3.1 | 6.56μs | 30.6ns | 119ns | 0.0478 | 0 | 0 | 3.6 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 |
net472 | 2.48μs | 12.7ns | 73.8ns | 0.16 | 0.00124 | 0 | 1.01 KB |
| master | SendReceive |
netcoreapp3.1 | 2.15μs | 9.17ns | 35.5ns | 0.0141 | 0 | 0 | 1.01 KB |
| #2624 | SendReceive |
net472 | 2.39μs | 11.5ns | 52.7ns | 0.16 | 0.00119 | 0 | 1.01 KB |
| #2624 | SendReceive |
netcoreapp3.1 | 2.25μs | 8.14ns | 30.5ns | 0.0141 | 0 | 0 | 1.01 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 |
net472 | 6.05μs | 28.8ns | 112ns | 0.291 | 0 | 0 | 1.87 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.13μs | 24.8ns | 108ns | 0.0199 | 0 | 0 | 1.49 KB |
| #2624 | EnrichedLog |
net472 | 6.27μs | 34.9ns | 239ns | 0.291 | 0 | 0 | 1.87 KB |
| #2624 | EnrichedLog |
netcoreapp3.1 | 5.46μs | 16.6ns | 62.1ns | 0.0192 | 0 | 0 | 1.49 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartFinishSpan |
net472 | 931ns | 4.8ns | 23.5ns | 0.0718 | 0 | 0 | 457 B |
| master | StartFinishSpan |
netcoreapp3.1 | 864ns | 2.3ns | 8.62ns | 0.00608 | 0 | 0 | 456 B |
| master | StartFinishScope |
net472 | 1.13μs | 6.05ns | 34.2ns | 0.0843 | 0 | 0 | 538 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.03μs | 4.48ns | 16.1ns | 0.00779 | 0 | 0 | 576 B |
| #2624 | StartFinishSpan |
net472 | 915ns | 2.7ns | 10.5ns | 0.072 | 0 | 0 | 457 B |
| #2624 | StartFinishSpan |
netcoreapp3.1 | 884ns | 4.48ns | 26.5ns | 0.00599 | 0 | 0 | 456 B |
| #2624 | StartFinishScope |
net472 | 1.1μs | 4.09ns | 15.3ns | 0.0843 | 0 | 0 | 538 B |
| #2624 | StartFinishScope |
netcoreapp3.1 | 1.02μs | 3.55ns | 12.8ns | 0.008 | 0 | 0 | 576 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 |
net472 | 1.39μs | 7.06ns | 30.8ns | 0.0839 | 0 | 0 | 538 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.22μs | 6.12ns | 28.1ns | 0.00804 | 0 | 0 | 576 B |
| #2624 | RunOnMethodBegin |
net472 | 1.29μs | 5.44ns | 24.9ns | 0.0838 | 0 | 0 | 538 B |
| #2624 | RunOnMethodBegin |
netcoreapp3.1 | 1.18μs | 5.48ns | 21.2ns | 0.0077 | 0 | 0 | 576 B |
luhenry
approved these changes
Apr 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Reason for change
Dynamic loading a library is not shared. Soon the profiler will need to load dynamically a library and it will be better to share the code.
Implementation details
Create a
DynamicLibraryBaseandDynamicCOMLibraryclasses to wrap the loading and the access to member functions.Move the code in the
sharedfolder hierarchy.Test coverage
All the current tests must pass (tracer windows integration tests....)
Other details