dd-trace-dotnet icon indicating copy to clipboard operation
dd-trace-dotnet copied to clipboard

[Profiler] Optimize profiler code

Open gleocadie opened this issue 3 years ago • 5 comments

Summary of changes

Optimize profiler code.

Reason for change

Parts of the code of the new pipeline does a lot copies (string mainly), there is no symbols caching. This makes the profiler consuming more memory/cpu that it would actually need.

Implementation details

In the the FrameStore, use a hashtable to cache already resolved native symbols. Use move semantic as much as possible to avoid copies.

Test coverage

Other details

gleocadie avatar Apr 08 '22 15:04 gleocadie

Code Coverage Report :bar_chart:

:heavy_check_mark: Merging #2657 into master will not change line coverage :heavy_check_mark: Merging #2657 into master will not change branch coverage :no_entry: Merging #2657 into master will will increase complexity by 6

master #2657 Change
Lines 13438 / 18464 13497 / 18473
Lines % 73% 73% 0% :heavy_check_mark:
Branches 7754 / 11017 7799 / 11017
Branches % 70% 71% 0% :heavy_check_mark:
Complexity 12307 12313 6 :no_entry:

View the full report for further details:

Datadog.Trace Breakdown :heavy_check_mark:

master #2657 Change
Lines % 73% 73% 0% :heavy_check_mark:
Branches % 70% 71% 0% :heavy_check_mark:
Complexity 12307 12313 6 :no_entry:

The following classes have significant coverage changes.

File Line coverage change Branch coverage change Complexity change
Datadog.Trace.DiagnosticListeners.AspNetCoreDiagnosticObserver 4% :heavy_check_mark: 6% :heavy_check_mark: 0 :heavy_check_mark:
Datadog.Trace.Telemetry.JsonHttpClientTelemetryTransport 26% :heavy_check_mark: 38% :heavy_check_mark: 0 :heavy_check_mark:
Datadog.Trace.Telemetry.JsonWebRequestTelemetryTransport 27% :heavy_check_mark: 57% :heavy_check_mark: 0 :heavy_check_mark:

View the full reports for further details:

andrewlock avatar Apr 08 '22 18:04 andrewlock

Benchmarks Report :snail:

