-
Notifications
You must be signed in to change notification settings - Fork 143
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
Change ICorProfilerMethodEnum
to use the COMPtr
#6334
Conversation
…older` to release it when it's out of scope.
Datadog ReportBranch report: ✅ 0 Failed, 453816 Passed, 3241 Skipped, 28h 31m 22.38s Total Time |
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 (6334) - mean (72ms) : 61, 84
. : milestone, 72,
master - mean (71ms) : 64, 78
. : milestone, 71,
section CallTarget+Inlining+NGEN
This PR (6334) - mean (1,108ms) : 1084, 1132
. : milestone, 1108,
master - mean (1,109ms) : 1083, 1135
. : milestone, 1109,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6334) - mean (108ms) : 105, 111
. : milestone, 108,
master - mean (109ms) : 106, 112
. : milestone, 109,
section CallTarget+Inlining+NGEN
This PR (6334) - mean (764ms) : 752, 777
. : milestone, 764,
master - mean (772ms) : 752, 791
. : milestone, 772,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6334) - mean (91ms) : 90, 93
. : milestone, 91,
master - mean (92ms) : 91, 94
. : milestone, 92,
section CallTarget+Inlining+NGEN
This PR (6334) - mean (721ms) : 701, 740
. : milestone, 721,
master - mean (726ms) : 711, 741
. : milestone, 726,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6334) - mean (190ms) : 186, 194
. : milestone, 190,
master - mean (192ms) : 186, 198
. : milestone, 192,
section CallTarget+Inlining+NGEN
This PR (6334) - mean (1,210ms) : 1190, 1230
. : milestone, 1210,
master - mean (1,214ms) : 1192, 1237
. : milestone, 1214,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6334) - mean (275ms) : 271, 279
. : milestone, 275,
master - mean (278ms) : 272, 284
. : milestone, 278,
section CallTarget+Inlining+NGEN
This PR (6334) - mean (946ms) : 912, 979
. : milestone, 946,
master - mean (949ms) : 933, 965
. : milestone, 949,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6334) - mean (267ms) : 264, 270
. : milestone, 267,
master - mean (266ms) : 262, 270
. : milestone, 266,
section CallTarget+Inlining+NGEN
This PR (6334) - mean (927ms) : 909, 944
. : milestone, 927,
master - mean (931ms) : 914, 948
. : milestone, 931,
|
Benchmarks Report for tracer 🐌Benchmarks for #6334 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 ✔️ Fewer allocations 🎉
|
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 | 41.79 KB | 41.52 KB | -268 B | -0.64% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | WriteAndFlushEnrichedTraces |
net6.0 | 583μs | 3.09μs | 16μs | 0.595 | 0 | 0 | 41.79 KB |
master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 679μs | 3.14μs | 14.4μs | 0.345 | 0 | 0 | 41.77 KB |
master | WriteAndFlushEnrichedTraces |
net472 | 869μs | 3.17μs | 11.9μs | 8.13 | 2.57 | 0.428 | 53.33 KB |
#6334 | WriteAndFlushEnrichedTraces |
net6.0 | 574μs | 3.19μs | 20.9μs | 0.563 | 0 | 0 | 41.52 KB |
#6334 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 695μs | 3.56μs | 16.7μs | 0.334 | 0 | 0 | 41.74 KB |
#6334 | WriteAndFlushEnrichedTraces |
net472 | 874μs | 4.08μs | 16.3μs | 8.19 | 2.59 | 0.431 | 53.33 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 |
net6.0 | 1.24μs | 2.91ns | 11.3ns | 0.0138 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
netcoreapp3.1 | 1.78μs | 2.34ns | 9.07ns | 0.0133 | 0 | 0 | 1.02 KB |
master | ExecuteNonQuery |
net472 | 2.1μs | 1.38ns | 5.34ns | 0.157 | 0.00105 | 0 | 987 B |
#6334 | ExecuteNonQuery |
net6.0 | 1.31μs | 1.74ns | 6.73ns | 0.0143 | 0 | 0 | 1.02 KB |
#6334 | ExecuteNonQuery |
netcoreapp3.1 | 1.88μs | 2.01ns | 7.77ns | 0.014 | 0 | 0 | 1.02 KB |
#6334 | ExecuteNonQuery |
net472 | 2.07μs | 2.75ns | 10.6ns | 0.157 | 0.00102 | 0 | 987 B |
Benchmarks.Trace.ElasticsearchBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #6334
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0
1.125
1,234.58
1,388.70
Faster 🎉 in #6334
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1
1.136
1,748.16
1,538.73
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 | 1.125 | 1,234.58 | 1,388.70 |
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1 | 1.136 | 1,748.16 | 1,538.73 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | CallElasticsearch |
net6.0 | 1.23μs | 0.314ns | 1.17ns | 0.0137 | 0 | 0 | 976 B |
master | CallElasticsearch |
netcoreapp3.1 | 1.49μs | 0.862ns | 3.11ns | 0.0128 | 0 | 0 | 976 B |
master | CallElasticsearch |
net472 | 2.52μs | 0.928ns | 3.59ns | 0.158 | 0 | 0 | 995 B |
master | CallElasticsearchAsync |
net6.0 | 1.29μs | 3.82ns | 14.8ns | 0.0134 | 0 | 0 | 952 B |
master | CallElasticsearchAsync |
netcoreapp3.1 | 1.75μs | 1.03ns | 3.99ns | 0.0139 | 0 | 0 | 1.02 KB |
master | CallElasticsearchAsync |
net472 | 2.65μs | 1.02ns | 3.95ns | 0.167 | 0 | 0 | 1.05 KB |
#6334 | CallElasticsearch |
net6.0 | 1.39μs | 0.709ns | 2.65ns | 0.0134 | 0 | 0 | 976 B |
#6334 | CallElasticsearch |
netcoreapp3.1 | 1.6μs | 0.407ns | 1.47ns | 0.0127 | 0 | 0 | 976 B |
#6334 | CallElasticsearch |
net472 | 2.67μs | 1.68ns | 6.52ns | 0.157 | 0 | 0 | 995 B |
#6334 | CallElasticsearchAsync |
net6.0 | 1.31μs | 0.744ns | 2.78ns | 0.0131 | 0 | 0 | 952 B |
#6334 | CallElasticsearchAsync |
netcoreapp3.1 | 1.54μs | 1.33ns | 4.99ns | 0.0138 | 0 | 0 | 1.02 KB |
#6334 | CallElasticsearchAsync |
net472 | 2.63μs | 1.81ns | 7.02ns | 0.167 | 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.35μs | 0.484ns | 1.88ns | 0.0135 | 0 | 0 | 952 B |
master | ExecuteAsync |
netcoreapp3.1 | 1.62μs | 0.915ns | 3.42ns | 0.0129 | 0 | 0 | 952 B |
master | ExecuteAsync |
net472 | 1.84μs | 0.611ns | 2.29ns | 0.145 | 0 | 0 | 915 B |
#6334 | ExecuteAsync |
net6.0 | 1.29μs | 0.339ns | 1.27ns | 0.0135 | 0 | 0 | 952 B |
#6334 | ExecuteAsync |
netcoreapp3.1 | 1.67μs | 1.7ns | 6.35ns | 0.0132 | 0 | 0 | 952 B |
#6334 | ExecuteAsync |
net472 | 1.8μs | 0.423ns | 1.64ns | 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 | 1.56ns | 6.03ns | 0.033 | 0 | 0 | 2.31 KB |
master | SendAsync |
netcoreapp3.1 | 5.38μs | 3.21ns | 12.4ns | 0.0375 | 0 | 0 | 2.85 KB |
master | SendAsync |
net472 | 7.32μs | 2.05ns | 7.93ns | 0.493 | 0 | 0 | 3.12 KB |
#6334 | SendAsync |
net6.0 | 4.62μs | 1.67ns | 6.26ns | 0.0319 | 0 | 0 | 2.31 KB |
#6334 | SendAsync |
netcoreapp3.1 | 5.23μs | 2.05ns | 7.96ns | 0.0365 | 0 | 0 | 2.85 KB |
#6334 | SendAsync |
net472 | 7.36μs | 1.87ns | 7.26ns | 0.496 | 0 | 0 | 3.12 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.59μs | 1.74ns | 6.76ns | 0.0225 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
netcoreapp3.1 | 2.28μs | 0.944ns | 3.53ns | 0.0216 | 0 | 0 | 1.64 KB |
master | EnrichedLog |
net472 | 2.57μs | 1.54ns | 5.55ns | 0.25 | 0 | 0 | 1.57 KB |
#6334 | EnrichedLog |
net6.0 | 1.55μs | 1.18ns | 4.4ns | 0.0226 | 0 | 0 | 1.64 KB |
#6334 | EnrichedLog |
netcoreapp3.1 | 2.28μs | 1.14ns | 4.28ns | 0.0219 | 0 | 0 | 1.64 KB |
#6334 | EnrichedLog |
net472 | 2.75μs | 1.02ns | 3.8ns | 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 | 119μs | 163ns | 630ns | 0.0595 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
netcoreapp3.1 | 123μs | 273ns | 1.06μs | 0 | 0 | 0 | 4.28 KB |
master | EnrichedLog |
net472 | 151μs | 215ns | 834ns | 0.682 | 0.227 | 0 | 4.46 KB |
#6334 | EnrichedLog |
net6.0 | 118μs | 172ns | 668ns | 0.06 | 0 | 0 | 4.28 KB |
#6334 | EnrichedLog |
netcoreapp3.1 | 123μs | 170ns | 637ns | 0 | 0 | 0 | 4.28 KB |
#6334 | EnrichedLog |
net472 | 153μs | 110ns | 428ns | 0.684 | 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.07μs | 1.4ns | 5.24ns | 0.0299 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
netcoreapp3.1 | 4.09μs | 1.16ns | 4.35ns | 0.0286 | 0 | 0 | 2.2 KB |
master | EnrichedLog |
net472 | 4.92μs | 2.69ns | 10.4ns | 0.32 | 0 | 0 | 2.02 KB |
#6334 | EnrichedLog |
net6.0 | 3.06μs | 0.731ns | 2.83ns | 0.0306 | 0 | 0 | 2.2 KB |
#6334 | EnrichedLog |
netcoreapp3.1 | 4.3μs | 1.62ns | 6.27ns | 0.0279 | 0 | 0 | 2.2 KB |
#6334 | EnrichedLog |
net472 | 4.86μs | 1.1ns | 4.1ns | 0.32 | 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.46μs | 0.875ns | 3.39ns | 0.016 | 0 | 0 | 1.14 KB |
master | SendReceive |
netcoreapp3.1 | 1.8μs | 1.04ns | 4.03ns | 0.0152 | 0 | 0 | 1.14 KB |
master | SendReceive |
net472 | 2.13μs | 1.07ns | 3.85ns | 0.183 | 0 | 0 | 1.16 KB |
#6334 | SendReceive |
net6.0 | 1.39μs | 1.31ns | 5.06ns | 0.016 | 0 | 0 | 1.14 KB |
#6334 | SendReceive |
netcoreapp3.1 | 1.75μs | 1.69ns | 6.53ns | 0.0149 | 0 | 0 | 1.14 KB |
#6334 | SendReceive |
net472 | 2.04μs | 1.02ns | 3.82ns | 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.66μs | 1.2ns | 4.65ns | 0.0226 | 0 | 0 | 1.6 KB |
master | EnrichedLog |
netcoreapp3.1 | 3.78μs | 1.52ns | 5.67ns | 0.0227 | 0 | 0 | 1.65 KB |
master | EnrichedLog |
net472 | 4.29μs | 2.97ns | 11.5ns | 0.323 | 0 | 0 | 2.04 KB |
#6334 | EnrichedLog |
net6.0 | 2.88μs | 1.39ns | 5.21ns | 0.0216 | 0 | 0 | 1.6 KB |
#6334 | EnrichedLog |
netcoreapp3.1 | 3.96μs | 1.31ns | 4.89ns | 0.0218 | 0 | 0 | 1.65 KB |
#6334 | EnrichedLog |
net472 | 4.4μs | 2.6ns | 9.75ns | 0.324 | 0 | 0 | 2.04 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 |
net6.0 | 490ns | 1.16ns | 4.49ns | 0.00816 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 598ns | 0.944ns | 3.53ns | 0.0079 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 635ns | 1.16ns | 4.5ns | 0.0916 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 553ns | 0.346ns | 1.29ns | 0.00974 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 708ns | 0.648ns | 2.51ns | 0.0095 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 836ns | 1.26ns | 4.86ns | 0.104 | 0 | 0 | 658 B |
#6334 | StartFinishSpan |
net6.0 | 462ns | 0.704ns | 2.63ns | 0.00817 | 0 | 0 | 576 B |
#6334 | StartFinishSpan |
netcoreapp3.1 | 546ns | 1ns | 3.89ns | 0.00774 | 0 | 0 | 576 B |
#6334 | StartFinishSpan |
net472 | 657ns | 1.6ns | 6.2ns | 0.0916 | 0 | 0 | 578 B |
#6334 | StartFinishScope |
net6.0 | 515ns | 1.01ns | 3.9ns | 0.00982 | 0 | 0 | 696 B |
#6334 | StartFinishScope |
netcoreapp3.1 | 676ns | 0.677ns | 2.53ns | 0.00943 | 0 | 0 | 696 B |
#6334 | StartFinishScope |
net472 | 895ns | 1.54ns | 5.75ns | 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 | 724ns | 1.13ns | 4.39ns | 0.00982 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 920ns | 0.973ns | 3.64ns | 0.00926 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.09μs | 2.49ns | 9.66ns | 0.104 | 0 | 0 | 658 B |
#6334 | RunOnMethodBegin |
net6.0 | 658ns | 1.34ns | 5.18ns | 0.00978 | 0 | 0 | 696 B |
#6334 | RunOnMethodBegin |
netcoreapp3.1 | 889ns | 1.82ns | 7.05ns | 0.00954 | 0 | 0 | 696 B |
#6334 | RunOnMethodBegin |
net472 | 1.13μs | 1.51ns | 5.86ns | 0.104 | 0 | 0 | 658 B |
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.
LGTM
@tonyredondo why not this one
|
ICorProfilerMethodEnum
to use the COMPtrHolder
ICorProfilerMethodEnum
to use the COMPtr
you're right 🤦🏻 fixed in 49c9328 |
Summary of changes
This PR changes the way we handle
ICorProfilerMethodEnum
to use theCOMPtr
to release it when it's out of scope.Reason for change
Match the rejitprofiler test in the dotnet runtime repo: https://github.com/dotnet/runtime/blob/98049e56a415d9bcf2d002fba71f399ba08cf39c/src/tests/profiler/native/rejitprofiler/rejitprofiler.cpp#L280-L281
and instead of manually calling
Release
use theCOMPtrHolder
to automatically release it.