Benchmarks for #2657 compared to master:

  • 7 benchmarks are faster, with geometric mean 1.295
  • 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 - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #2657

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 1.203 1,114,023.00 926,204.40

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net472 1.12ms 6.49μs 56.9μs 0 0 0 3.16 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 808μs 4.29μs 23.9μs 0 0 0 2.57 KB
#2657 WriteAndFlushEnrichedTraces net472 930μs 4.7μs 20.5μs 0 0 0 3.16 KB
#2657 WriteAndFlushEnrichedTraces netcoreapp3.1 719μs 2.23μs 8.05μs 0 0 0 2.57 KB
Benchmarks.Trace.AppSecBodyBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #2657

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AppSecBodyBenchmark.BodyExtractorMoreComplexBody‑net472 1.301 30,741.37 23,635.36 bimodal
Benchmarks.Trace.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 1.219 367.53 301.43 bimodal
Benchmarks.Trace.AppSecBodyBenchmark.BodyExtractorSimpleBody‑net472 1.136 486.19 428.12

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net472 317ns 1.57ns 7.36ns 0.052 0 0 329 B
master AllCycleSimpleBody netcoreapp3.1 382ns 1.56ns 6.04ns 0.00454 0 0 328 B
master AllCycleMoreComplexBody net472 405ns 7.16ns 71.6ns 0.0482 0 0 305 B
master AllCycleMoreComplexBody netcoreapp3.1 368ns 1.04ns 3.88ns 0.00417 0 0 304 B
master BodyExtractorSimpleBody net472 488ns 2.38ns 10.4ns 0.0569 0 0 361 B
master BodyExtractorSimpleBody netcoreapp3.1 444ns 2.2ns 10.1ns 0.00375 0 0 272 B
master BodyExtractorMoreComplexBody net472 33μs 704ns 7.04μs 1.18 0.0136 0 7.62 KB
master BodyExtractorMoreComplexBody netcoreapp3.1 21.8μs 121ns 973ns 0.0943 0 0 6.75 KB
#2657 AllCycleSimpleBody net472 299ns 1.43ns 6.09ns 0.052 0 0 329 B
#2657 AllCycleSimpleBody netcoreapp3.1 368ns 1.61ns 6.02ns 0.00455 0 0 328 B
#2657 AllCycleMoreComplexBody net472 302ns 1.47ns 5.68ns 0.0482 0 0 305 B
#2657 AllCycleMoreComplexBody netcoreapp3.1 362ns 1.01ns 3.65ns 0.00423 0 0 304 B
#2657 BodyExtractorSimpleBody net472 432ns 2.44ns 16.2ns 0.057 0 0 361 B
#2657 BodyExtractorSimpleBody netcoreapp3.1 429ns 1.02ns 3.69ns 0.00371 0 0 272 B
#2657 BodyExtractorMoreComplexBody net472 23.8μs 124ns 658ns 1.18 0.0116 0 7.62 KB
#2657 BodyExtractorMoreComplexBody netcoreapp3.1 21.1μs 113ns 642ns 0.0943 0 0 6.75 KB
Benchmarks.Trace.AspNetCoreBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #2657

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 1.155 339,321.30 293,857.54

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 338μs 1.39μs 5.2μs 0.171 0 0 19.74 KB
#2657 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#2657 SendRequest netcoreapp3.1 294μs 1.33μs 5.14μs 0.144 0 0 19.74 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.84μs 5.48ns 20.5ns 0.094 0.000904 0 594 B
master ExecuteNonQuery netcoreapp3.1 1.54μs 7.1ns 31ns 0.00896 0 0 632 B
#2657 ExecuteNonQuery net472 1.78μs 8.68ns 35.8ns 0.0938 0.000845 0 594 B
#2657 ExecuteNonQuery netcoreapp3.1 1.47μs 5.64ns 21.9ns 0.00884 0 0 632 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.98μs 17.9ns 177ns 0.124 0 0 802 B
master CallElasticsearch netcoreapp3.1 1.79μs 8.31ns 32.2ns 0.0112 0 0 792 B
master CallElasticsearchAsync net472 3.27μs 13.7ns 70ns 0.149 0.00173 0 939 B
master CallElasticsearchAsync netcoreapp3.1 1.96μs 11.2ns 80.9ns 0.0128 0 0 912 B
#2657 CallElasticsearch net472 2.71μs 13.4ns 64.1ns 0.126 0 0 803 B
#2657 CallElasticsearch netcoreapp3.1 1.75μs 9.43ns 56.6ns 0.0109 0 0 792 B
#2657 CallElasticsearchAsync net472 3.05μs 17.5ns 138ns 0.146 0 0 939 B
#2657 CallElasticsearchAsync netcoreapp3.1 1.84μs 4.81ns 18.6ns 0.0126 0 0 912 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.18μs 15.2ns 58.8ns 0.168 0.00158 0 1.06 KB
master ExecuteAsync netcoreapp3.1 2.1μs 10.3ns 43.5ns 0.0143 0 0 1.03 KB
#2657 ExecuteAsync net472 3.02μs 15.1ns 64ns 0.167 0.00147 0 1.06 KB
#2657 ExecuteAsync netcoreapp3.1 1.97μs 5.77ns 20ns 0.0142 0 0 1.03 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 7.15μs 31.8ns 123ns 0.36 0 0 2.28 KB
master SendAsync netcoreapp3.1 5.37μs 26ns 114ns 0.0314 0 0 2.21 KB
#2657 SendAsync net472 6.85μs 30ns 116ns 0.362 0 0 2.28 KB
#2657 SendAsync netcoreapp3.1 4.85μs 24.9ns 112ns 0.0309 0 0 2.21 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.62μs 16.8ns 65.2ns 0.228 0 0 1.45 KB
master EnrichedLog netcoreapp3.1 3.32μs 18.9ns 135ns 0.0208 0 0 1.53 KB
#2657 EnrichedLog net472 3.38μs 11.9ns 46.1ns 0.227 0 0 1.45 KB
#2657 EnrichedLog netcoreapp3.1 3.11μs 8.35ns 31.3ns 0.0215 0 0 1.53 KB
Benchmarks.Trace.Log4netBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #2657

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Log4netBenchmark.EnrichedLog‑netcoreapp3.1 1.442 330,048.26 228,821.49

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 362μs 5.13μs 51.3μs 0.315 0.158 0 4.33 KB
master EnrichedLog netcoreapp3.1 330μs 833ns 3.23μs 0 0 0 4.21 KB
#2657 EnrichedLog net472 290μs 865ns 3.35μs 0.44 0.147 0 4.33 KB
#2657 EnrichedLog netcoreapp3.1 229μs 871ns 3.37μs 0 0 0 4.21 KB
Benchmarks.Trace.NLogBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #2657

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net472 1.689 13,397.02 7,931.42

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net472 13.4μs 70.3ns 391ns 0.497 0 0 3.23 KB
master EnrichedLog netcoreapp3.1 6.6μs 34.1ns 156ns 0.0492 0 0 3.6 KB
#2657 EnrichedLog net472 7.93μs 38.7ns 169ns 0.507 0 0 3.23 KB
#2657 EnrichedLog netcoreapp3.1 6.84μs 40.1ns 389ns 0.0481 0 0 3.6 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.45μs 8.64ns 33.4ns 0.16 0.00122 0 1.01 KB
master SendReceive netcoreapp3.1 2.13μs 5.36ns 20.1ns 0.0141 0 0 1.01 KB
#2657 SendReceive net472 2.34μs 11.7ns 53.6ns 0.16 0.00116 0 1.01 KB
#2657 SendReceive netcoreapp3.1 1.98μs 5.36ns 20.7ns 0.0135 0 0 1.01 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 6.17μs 24.4ns 91.3ns 0.292 0 0 1.87 KB
master EnrichedLog netcoreapp3.1 5.26μs 25.3ns 110ns 0.0207 0 0 1.49 KB
#2657 EnrichedLog net472 6.28μs 32.8ns 161ns 0.29 0 0 1.87 KB
#2657 EnrichedLog netcoreapp3.1 5.13μs 28.3ns 227ns 0.0192 0 0 1.49 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 945ns 4.14ns 17.1ns 0.0719 0 0 457 B
master StartFinishSpan netcoreapp3.1 917ns 5.13ns 32ns 0.00604 0 0 456 B
master StartFinishScope net472 1.22μs 7.13ns 65ns 0.0842 0 0 538 B
master StartFinishScope netcoreapp3.1 1.07μs 4.06ns 15.7ns 0.00815 0 0 576 B
#2657 StartFinishSpan net472 886ns 3.01ns 11.7ns 0.0719 0 0 457 B
#2657 StartFinishSpan netcoreapp3.1 882ns 3.52ns 13.6ns 0.00622 0 0 456 B
#2657 StartFinishScope net472 1.1μs 2.09ns 7.55ns 0.0845 0 0 538 B
#2657 StartFinishScope netcoreapp3.1 1.04μs 5.25ns 22.3ns 0.00786 0 0 576 B
Benchmarks.Trace.TraceAnnotationsBenchmark - 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 RunOnMethodBegin net472 1.36μs 6.89ns 48.2ns 0.0839 0 0 538 B
master RunOnMethodBegin netcoreapp3.1 1.22μs 5.56ns 20.8ns 0.00774 0 0 576 B
#2657 RunOnMethodBegin net472 1.31μs 7.53ns 58.4ns 0.0841 0 0 538 B
#2657 RunOnMethodBegin netcoreapp3.1 1.17μs 6.06ns 35.9ns 0.0081 0 0 576 B

andrewlock avatar Apr 09 '22 00:04 andrewlock

Code Coverage Report :bar_chart:

:no_entry: Merging #2657 into master will will decrease line coverage by 5% :no_entry: Merging #2657 into master will will decrease branch coverage by 7% :no_entry: Merging #2657 into master will will increase complexity by 1577

master #2657 Change
Lines 13698 / 19264 13759 / 20869
Lines % 71% 66% -5% :no_entry:
Branches 7779 / 11419 7812 / 12833
Branches % 68% 61% -7% :no_entry:
Complexity 12705 14282 1577 :no_entry:

View the full report for further details:

Datadog.Trace Breakdown :no_entry:

master #2657 Change
Lines % 71% 66% -5% :no_entry:
Branches % 68% 61% -7% :no_entry:
Complexity 12705 14282 1577 :no_entry:

The following classes have significant coverage changes.

File Line coverage change Branch coverage change Complexity change
Datadog.Trace.DuckTyping.DuckTypeException -50% :no_entry: 0% :heavy_check_mark: 4 :no_entry:
Datadog.Trace.DuckTyping.DuckTypeFieldIsReadonlyException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
Datadog.Trace.DuckTyping.DuckTypeIncorrectReverseMethodUsageException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
Datadog.Trace.DuckTyping.DuckTypeIncorrectReversePropertyUsageException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
Datadog.Trace.DuckTyping.DuckTypeInvalidTypeConversionException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
Datadog.Trace.DuckTyping.DuckTypePropertyArgumentsLengthException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
Datadog.Trace.DuckTyping.DuckTypePropertyCantBeReadException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
Datadog.Trace.DuckTyping.DuckTypePropertyCantBeWrittenException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
Datadog.Trace.DuckTyping.DuckTypePropertyOrFieldNotFoundException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
Datadog.Trace.DuckTyping.DuckTypeProxyAndTargetMethodParameterSignatureMismatchException -50% :no_entry: 0% :heavy_check_mark: 2 :no_entry:
...And 38 more

The following classes were added in #2657:

File Line coverage Branch coverage Complexity
Datadog.Trace.Ci.Coverage.Attributes.CoveredAssemblyAttribute 100% 100% 1
Datadog.Trace.Ci.Coverage.CoverageContextContainer 100% 100% 4
Datadog.Trace.Ci.Coverage.CoverageEventHandler 100% 100% 12
Datadog.Trace.Ci.Coverage.CoverageInstruction 100% 100% 1
Datadog.Trace.Ci.Coverage.CoverageReporter 100% 100% 5
...And 4 more

View the full reports for further details:

andrewlock avatar Apr 29 '22 10:04 andrewlock

Benchmarks Report :snail:

Benchmarks for #2657 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.128
  • 1 benchmarks are slower, with geometric mean 1.228
  • 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 970μs 5.32μs 42.6μs 0 0 0 3.16 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 730μs 3.52μs 14.5μs 0 0 0 2.57 KB
#2657 WriteAndFlushEnrichedTraces net472 977μs 4.89μs 24.9μs 0 0 0 3.16 KB
#2657 WriteAndFlushEnrichedTraces netcoreapp3.1 751μs 3.7μs 15.2μs 0 0 0 2.57 KB
Benchmarks.Trace.AppSecBodyBenchmark - 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 AllCycleSimpleBody net472 353ns 2.13ns 20.9ns 0.0661 0 0 417 B
master AllCycleSimpleBody netcoreapp3.1 454ns 3.1ns 30.7ns 0.00579 0 0 416 B
master AllCycleMoreComplexBody net472 321ns 1.43ns 5.53ns 0.0621 0 0 393 B
master AllCycleMoreComplexBody netcoreapp3.1 411ns 1.61ns 6.24ns 0.00557 0 0 392 B
master BodyExtractorSimpleBody net472 443ns 2.25ns 9.79ns 0.0569 0 0 361 B
master BodyExtractorSimpleBody netcoreapp3.1 457ns 1.87ns 7.26ns 0.00383 0 0 272 B
master BodyExtractorMoreComplexBody net472 25.1μs 140ns 872ns 1.18 0.0123 0 7.62 KB
master BodyExtractorMoreComplexBody netcoreapp3.1 22.9μs 132ns 1.09μs 0.0876 0 0 6.75 KB
#2657 AllCycleSimpleBody net472 335ns 1.62ns 6.48ns 0.066 0 0 417 B
#2657 AllCycleSimpleBody netcoreapp3.1 437ns 2.11ns 9.21ns 0.00592 0 0 416 B
#2657 AllCycleMoreComplexBody net472 331ns 1.88ns 12.9ns 0.0621 0 0 393 B
#2657 AllCycleMoreComplexBody netcoreapp3.1 450ns 2.7ns 26.5ns 0.00556 0 0 392 B
#2657 BodyExtractorSimpleBody net472 461ns 1.91ns 7.13ns 0.0569 0 0 361 B
#2657 BodyExtractorSimpleBody netcoreapp3.1 469ns 1.92ns 7.43ns 0.00387 0 0 272 B
#2657 BodyExtractorMoreComplexBody net472 25.8μs 121ns 539ns 1.19 0.0129 0 7.62 KB
#2657 BodyExtractorMoreComplexBody netcoreapp3.1 22.6μs 117ns 551ns 0.0993 0 0 6.75 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 341μs 766ns 2.96μs 0.173 0 0 19.74 KB
#2657 SendRequest net472 0ns 0ns 0ns 0 0 0 0 b
#2657 SendRequest netcoreapp3.1 350μs 1.09μs 4.09μs 0.176 0 0 19.74 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 2μs 8.29ns 35.2ns 0.0942 0.00101 0 594 B
master ExecuteNonQuery netcoreapp3.1 1.69μs 5.77ns 21.6ns 0.00896 0 0 632 B
#2657 ExecuteNonQuery net472 1.96μs 9.09ns 73.8ns 0.0937 0 0 594 B
#2657 ExecuteNonQuery netcoreapp3.1 1.81μs 9.56ns 49.7ns 0.00886 0 0 632 B
Benchmarks.Trace.ElasticsearchBenchmark - Slower :warning: Same allocations :heavy_check_mark:

Slower :warning: in #2657

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net472 1.228 2,849.04 3,498.00 several?

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net472 2.85μs 15.2ns 77.6ns 0.127 0 0 803 B
master CallElasticsearch netcoreapp3.1 1.92μs 10.1ns 71.7ns 0.011 0 0 792 B
master CallElasticsearchAsync net472 3μs 15.7ns 80.2ns 0.148 0.00144 0 939 B
master CallElasticsearchAsync netcoreapp3.1 2.02μs 9.71ns 40ns 0.0132 0 0 912 B
#2657 CallElasticsearch net472 3.49μs 20.2ns 163ns 0.124 0 0 803 B
#2657 CallElasticsearch netcoreapp3.1 1.88μs 8.08ns 45.7ns 0.0114 0 0 792 B
#2657 CallElasticsearchAsync net472 3.27μs 17.5ns 145ns 0.145 0 0 939 B
#2657 CallElasticsearchAsync netcoreapp3.1 2.04μs 10.8ns 53.1ns 0.0127 0 0 912 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.3μs 16.8ns 78.6ns 0.167 0.00159 0 1.06 KB
master ExecuteAsync netcoreapp3.1 2.29μs 15.1ns 150ns 0.0148 0 0 1.03 KB
#2657 ExecuteAsync net472 3.44μs 18.1ns 88.6ns 0.168 0 0 1.06 KB
#2657 ExecuteAsync netcoreapp3.1 2.16μs 10.2ns 39.4ns 0.0154 0 0 1.03 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 7.5μs 36.4ns 146ns 0.36 0 0 2.28 KB
master SendAsync netcoreapp3.1 5.23μs 22.1ns 88.5ns 0.0295 0 0 2.21 KB
#2657 SendAsync net472 7.48μs 40.8ns 339ns 0.355 0 0 2.28 KB
#2657 SendAsync netcoreapp3.1 5.13μs 25.8ns 124ns 0.0311 0 0 2.21 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.6μs 16.5ns 64ns 0.227 0 0 1.45 KB
master EnrichedLog netcoreapp3.1 3.36μs 13ns 46.9ns 0.0212 0 0 1.53 KB
#2657 EnrichedLog net472 3.77μs 21.5ns 152ns 0.227 0 0 1.45 KB
#2657 EnrichedLog netcoreapp3.1 3.43μs 19.7ns 150ns 0.0213 0 0 1.53 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 296μs 1.37μs 5.31μs 0.434 0.145 0 4.33 KB
master EnrichedLog netcoreapp3.1 236μs 604ns 2.18μs 0 0 0 4.21 KB
#2657 EnrichedLog net472 317μs 1.72μs 10.3μs 0.44 0.147 0 4.33 KB
#2657 EnrichedLog netcoreapp3.1 243μs 1.26μs 5.76μs 0 0 0 4.21 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.93μs 22.8ns 88.4ns 0.507 0 0 3.23 KB
master EnrichedLog netcoreapp3.1 7.16μs 29.4ns 114ns 0.0496 0 0 3.6 KB
#2657 EnrichedLog net472 8.53μs 45.9ns 243ns 0.503 0 0 3.23 KB
#2657 EnrichedLog netcoreapp3.1 7.15μs 40.2ns 295ns 0.051 0 0 3.6 KB
Benchmarks.Trace.RedisBenchmark - Faster :tada: Same allocations :heavy_check_mark:

Faster :tada: in #2657

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.RedisBenchmark.SendReceive‑net472 1.128 2,875.30 2,548.06

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net472 2.88μs 8.63ns 31.1ns 0.16 0.00151 0 1.01 KB
master SendReceive netcoreapp3.1 2.29μs 10.2ns 38.2ns 0.0135 0 0 1.01 KB
#2657 SendReceive net472 2.55μs 12.9ns 56ns 0.16 0.00125 0 1.01 KB
#2657 SendReceive netcoreapp3.1 2.3μs 10.1ns 37.9ns 0.0137 0 0 1.01 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 6.34μs 27.2ns 119ns 0.292 0 0 1.87 KB
master EnrichedLog netcoreapp3.1 5.9μs 33.8ns 246ns 0.0205 0 0 1.49 KB
#2657 EnrichedLog net472 6.51μs 31ns 139ns 0.292 0 0 1.87 KB
#2657 EnrichedLog netcoreapp3.1 5.91μs 34.5ns 301ns 0.0192 0 0 1.49 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 1.03μs 5.55ns 28.8ns 0.0719 0 0 457 B
master StartFinishSpan netcoreapp3.1 983ns 4.06ns 15.7ns 0.0062 0 0 456 B
master StartFinishScope net472 1.21μs 6.11ns 25.9ns 0.0844 0 0 538 B
master StartFinishScope netcoreapp3.1 1.12μs 5.48ns 21.9ns 0.00783 0 0 576 B
#2657 StartFinishSpan net472 1.01μs 4.88ns 18.9ns 0.0719 0 0 457 B
#2657 StartFinishSpan netcoreapp3.1 969ns 3.71ns 14.4ns 0.00613 0 0 456 B
#2657 StartFinishScope net472 1.22μs 6.74ns 38.2ns 0.0841 0 0 538 B
#2657 StartFinishScope netcoreapp3.1 1.18μs 5.85ns 24.1ns 0.00779 0 0 576 B
Benchmarks.Trace.TraceAnnotationsBenchmark - 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 RunOnMethodBegin net472 1.38μs 6.48ns 27.5ns 0.0844 0 0 538 B
master RunOnMethodBegin netcoreapp3.1 1.25μs 6.1ns 24.4ns 0.00825 0 0 576 B
#2657 RunOnMethodBegin net472 1.42μs 7.51ns 38.3ns 0.0841 0 0 538 B
#2657 RunOnMethodBegin netcoreapp3.1 1.31μs 6.58ns 36.7ns 0.00789 0 0 576 B

andrewlock avatar Apr 29 '22 14:04 andrewlock

@gleocadie, what's the status of this work? Can we close the PR?

lucaspimentel avatar Oct 12 '22 21:10 lucaspimentel